]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
util: don't print EHT info if not present
authorJohannes Berg <johannes.berg@intel.com>
Wed, 15 Mar 2023 15:08:22 +0000 (16:08 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 14 Apr 2023 10:56:23 +0000 (12:56 +0200)
That's just confusing, don't print it if the EHT MAC
capabilities attribute isn't there (the kernel puts
all the attrs together.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
util.c

diff --git a/util.c b/util.c
index 80dc30170a6e8248f6bd5b5b1dba6aa948dc2738..50e3fbc41f82aa690e217976d900c255ac355b20 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1593,7 +1593,8 @@ void print_eht_info(struct nlattr *nl_iftype, int band)
        nla_parse(tb, NL80211_BAND_IFTYPE_ATTR_MAX,
                  nla_data(nl_iftype), nla_len(nl_iftype), NULL);
 
-       if (!tb[NL80211_BAND_IFTYPE_ATTR_IFTYPES])
+       if (!tb[NL80211_BAND_IFTYPE_ATTR_IFTYPES] ||
+           !tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC])
                return;
 
        printf("\t\tEHT Iftypes: ");