[PATCH] wext: fix maxrate calculation

Jouni Malinen j at w1.fi
Tue Jul 15 13:09:04 EDT 2008

On Wed, Jul 09, 2008 at 11:43:17AM -0400, Dan Williams wrote:

> When scan results got moved from wpa_scan_result -> wpa_scan_res, the
> 'maxrate' member was dropped from wpa_scan_res.  The D-Bus interface
> used 'maxrate', which was replaced with wpa_scan_get_max_rate().
> Unfortunately, wpa_scan_get_max_rate() returns 802.11 rate values
> directly from the IE, where 'maxrate' was the rate in bits/second.  The
> supplicant internally fakes an IE for wpa_scan_res from the value of
> wpa_scan_result->maxrate, but interprets ->maxrate as an 802.11 rate
> index.

Thanks! Applied.

> diff --git a/wpa_supplicant/ctrl_iface_dbus_handlers.c b/wpa_supplicant/ctrl_iface_dbus_handlers.c

>  	if (!wpa_dbus_dict_append_int32(&iter_dict, "maxrate",
> -					wpa_scan_get_max_rate(res)))
> +					(wpa_scan_get_max_rate(res) & 0x7F) * 500000))

This masking with 0x7f should really be in wpa_scan_get_max_rate() to
handle basic rate field properly. I moved it there as a separate fix for
scan result processing.

Jouni Malinen                                            PGP id EFC895FA

More information about the HostAP mailing list