]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix processing of channel list update events
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 1 Mar 2012 15:53:53 +0000 (17:53 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 1 Mar 2012 15:59:39 +0000 (17:59 +0200)
Commit 6bf731e8cea4d9d41665d271b331e096c7c569e9 broke handling of
EVENT_CHANNEL_LIST_CHANGED by introducing a cached copy of the driver
channel list that does not get updated even if driver changes its list.
Fix this by synchronizing the cacched wpa_s->hw.modes information
whenever EVENT_CHANNEL_LIST_CHANGED is processed. This fixes P2P channel
list updates based on regulatory domain hints that may trigger driver to
change its supported channel list.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
intended-for: hostap-1

wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index 139972b363b8fc850b7d75fc85100792f3c751dd..0fb2d682e129e7f074daacfab386f99162dfa5fc 100644 (file)
@@ -2539,6 +2539,11 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
        case EVENT_CHANNEL_LIST_CHANGED:
                if (wpa_s->drv_priv == NULL)
                        break; /* Ignore event during drv initialization */
+
+               free_hw_features(wpa_s);
+               wpa_s->hw.modes = wpa_drv_get_hw_feature_data(
+                       wpa_s, &wpa_s->hw.num_modes, &wpa_s->hw.flags);
+
 #ifdef CONFIG_P2P
                wpas_p2p_update_channel_list(wpa_s);
 #endif /* CONFIG_P2P */
index 211e3258ffb2e09843ee1c6cf735a731ca5271bc..fdee4076d7fc775be0ccd40121549aa7a832dd09 100644 (file)
@@ -348,7 +348,7 @@ void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s,
 }
 
 
-static void free_hw_features(struct wpa_supplicant *wpa_s)
+void free_hw_features(struct wpa_supplicant *wpa_s)
 {
        int i;
        if (wpa_s->hw.modes == NULL)
index cb9fd52905f84a5fe3e5f549492c050c76182593..0ba19358f01475e9d5878f4364d1a1039382e0fc 100644 (file)
@@ -586,6 +586,7 @@ int wpa_supplicant_set_bss_expiration_count(struct wpa_supplicant *wpa_s,
 int wpa_supplicant_set_debug_params(struct wpa_global *global,
                                    int debug_level, int debug_timestamp,
                                    int debug_show_keys);
+void free_hw_features(struct wpa_supplicant *wpa_s);
 
 void wpa_show_license(void);