diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2015-04-07 14:24:12 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2015-04-08 19:08:57 +0200 |
commit | 9fed01e407813e621dc0f628261b69436f9c6463 (patch) | |
tree | a826ae0cb100edb069b32143c2ea6ccccc46dcce | |
parent | d8ffe95c878b896b4bbc72e21daa8c2d1c55cf31 (diff) | |
download | NetworkManager-lr/veth-not-software.tar.gz |
device: turn off "unmanaged unless IFF_UP externally" for vethlr/veth-not-software
We currently don't manage a veth inside a container despite we should because
it's an externally configured software interface and thus waits for IFF_UP.
Given veths are prevented from being managed outside of a container by an udev
rule anyway it's safe to lift the external IFF_UP requirement for them.
-rw-r--r-- | src/devices/nm-device-veth.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/devices/nm-device-veth.c b/src/devices/nm-device-veth.c index 6a05cc3214..02a5005e79 100644 --- a/src/devices/nm-device-veth.c +++ b/src/devices/nm-device-veth.c @@ -96,6 +96,15 @@ get_peer (NMDeviceVeth *self) return priv->peer; } +static gboolean +manage_on_external_up (NMDevice *self) +{ + /* Unless running in a container, an udev rule causes these to be + * unmanaged. If there's no udev then we're probably in a container + * and should IFF_UP and configure the veth ourselves even if we + * didn't create it. */ + return FALSE; +} /**************************************************************/ @@ -140,12 +149,15 @@ static void nm_device_veth_class_init (NMDeviceVethClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); + NMDeviceClass *device_class = NM_DEVICE_CLASS (klass); g_type_class_add_private (klass, sizeof (NMDeviceVethPrivate)); object_class->get_property = get_property; object_class->dispose = dispose; + device_class->manage_on_external_up = manage_on_external_up; + /* properties */ g_object_class_install_property (object_class, PROP_PEER, |