public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: iwd@lists.linux.dev
Cc: Denis Kenzior <denkenz@gmail.com>
Subject: [PATCH 04/11] netdev: Don't unnecessarily call netdev_connect_failed
Date: Tue, 14 Nov 2023 11:14:27 -0600	[thread overview]
Message-ID: <20231114171455.1108856-4-denkenz@gmail.com> (raw)
In-Reply-To: <20231114171455.1108856-1-denkenz@gmail.com>

netdev_begin_connection() already invokes netdev_connect_failed on
error.  Remove any calls to netdev_connect_failed in callers of
netdev_begin_connection().

Fixes: 4165d9414f54 ("netdev: use wiphy radio work queue for connections")
---
 src/netdev.c | 30 +++++++++++-------------------
 1 file changed, 11 insertions(+), 19 deletions(-)

diff --git a/src/netdev.c b/src/netdev.c
index ebb93a74d8aa..6792bb5601e2 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -3605,19 +3605,16 @@ static void netdev_mac_change_failed(struct netdev *netdev, int error)
 		WATCHLIST_NOTIFY(&netdev_watches, netdev_watch_func_t,
 				netdev, NETDEV_WATCH_EVENT_DOWN);
 
-		goto failed;
-	} else {
-		/* If the interface is up we can still try and connect */
-		l_info("Failed to change the MAC, continuing with connection");
-		if (netdev_begin_connection(netdev) < 0)
-			goto failed;
-
+		netdev_connect_failed(netdev, NETDEV_RESULT_ABORTED,
+				MMPDU_STATUS_CODE_UNSPECIFIED);
 		return;
 	}
 
-failed:
-	netdev_connect_failed(netdev, NETDEV_RESULT_ABORTED,
-				MMPDU_STATUS_CODE_UNSPECIFIED);
+	/* If the interface is up we can still try and connect */
+	l_info("Failed to change the MAC, continuing with connection");
+
+	if (netdev_begin_connection(netdev) < 0)
+		l_error("netdev_begin_connection() error in mac_change_failed");
 }
 
 static void netdev_mac_destroy(void *user_data)
@@ -3649,14 +3646,9 @@ static void netdev_mac_power_up_cb(int error, uint16_t type,
 		return;
 	}
 
-	/*
-	 * Pick up where we left off in netdev_connect_commmon.
-	 */
-	if (netdev_begin_connection(netdev) < 0) {
-		l_error("Failed to connect after changing MAC");
-		netdev_connect_failed(netdev, NETDEV_RESULT_ASSOCIATION_FAILED,
-				MMPDU_STATUS_CODE_UNSPECIFIED);
-	}
+	/* Pick up where we left off in netdev_connect_commmon */
+	if (netdev_begin_connection(netdev) < 0)
+		l_error("netdev_begin_connection() error in mac_power_up_cb");
 }
 
 static void netdev_mac_power_down_cb(int error, uint16_t type,
@@ -3870,7 +3862,7 @@ static bool netdev_connection_work_ready(struct wiphy_radio_work_item *item)
 	}
 
 	if (netdev_begin_connection(netdev) < 0)
-		goto failed;
+		return true;
 
 	return false;
 
-- 
2.42.0


  parent reply	other threads:[~2023-11-14 17:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14 17:14 [PATCH 01/11] netdev: Fix obtaining reason code from deauth frames Denis Kenzior
2023-11-14 17:14 ` [PATCH 02/11] netdev: sa_query: Fix reason code handling Denis Kenzior
2023-11-14 17:14 ` [PATCH 03/11] netdev: Use CMD_DISCONNECT if OCI fails Denis Kenzior
2023-11-14 17:14 ` Denis Kenzior [this message]
2023-11-14 17:14 ` [PATCH 05/11] netdev: Move CMD_DISCONNECT builder to nl80211util Denis Kenzior
2023-11-14 17:14 ` [PATCH 06/11] netdev: Move CMD_DEAUTHENTICATE " Denis Kenzior
2023-11-14 17:14 ` [PATCH 07/11] netdev: Move CMD_DEL_STATION " Denis Kenzior
2023-11-14 17:14 ` [PATCH 08/11] netdev: Move pairwise NEW_KEY " Denis Kenzior
2023-11-14 17:14 ` [PATCH 09/11] netdev: Move CMD_NEW_KEY RX-only " Denis Kenzior
2023-11-14 17:14 ` [PATCH 10/11] netdev: Move CMD_REKEY_OFFLOAD " Denis Kenzior
2023-11-14 17:14 ` [PATCH 11/11] netdev: disambiguate between disconnection types Denis Kenzior
2023-11-14 17:39   ` James Prestwood
2023-11-14 20:09     ` Denis Kenzior
2023-11-14 20:11       ` James Prestwood
2023-11-24 12:20   ` Alvin Šipraga
2023-11-24 16:25     ` Denis Kenzior
2023-11-25 20:57       ` Alvin Šipraga
2023-11-14 20:48 ` [PATCH 01/11] netdev: Fix obtaining reason code from deauth frames Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231114171455.1108856-4-denkenz@gmail.com \
    --to=denkenz@gmail.com \
    --cc=iwd@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox