]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Tie connect handle to bss init/destroy
authorMarkus Theil <markus.theil@tu-ilmenau.de>
Sat, 11 Apr 2020 10:25:21 +0000 (12:25 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 19 Apr 2020 12:53:02 +0000 (15:53 +0300)
This commit creates a connect nl_sock * for every bss unconditionally.
It is used in the next commit for nl80211 control port RX.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
src/drivers/driver_nl80211.c

index 3364054f8fe0bd5232468fd61d376c6f58a73cb8..228385457b6a2a55401b4ac0101645d454453406 100644 (file)
@@ -158,6 +158,7 @@ static void wpa_driver_nl80211_deinit(struct i802_bss *bss);
 static int wpa_driver_nl80211_set_mode_ibss(struct i802_bss *bss,
                                            struct hostapd_freq_params *freq);
 
+static int nl80211_init_connect_handle(struct i802_bss *bss);
 static int
 wpa_driver_nl80211_finish_drv_init(struct wpa_driver_nl80211_data *drv,
                                   const u8 *set_addr, int first,
@@ -1928,6 +1929,8 @@ static int nl80211_init_bss(struct i802_bss *bss)
        nl_cb_set(bss->nl_cb, NL_CB_VALID, NL_CB_CUSTOM,
                  process_bss_event, bss);
 
+       nl80211_init_connect_handle(bss);
+
        return 0;
 }
 
@@ -1936,6 +1939,9 @@ static void nl80211_destroy_bss(struct i802_bss *bss)
 {
        nl_cb_put(bss->nl_cb);
        bss->nl_cb = NULL;
+
+       if (bss->nl_connect)
+               nl80211_destroy_eloop_handle(&bss->nl_connect, 1);
 }
 
 
@@ -2715,8 +2721,6 @@ wpa_driver_nl80211_finish_drv_init(struct wpa_driver_nl80211_data *drv,
        if (drv->vendor_cmd_test_avail)
                qca_vendor_test(drv);
 
-       nl80211_init_connect_handle(bss);
-
        return 0;
 }
 
@@ -2829,9 +2833,6 @@ static void wpa_driver_nl80211_deinit(struct i802_bss *bss)
                nl80211_del_p2pdev(bss);
        }
 
-       if (bss->nl_connect)
-               nl80211_destroy_eloop_handle(&bss->nl_connect, 1);
-
        nl80211_destroy_bss(drv->first_bss);
 
        os_free(drv->filter_ssids);