]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Do not add own BSS in neighbor report with invalid op_class/channel
authorJouni Malinen <j@w1.fi>
Mon, 2 Jan 2017 22:21:11 +0000 (00:21 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 3 Jan 2017 13:18:30 +0000 (15:18 +0200)
Verify that ieee80211_freq_to_channel_ext() succeeds before adding the
own BSS in the neighbor report.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/hostapd.c

index 9f972ae2447402b8c8d450c7a07a6ec5090f6026..26ebbb666cd12d4ae240c36a1f90116b7364f941 100644 (file)
@@ -1603,10 +1603,12 @@ static void hostapd_set_own_neighbor_report(struct hostapd_data *hapd)
 
        /* TODO: Set NEI_REP_BSSID_INFO_MOBILITY_DOMAIN if MDE is set */
 
-       ieee80211_freq_to_channel_ext(hapd->iface->freq,
-                                     hapd->iconf->secondary_channel,
-                                     hapd->iconf->vht_oper_chwidth,
-                                     &op_class, &channel);
+       if (ieee80211_freq_to_channel_ext(hapd->iface->freq,
+                                         hapd->iconf->secondary_channel,
+                                         hapd->iconf->vht_oper_chwidth,
+                                         &op_class, &channel) ==
+           NUM_HOSTAPD_MODES)
+               return;
        width = hostapd_get_nr_chan_width(hapd, ht, vht);
        if (vht) {
                center_freq1_idx = hapd->iconf->vht_oper_centr_freq_seg0_idx;