diff mbox series

[2/2] ap: handle -ENOTSUP when getting the GTK

Message ID 20230224175928.1460558-2-prestwoj@gmail.com (mailing list archive)
State New
Headers show
Series [1/2] ap: check FULL_AP_CLIENT_STATE for NEW_STATION | expand

Checks

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

Commit Message

James Prestwood Feb. 24, 2023, 5:59 p.m. UTC
Some hardware does not support this, so use a zero RSC in this
case rather than failing the association.
---
 src/ap.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/ap.c b/src/ap.c
index fee5a6c8..aa1ae543 100644
--- a/src/ap.c
+++ b/src/ap.c
@@ -1499,10 +1499,15 @@  static void ap_gtk_query_cb(struct l_genl_msg *msg, void *user_data)
 	struct sta_state *sta = user_data;
 	const void *gtk_rsc;
 	uint8_t zero_gtk_rsc[6];
+	int err;
 
 	sta->gtk_query_cmd_id = 0;
 
-	if (l_genl_msg_get_error(msg) < 0)
+	err = l_genl_msg_get_error(msg);
+	if (err == -ENOTSUP) {
+		gtk_rsc = zero_gtk_rsc;
+		goto start_rsna;
+	} else if (err < 0)
 		goto error;
 
 	gtk_rsc = nl80211_parse_get_key_seq(msg);
@@ -1511,6 +1516,7 @@  static void ap_gtk_query_cb(struct l_genl_msg *msg, void *user_data)
 		gtk_rsc = zero_gtk_rsc;
 	}
 
+start_rsna:
 	ap_start_rsna(sta, gtk_rsc);
 	return;