From 050db0b05496246d4b847f5257caec2837fb0549 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Fri, 5 Apr 2019 11:34:50 -0700 Subject: [PATCH] netdev: fix association failure path In netdev_associate_event the ignore_connect_event was getting set true, but afterwards there were still potential failure paths. Now, once in assoc_failed we explicitly set ignore_connect_event to false so the the failure can be handled properly inside netdev_connect_event --- src/netdev.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/netdev.c b/src/netdev.c index ce6f8161..661fb817 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -2423,9 +2423,6 @@ static void netdev_associate_event(struct l_genl_msg *msg, if (status_code != 0) goto assoc_failed; - /* Connection can be fully handled here, not in connect event */ - netdev->ignore_connect_event = true; - if (netdev->sm) { /* * Start processing EAPoL frames now that the state machine @@ -2433,11 +2430,11 @@ static void netdev_associate_event(struct l_genl_msg *msg, */ if (!eapol_start(netdev->sm)) goto assoc_failed; - - if (!netdev->in_ft) - return; } + /* Connection can be fully handled here, not in connect event */ + netdev->ignore_connect_event = true; + if (netdev->in_ft) { bool is_rsn = netdev->handshake->supplicant_ie != NULL; @@ -2447,7 +2444,8 @@ static void netdev_associate_event(struct l_genl_msg *msg, handshake_state_install_ptk(netdev->handshake); return; } - } + } else if (netdev->sm) + return; netdev_connect_ok(netdev);