Skip to contentSkip to conversation

iw: print out assoc comeback event.

PATCH New [email protected] 1 participant 1 message Apr 7, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iw: print out assoc comeback event.

From: Ben Greear <[email protected]>

Looks like this was added in 5.17 kernel. We see this event when trying (and failing) to do .11r roaming).

---
 event.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
event.c +20 -0
index 1d201a8..ee73a57 100644
@@ -893,6 +893,23 @@ static void parse_ch_switch_notify(struct nlattr **attrs, int command)
 	printf("\n");
 }
 
+static void parse_assoc_comeback(struct nlattr **attrs, int command)
+{
+	__u32 timeout = 0;
+	char macbuf[6*3];
+
+	macbuf[0] = 0;
+
+	if (attrs[NL80211_ATTR_MAC])
+		mac_addr_n2a(macbuf, nla_data(attrs[NL80211_ATTR_MAC]));
+
+	if (attrs[NL80211_ATTR_TIMEOUT])
+		timeout = nla_get_u32(attrs[NL80211_ATTR_TIMEOUT]);
+
+	printf("assoc comeback bssid %s timeout %d\n",
+	       macbuf, timeout);
+}
+
 static int print_event(struct nl_msg *msg, void *arg)
 {
 	struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
@@ -1285,6 +1302,9 @@ static int print_event(struct nl_msg *msg, void *arg)
 	case NL80211_CMD_CH_SWITCH_NOTIFY:
 		parse_ch_switch_notify(tb, gnlh->cmd);
 		break;
+	case NL80211_CMD_ASSOC_COMEBACK: /* 147 */
+		parse_assoc_comeback(tb, gnlh->cmd);
+		break;
 	default:
 		printf("unknown event %d (%s)\n",
 		       gnlh->cmd, command_name(gnlh->cmd));
Signature · 1 line
2.21.3