mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-23 06:02:37 +01:00
ie: fix ie_parse_data_rates to handle NULL
The code was partially there to handle NULL IEs but not quite. If NULL IEs are passed in base the data rate totally on the basic rate RSSI table.
This commit is contained in:
parent
f3d662db74
commit
7b26a87d7a
5
src/ie.c
5
src/ie.c
@ -1688,6 +1688,7 @@ static int ie_parse_supported_rates(struct ie_tlv_iter *supp_rates_iter,
|
|||||||
max_rate = map->rate;
|
max_rate = map->rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (supp_rates_iter) {
|
||||||
/* Find highest rate in Supported Rates IE */
|
/* Find highest rate in Supported Rates IE */
|
||||||
rates = ie_tlv_iter_get_data(supp_rates_iter);
|
rates = ie_tlv_iter_get_data(supp_rates_iter);
|
||||||
|
|
||||||
@ -1697,6 +1698,7 @@ static int ie_parse_supported_rates(struct ie_tlv_iter *supp_rates_iter,
|
|||||||
if (r <= max_rate && r > highest)
|
if (r <= max_rate && r > highest)
|
||||||
highest = r;
|
highest = r;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Find highest rate in Extended Supported Rates IE */
|
/* Find highest rate in Extended Supported Rates IE */
|
||||||
if (ext_supp_rates_iter) {
|
if (ext_supp_rates_iter) {
|
||||||
@ -1711,7 +1713,10 @@ static int ie_parse_supported_rates(struct ie_tlv_iter *supp_rates_iter,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (highest)
|
||||||
*data_rate = (highest / 2) * 1000000;
|
*data_rate = (highest / 2) * 1000000;
|
||||||
|
else
|
||||||
|
*data_rate = (max_rate / 2) * 1000000;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user