From da0d51fee74b01aabefe646869cd09afbc2b22f4 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 18 Dec 2023 21:41:32 +0200 Subject: [PATCH] nl80211: Use socket cb instead of global->nl_cb in send_and_recv() 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 --- src/drivers/driver_nl80211.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 1a8ca5a0d..818b6d0c7 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -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);