]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Allow setting scan_res_handler from the callback function
authorJohannes Berg <johannes.berg@intel.com>
Fri, 17 Dec 2010 13:31:05 +0000 (15:31 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 17 Dec 2010 13:31:05 +0000 (15:31 +0200)
Some new code I'm working on will need the scan_res_handler assigned all
the time in certain circumstances, so the easiest way is to reset it
within the handler. This is currently prevented by the way the code in
the event handler works -- change that to permit such usage.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
wpa_supplicant/events.c

index 988c31ac8a89b7e279e70a9d2b821540d74218a6..a38d8e9e1457d459827f70cad36a5c2f52acb787 100644 (file)
@@ -873,8 +873,13 @@ static void _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
 #endif /* CONFIG_NO_RANDOM_POOL */
 
        if (wpa_s->scan_res_handler) {
-               wpa_s->scan_res_handler(wpa_s, scan_res);
+               void (*scan_res_handler)(struct wpa_supplicant *wpa_s,
+                                        struct wpa_scan_results *scan_res);
+
+               scan_res_handler = wpa_s->scan_res_handler;
                wpa_s->scan_res_handler = NULL;
+               scan_res_handler(wpa_s, scan_res);
+
                wpa_scan_results_free(scan_res);
                return;
        }