diff mbox series

[3/7] netdev: reuse NETDEV_EVENT_{AUTHENTICATING,ASSOCIATING}

Message ID 20240625130624.385553-3-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [1/7] netdev: use nl80211_parse_attrs for deauth event | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood June 25, 2024, 1:06 p.m. UTC
The authenticating event was not used anymore and the associating
event use was questionable (after the CMD_CONNECT callback).

No other modules actually utilize these events but they are useful
for autotests. Move these events around to map 1:1 when the kernel
sends the auth/assoc events.
---
 src/netdev.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Comments

Denis Kenzior June 26, 2024, 2:43 p.m. UTC | #1
Hi James,

On 6/25/24 8:06 AM, James Prestwood wrote:
> The authenticating event was not used anymore and the associating
> event use was questionable (after the CMD_CONNECT callback).
> 
> No other modules actually utilize these events but they are useful
> for autotests. Move these events around to map 1:1 when the kernel
> sends the auth/assoc events.

So I went ahead and applied all of these since these events weren't really used. 
  One thing to keep in mind is that the ASSOCIATE event firing in 
netdev_driver_connected was to take care of full-mac hardware that doesn't send 
authenticate / associate events over NL80211.  I think at some point this was 
used as a hint for something, even on full mac cards, but isn't any more.

> ---
>   src/netdev.c | 12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)
> 

Regards,
-Denis
diff mbox series

Patch

diff --git a/src/netdev.c b/src/netdev.c
index bada1ab5..153001ab 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -2422,10 +2422,6 @@  static void netdev_driver_connected(struct netdev *netdev)
 {
 	netdev->connected = true;
 
-	if (netdev->event_filter)
-		netdev->event_filter(netdev, NETDEV_EVENT_ASSOCIATING, NULL,
-					netdev->user_data);
-
 	/*
 	 * We register the eapol state machine here, in case the PAE
 	 * socket receives EAPoL packets before the nl80211 socket
@@ -2919,6 +2915,10 @@  static void netdev_authenticate_event(struct l_genl_msg *msg,
 		return;
 	}
 
+	if (netdev->event_filter)
+		netdev->event_filter(netdev, NETDEV_EVENT_AUTHENTICATING,
+					NULL, netdev->user_data);
+
 	/*
 	 * During Fast Transition we use the authenticate event to start the
 	 * reassociation step because the FTE necessary before we can build
@@ -3040,6 +3040,10 @@  static void netdev_associate_event(struct l_genl_msg *msg,
 	if (!netdev->connected || netdev->aborting)
 		return;
 
+	if (netdev->event_filter)
+		netdev->event_filter(netdev, NETDEV_EVENT_ASSOCIATING,
+					NULL, netdev->user_data);
+
 	if (!netdev->ap && !netdev->in_ft) {
 		netdev->associated = true;
 		netdev->in_reassoc = false;