]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Use socket cb instead of global->nl_cb in send_and_recv()
authorJouni Malinen <quic_jouni@quicinc.com>
Mon, 18 Dec 2023 19:41:32 +0000 (21:41 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 18 Dec 2023 19:41:32 +0000 (21:41 +0200)
This is a step towards cleaning up all the workarounds that have showed
up over the years and made the design difficult to understand. This
removes use of the separate registration of process_bss_event() as
NL_CB_VALID for the individual commands since the use of the appropriate
cb (i.e., the one from nl80211_init_bss() in these cases) will already
point to the correct handler.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/drivers/driver_nl80211.c

index 1a8ca5a0ddd62d37c2ab0d28a514bb2a9a7fb73f..818b6d0c73b581ef3303758a70250acfab02a357 100644 (file)
@@ -505,7 +505,7 @@ static int send_and_recv(struct nl80211_global *global,
 
        err.err = -ENOMEM;
 
-       cb = nl_cb_clone(global->nl_cb);
+       cb = nl_cb_clone(nl_socket_get_cb(nl_handle));
        if (!cb)
                goto out;
 
@@ -649,7 +649,7 @@ send_and_recv_msgs_connect_handle(struct wpa_driver_nl80211_data *drv,
 
        if (nl_connect)
                return send_and_recv_msgs_owner(drv, msg, nl_connect, set_owner,
-                                               process_bss_event, bss, NULL,
+                                               NULL, NULL, NULL,
                                                NULL, err_info);
        else
                return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL,
@@ -3814,7 +3814,7 @@ int wpa_driver_nl80211_mlme(struct wpa_driver_nl80211_data *drv,
 
        if (nl_connect)
                ret = send_and_recv(drv->global, nl_connect, msg,
-                                   process_bss_event, bss, NULL, NULL, NULL);
+                                   NULL, NULL, NULL, NULL, NULL);
        else
                ret = send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL,
                                         NULL);