diff --git a/src/drivers/scan_helpers.c b/src/drivers/scan_helpers.c index 1dfc2e4e2..bd774c1bd 100644 --- a/src/drivers/scan_helpers.c +++ b/src/drivers/scan_helpers.c @@ -67,14 +67,14 @@ int wpa_scan_get_max_rate(const struct wpa_scan_res *res) ie = wpa_scan_get_ie(res, WLAN_EID_SUPP_RATES); for (i = 0; ie && i < ie[1]; i++) { - if (ie[i + 2] > rate) - rate = ie[i + 2]; + if ((ie[i + 2] & 0x7f) > rate) + rate = ie[i + 2] & 0x7f; } ie = wpa_scan_get_ie(res, WLAN_EID_EXT_SUPP_RATES); for (i = 0; ie && i < ie[1]; i++) { - if (ie[i + 2] > rate) - rate = ie[i + 2]; + if ((ie[i + 2] & 0x7f) > rate) + rate = ie[i + 2] & 0x7f; } return rate;