From: Johannes Berg Date: Wed, 29 Jun 2011 11:20:31 +0000 (+0200) Subject: more verbose output for interface combinations X-Git-Tag: v3.0~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5f6f15f38dc9cdce17807efb05d840cb39f5bdb;p=thirdparty%2Fiw.git more verbose output for interface combinations --- diff --git a/info.c b/info.c index aa2812a..12e5c00 100644 --- 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]) {