summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2016-02-23 14:35:53 -0600
committerDan Williams <dcbw@redhat.com>2016-02-24 09:25:35 -0600
commita3c0166a2064c41408d1e08defee3a7e4a0ce3f7 (patch)
tree3ced8b78447d849d76751e69c91eebcad1b312ef
parentab667dd885030bd15f3b0aa3310f3949b8a16df3 (diff)
wifi: ignore monitor interfaces
If a monitor interface is created, NM will grab that interface and change it to station mode. That's not very nice. https://mail.gnome.org/archives/networkmanager-list/2016-February/msg00068.html (cherry picked from commit 751a37bf433eb79653b6d498eea1ab01047dfd27)
-rw-r--r--src/devices/wifi/nm-wifi-factory.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/devices/wifi/nm-wifi-factory.c b/src/devices/wifi/nm-wifi-factory.c
index 3e31ddf412..5bc35a892e 100644
--- a/src/devices/wifi/nm-wifi-factory.c
+++ b/src/devices/wifi/nm-wifi-factory.c
@@ -64,6 +64,7 @@ static NMDevice *
new_link (NMDeviceFactory *factory, NMPlatformLink *plink, gboolean *out_ignore, GError **error)
{
NMDeviceWifiCapabilities capabilities;
+ NM80211Mode mode;
g_return_val_if_fail (plink != NULL, NULL);
g_return_val_if_fail (NM_IN_SET (plink->type, NM_LINK_TYPE_WIFI, NM_LINK_TYPE_OLPC_MESH), NULL);
@@ -75,6 +76,16 @@ new_link (NMDeviceFactory *factory, NMPlatformLink *plink, gboolean *out_ignore,
return NULL;
}
+ /* Ignore monitor-mode and other unhandled interface types.
+ * FIXME: keep TYPE_MONITOR devices in UNAVAILABLE state and manage
+ * them if/when they change to a handled type.
+ */
+ mode = nm_platform_wifi_get_mode (NM_PLATFORM_GET, plink->ifindex);
+ if (mode == NM_802_11_MODE_UNKNOWN) {
+ *out_ignore = TRUE;
+ return NULL;
+ }
+
if (plink->type == NM_LINK_TYPE_WIFI)
return nm_device_wifi_new (plink, capabilities);
else