diff mbox series

[03/11] netdev: Use CMD_DISCONNECT if OCI fails

Message ID 20231114171455.1108856-3-denkenz@gmail.com (mailing list archive)
State New
Headers show
Series [01/11] netdev: Fix obtaining reason code from deauth frames | expand

Checks

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

Commit Message

Denis Kenzior Nov. 14, 2023, 5:14 p.m. UTC
If netdev_get_oci fails, a goto deauth is invoked in order to terminate
the current connection and return an error to the caller.  Unfortunately
the deauth label builds CMD_DEAUTHENTICATE in order to terminate the
connection.  This was fine because it used to handle authentication
protocols that ran over CMD_AUTHENTICATE and CMD_ASSOCIATE.  However,
OCI can also be used on FullMAC hardware that does not support them.
Use CMD_DISCONNECT instead which works everywhere.

Fixes: 06482b811626 ("netdev: Obtain operating channel info")
---
 src/netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/netdev.c b/src/netdev.c
index 72876f3a39a1..ebb93a74d8aa 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -2989,7 +2989,7 @@  error:
 deauth:
 	netdev->result = NETDEV_RESULT_ASSOCIATION_FAILED;
 	netdev->last_code = MMPDU_STATUS_CODE_UNSPECIFIED;
-	msg = netdev_build_cmd_deauthenticate(netdev,
+	msg = netdev_build_cmd_disconnect(netdev,
 						MMPDU_REASON_CODE_UNSPECIFIED);
 	netdev->disconnect_cmd_id = l_genl_family_send(nl80211,
 							msg,