]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: print out assoc comeback event
authorBen Greear <greearb@candelatech.com>
Thu, 7 Apr 2022 23:58:26 +0000 (16:58 -0700)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 11 Apr 2022 13:06:36 +0000 (15:06 +0200)
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>
Link: https://lore.kernel.org/r/20220407235826.2690-1-greearb@candelatech.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
event.c

diff --git a/event.c b/event.c
index ad29189f2676d79c0940083e9759979c99498271..4c37297b4164788cfe583f1619ae326f404d2efd 100644 (file)
--- a/event.c
+++ b/event.c
@@ -893,6 +893,21 @@ 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] = "<unset>";
+
+       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));
@@ -1277,6 +1292,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));