]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Update wpa_supplicant channel list on FLUSH
authorJouni Malinen <j@w1.fi>
Tue, 1 Jan 2019 13:58:46 +0000 (15:58 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 1 Jan 2019 13:58:46 +0000 (15:58 +0200)
Try to make sure the driver channel list state is synchronized with
wpa_supplicant whenever explicitly clearing state (e.g., between hwsim
test cases).

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/ctrl_iface.c
wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant_i.h

index 767a006436a642c224eee958af58b784a1d296b2..42a5e886dd2e39782a15ee60bf47ea2e7a44689f 100644 (file)
@@ -7957,6 +7957,8 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
 
        wpabuf_free(wpa_s->ric_ies);
        wpa_s->ric_ies = NULL;
+
+       wpa_supplicant_update_channel_list(wpa_s, NULL);
 }
 
 
index 7f2302900c1703f7f779fe8bf803eced661b6b91..e4ee7e20bc44179a0071a0982b1a8a559ac69f10 100644 (file)
@@ -3633,8 +3633,8 @@ static const char * reg_type_str(enum reg_type type)
 }
 
 
-static void wpa_supplicant_update_channel_list(
-       struct wpa_supplicant *wpa_s, struct channel_list_changed *info)
+void wpa_supplicant_update_channel_list(struct wpa_supplicant *wpa_s,
+                                       struct channel_list_changed *info)
 {
        struct wpa_supplicant *ifs;
        u8 dfs_domain;
@@ -3648,10 +3648,13 @@ static void wpa_supplicant_update_channel_list(
        for (ifs = wpa_s; ifs->parent && ifs != ifs->parent; ifs = ifs->parent)
                ;
 
-       wpa_msg(ifs, MSG_INFO, WPA_EVENT_REGDOM_CHANGE "init=%s type=%s%s%s",
-               reg_init_str(info->initiator), reg_type_str(info->type),
-               info->alpha2[0] ? " alpha2=" : "",
-               info->alpha2[0] ? info->alpha2 : "");
+       if (info) {
+               wpa_msg(ifs, MSG_INFO,
+                       WPA_EVENT_REGDOM_CHANGE "init=%s type=%s%s%s",
+                       reg_init_str(info->initiator), reg_type_str(info->type),
+                       info->alpha2[0] ? " alpha2=" : "",
+                       info->alpha2[0] ? info->alpha2 : "");
+       }
 
        if (wpa_s->drv_priv == NULL)
                return; /* Ignore event during drv initialization */
index 615f658ca88649a2399431d072b2635de645271e..c8079c7132a2c862022c2098ebcb0464b546eba0 100644 (file)
@@ -1427,6 +1427,8 @@ int wpa_supplicant_fast_associate(struct wpa_supplicant *wpa_s);
 struct wpa_bss * wpa_supplicant_pick_network(struct wpa_supplicant *wpa_s,
                                             struct wpa_ssid **selected_ssid);
 int wpas_temp_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
+void wpa_supplicant_update_channel_list(struct wpa_supplicant *wpa_s,
+                                       struct channel_list_changed *info);
 
 /* eap_register.c */
 int eap_register_methods(void);