[PATCH 2/3] Added notifications about chenges in BBSIDs list

Jouni Malinen j
Mon Nov 9 10:46:39 PST 2009


On Sun, Oct 18, 2009 at 03:56:02AM +0200, Witold Sowa wrote:
> If scan results introduces new BSSs or discards some previously known,
> new wpas_notify_bss_added or wpas_notify_bss_removed notifications are
> called

>  int wpa_supplicant_get_scan_results(struct wpa_supplicant *wpa_s)
>  {
>  	int ret;
> +	struct wpa_scan_results *prev_scan_res = wpa_s->scan_res;
>  
> -	wpa_scan_results_free(wpa_s->scan_res);
> @@ -1681,6 +1711,8 @@ int wpa_supplicant_get_scan_results(struct wpa_supplicant *wpa_s)
> +	notify_about_bssid_chenges(wpa_s, prev_scan_res, wpa_s->scan_res);
> +	wpa_scan_results_free(prev_scan_res);

While I understand the desire for getting BSS added/removed
notifications, the proposed change here is unfortunately introducing
possibility for increased memory use by keeping two full sets of scan
results in memory at the same time. In some cases, this can potentially
increase the memory use by something like 128 kB (the limit used with
WEXT; could potentially be even more) which is not really desired in
number of embedded use cases for wpa_supplicant.

It looks like the only information used from the old scan results is the
BSSID. I would assume it would be possible to create a smaller table of
old BSSIDs from the old results, free the old results, fetch the new
results, and compare the new results to the list of previously known
BSSIDs instead. This should reduce the worst case memory use quite a
bit.
 
-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list