]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
more verbose output for interface combinations
authorJohannes Berg <johannes.berg@intel.com>
Wed, 29 Jun 2011 11:20:31 +0000 (13:20 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 29 Jun 2011 11:20:31 +0000 (13:20 +0200)
info.c

diff --git a/info.c b/info.c
index aa2812af5aec0bec3ebc8af2f970a080949197e5..12e5c00c576ac6c63b5009f55cbc2807d644af72 100644 (file)
--- a/info.c
+++ b/info.c
@@ -195,8 +195,7 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
        if (tb_msg[NL80211_ATTR_INTERFACE_COMBINATIONS]) {
                struct nlattr *nl_combi;
                int rem_combi;
-
-               printf("\tvalid interface combinations:\n");
+               bool have_combinations = false;
 
                nla_for_each_nested(nl_combi, tb_msg[NL80211_ATTR_INTERFACE_COMBINATIONS], rem_combi) {
                        static struct nla_policy iface_combination_policy[NUM_NL80211_IFACE_COMB] = {
@@ -215,6 +214,11 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
                        int err, rem_limit;
                        bool comma = false;
 
+                       if (!have_combinations) {
+                               printf("\tvalid interface combinations:\n");
+                               have_combinations = true;
+                       }
+
                        printf("\t\t * ");
 
                        err = nla_parse_nested(tb_comb, MAX_NL80211_IFACE_COMB,
@@ -258,6 +262,9 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
 broken_combination:
                        ;
                }
+
+               if (!have_combinations)
+                       printf("\tinterface combinations are not supported\n");
        }
 
        if (tb_msg[NL80211_ATTR_SUPPORTED_COMMANDS]) {