diff mbox series

iw: print out assoc comeback event.

Message ID 20220407235826.2690-1-greearb@candelatech.com
State New
Headers show
Series iw: print out assoc comeback event. | expand

Commit Message

Ben Greear April 7, 2022, 11:58 p.m. UTC
From: Ben Greear <greearb@candelatech.com>

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

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 event.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
diff mbox series

Patch

diff --git a/event.c b/event.c
index 1d201a8..ee73a57 100644
--- a/event.c
+++ b/event.c
@@ -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));