summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2022-03-10 18:01:43 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2022-03-14 08:50:28 +0100
commit5abb1133868ff34fb1de633eb25937670389f18a (patch)
tree20917da669db547ca7f69b36948514f1317f598f
parent3a41f6539ed3d06ffc735fe63d6b06dfc271b0ed (diff)
wifi: ignore disabled frequencies
Frequencies with the 'disabled' flag are supported by the driver but disabled in the current regulatory domain. Don't add them to the list of supported frequencies since they are not usable. This is especially needed since commit f18bf17deaa5 ('wifi: cleanup ensure_hotspot_frequency()'), as now NetworkManager explicitly sets a random, stable channel for Wi-Fi hotspots. If the choosen channel is disabled, the hotspot fails to start. Disabled channels are displayed in the 'iw phy' output as '(disabled)': [...] Frequencies: * 2412 MHz [1] (30.0 dBm) * 2417 MHz [2] (30.0 dBm) * 2422 MHz [3] (30.0 dBm) * 2427 MHz [4] (30.0 dBm) * 2432 MHz [5] (30.0 dBm) * 2437 MHz [6] (30.0 dBm) * 2442 MHz [7] (30.0 dBm) * 2447 MHz [8] (30.0 dBm) * 2452 MHz [9] (30.0 dBm) * 2457 MHz [10] (30.0 dBm) * 2462 MHz [11] (30.0 dBm) * 2467 MHz [12] (disabled) * 2472 MHz [13] (disabled) * 2484 MHz [14] (disabled) Note that currently NM loads the list only at startup and therefore, in case of a change of regulatory domain, a restart of the daemon is needed to have the list updated. This needs to be improved. https://bugzilla.redhat.com/show_bug.cgi?id=2062785 Fixes: f18bf17deaa5 ('wifi: cleanup ensure_hotspot_frequency()')
-rw-r--r--src/libnm-platform/wifi/nm-wifi-utils-nl80211.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libnm-platform/wifi/nm-wifi-utils-nl80211.c b/src/libnm-platform/wifi/nm-wifi-utils-nl80211.c
index b064ff2942..475b8a390a 100644
--- a/src/libnm-platform/wifi/nm-wifi-utils-nl80211.c
+++ b/src/libnm-platform/wifi/nm-wifi-utils-nl80211.c
@@ -671,6 +671,9 @@ nl80211_wiphy_info_handler(struct nl_msg *msg, void *arg)
if (!tb_freq[NL80211_FREQUENCY_ATTR_FREQ])
continue;
+ if (tb_freq[NL80211_FREQUENCY_ATTR_DISABLED])
+ continue;
+
if (info->num_freqs >= num_alloc) {
num_alloc *= 2;
info->freqs = g_renew(guint32, info->freqs, num_alloc);