summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2016-02-23 14:35:53 -0600
committerThomas Haller <thaller@redhat.com>2016-02-24 11:43:42 +0100
commit751a37bf433eb79653b6d498eea1ab01047dfd27 (patch)
tree6a6a4f4484fe3dbb05c00cadd00539c7e4e7dbfe
parentb913e1d641e98c99f27936d76828998ae5534fbb (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
-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 1c8ca47b52..2d5f8faf00 100644
--- a/src/devices/wifi/nm-wifi-factory.c
+++ b/src/devices/wifi/nm-wifi-factory.c
@@ -66,6 +66,7 @@ create_device (NMDeviceFactory *factory,
gboolean *out_ignore)
{
NMDeviceWifiCapabilities capabilities;
+ NM80211Mode mode;
g_return_val_if_fail (iface != NULL, NULL);
g_return_val_if_fail (plink != NULL, NULL);
@@ -79,6 +80,16 @@ create_device (NMDeviceFactory *factory,
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 (iface, capabilities);
else