--- src/drivers/driver_nl80211.c | 45 +++++++++++++++++++++-------------------- 1 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 1f0b7e0..0c098ae 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -132,6 +132,9 @@ struct i802_bss { unsigned int beacon_set:1; unsigned int added_if_into_bridge:1; unsigned int added_bridge:1; + + struct nl_handle *nl_handle_preq; + struct nl_cache *nl_cache_preq; }; struct wpa_driver_nl80211_data { @@ -156,10 +159,8 @@ struct wpa_driver_nl80211_data { struct nl_handle *nl_handle; struct nl_handle *nl_handle_event; - struct nl_handle *nl_handle_preq; struct nl_cache *nl_cache; struct nl_cache *nl_cache_event; - struct nl_cache *nl_cache_preq; struct nl_cb *nl_cb; struct genl_family *nl80211; @@ -2500,7 +2501,7 @@ static void wpa_driver_nl80211_deinit(void *priv) eloop_unregister_read_sock(drv->eapol_tx_sock); close(drv->eapol_tx_sock); - if (drv->nl_handle_preq) + if (bss->nl_handle_preq) wpa_driver_nl80211_probe_req_report(bss, 0); if (bss->added_if_into_bridge) { if (linux_br_del_if(drv->ioctl_sock, bss->brname, bss->ifname) @@ -6851,30 +6852,30 @@ static int wpa_driver_nl80211_probe_req_report(void *priv, int report) struct wpa_driver_nl80211_data *drv = bss->drv; if (!report) { - if (drv->nl_handle_preq) { + if (bss->nl_handle_preq) { eloop_unregister_read_sock( - nl_socket_get_fd(drv->nl_handle_preq)); - nl_cache_free(drv->nl_cache_preq); - nl80211_handle_destroy(drv->nl_handle_preq); - drv->nl_handle_preq = NULL; + nl_socket_get_fd(bss->nl_handle_preq)); + nl_cache_free(bss->nl_cache_preq); + nl80211_handle_destroy(bss->nl_handle_preq); + bss->nl_handle_preq = NULL; } return 0; } - if (drv->nl_handle_preq) { + if (bss->nl_handle_preq) { wpa_printf(MSG_DEBUG, "nl80211: Probe Request reporting " "already on!"); return 0; } - drv->nl_handle_preq = nl80211_handle_alloc(drv->nl_cb); - if (drv->nl_handle_preq == NULL) { + bss->nl_handle_preq = nl80211_handle_alloc(drv->nl_cb); + if (bss->nl_handle_preq == NULL) { wpa_printf(MSG_ERROR, "nl80211: Failed to allocate " "netlink callbacks (preq)"); goto out_err1; } - if (genl_connect(drv->nl_handle_preq)) { + if (genl_connect(bss->nl_handle_preq)) { wpa_printf(MSG_ERROR, "nl80211: Failed to connect to " "generic netlink (preq)"); goto out_err2; @@ -6882,39 +6883,39 @@ static int wpa_driver_nl80211_probe_req_report(void *priv, int report) } #ifdef CONFIG_LIBNL20 - if (genl_ctrl_alloc_cache(drv->nl_handle_preq, - &drv->nl_cache_preq) < 0) { + if (genl_ctrl_alloc_cache(bss->nl_handle_preq, + &bss->nl_cache_preq) < 0) { wpa_printf(MSG_ERROR, "nl80211: Failed to allocate generic " "netlink cache (preq)"); goto out_err2; } #else /* CONFIG_LIBNL20 */ - drv->nl_cache_preq = genl_ctrl_alloc_cache(drv->nl_handle_preq); - if (drv->nl_cache_preq == NULL) { + bss->nl_cache_preq = genl_ctrl_alloc_cache(bss->nl_handle_preq); + if (bss->nl_cache_preq == NULL) { wpa_printf(MSG_ERROR, "nl80211: Failed to allocate generic " "netlink cache (preq)"); goto out_err2; } #endif /* CONFIG_LIBNL20 */ - if (nl80211_register_frame(drv, drv->nl_handle_preq, + if (nl80211_register_frame(drv, bss->nl_handle_preq, (WLAN_FC_TYPE_MGMT << 2) | (WLAN_FC_STYPE_PROBE_REQ << 4), NULL, 0) < 0) { goto out_err3; } - eloop_register_read_sock(nl_socket_get_fd(drv->nl_handle_preq), + eloop_register_read_sock(nl_socket_get_fd(bss->nl_handle_preq), wpa_driver_nl80211_event_receive, drv, - drv->nl_handle_preq); + bss->nl_handle_preq); return 0; out_err3: - nl_cache_free(drv->nl_cache_preq); + nl_cache_free(bss->nl_cache_preq); out_err2: - nl80211_handle_destroy(drv->nl_handle_preq); - drv->nl_handle_preq = NULL; + nl80211_handle_destroy(bss->nl_handle_preq); + bss->nl_handle_preq = NULL; out_err1: return -1; } -- 1.7.6.3