From: Jouni Malinen Date: Tue, 2 Aug 2016 14:41:01 +0000 (+0300) Subject: Show disabled HT/VHT properly in AP mode STATUS command X-Git-Tag: hostap_2_6~179 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a5638a3bf13114c3523de0767430587b8102559;p=thirdparty%2Fhostap.git Show disabled HT/VHT properly in AP mode STATUS command Previously, HT/VHT state was shown in STATUS based on the configuration parameter instead of the runtime operational parameters. This could result in claiming HT/VHT to be enabled even when it was forced to be disabled due to an incompatible configuration. Clear HT/VHT information in the STATUS output if HT/VHT has been disabled. Signed-off-by: Jouni Malinen --- diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c index 14c154f80..17a3ea457 100644 --- a/src/ap/ctrl_iface_ap.c +++ b/src/ap/ctrl_iface_ap.c @@ -514,20 +514,28 @@ int hostapd_ctrl_iface_status(struct hostapd_data *hapd, char *buf, "channel=%u\n" "secondary_channel=%d\n" "ieee80211n=%d\n" - "ieee80211ac=%d\n" - "vht_oper_chwidth=%d\n" - "vht_oper_centr_freq_seg0_idx=%d\n" - "vht_oper_centr_freq_seg1_idx=%d\n", + "ieee80211ac=%d\n", iface->conf->channel, - iface->conf->secondary_channel, - iface->conf->ieee80211n, - iface->conf->ieee80211ac, - iface->conf->vht_oper_chwidth, - iface->conf->vht_oper_centr_freq_seg0_idx, - iface->conf->vht_oper_centr_freq_seg1_idx); + iface->conf->ieee80211n && !hapd->conf->disable_11n ? + iface->conf->secondary_channel : 0, + iface->conf->ieee80211n && !hapd->conf->disable_11n, + iface->conf->ieee80211ac && + !hapd->conf->disable_11ac); if (os_snprintf_error(buflen - len, ret)) return len; len += ret; + if (iface->conf->ieee80211ac && !hapd->conf->disable_11ac) { + ret = os_snprintf(buf + len, buflen - len, + "vht_oper_chwidth=%d\n" + "vht_oper_centr_freq_seg0_idx=%d\n" + "vht_oper_centr_freq_seg1_idx=%d\n", + iface->conf->vht_oper_chwidth, + iface->conf->vht_oper_centr_freq_seg0_idx, + iface->conf->vht_oper_centr_freq_seg1_idx); + if (os_snprintf_error(buflen - len, ret)) + return len; + len += ret; + } for (i = 0; i < iface->num_bss; i++) { struct hostapd_data *bss = iface->bss[i];