diff options
author | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2022-03-30 16:06:38 +0200 |
---|---|---|
committer | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2022-03-31 11:22:06 +0200 |
commit | 004a8fdd680b60fba07a330b6cf781b61bc1448a (patch) | |
tree | 6622bccb053bb8351058b5f56082b6cd304f543b | |
parent | 11e8b3375f1068bc7c9111144d76862d069f592c (diff) |
ovs, dpdk: ignore ovs-netdev tun interfaceff/ovs-netdev
When configuring a OVS bridge to use the netdev datapath, OpenvSwitch
will create a tun interface named ovs-netdev. This interface should be
ignored by NetworkManager.
-rw-r--r-- | src/core/devices/nm-device-tun.c | 6 | ||||
-rw-r--r-- | src/core/devices/nm-device.c | 3 | ||||
-rw-r--r-- | src/core/nm-manager.c | 2 |
3 files changed, 9 insertions, 2 deletions
diff --git a/src/core/devices/nm-device-tun.c b/src/core/devices/nm-device-tun.c index b6c4f88b6c..e623e9c0b5 100644 --- a/src/core/devices/nm-device-tun.c +++ b/src/core/devices/nm-device-tun.c @@ -542,6 +542,12 @@ create_device(NMDeviceFactory *factory, NM_SETTING_TUN_SETTING_NAME), NULL); + /* OpenvSwitch will create a tun device named ovs-netdev when the datapath selected is netdev */ + if (nm_streq0(iface, "ovs-netdev")) { + *out_ignore = TRUE; + return NULL; + } + return g_object_new(NM_TYPE_DEVICE_TUN, NM_DEVICE_IFACE, iface, diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index ea931c6a95..7023a847db 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -6329,7 +6329,8 @@ device_recheck_slave_status(NMDevice *self, const NMPlatformLink *plink) plink_master = nm_platform_link_get(nm_device_get_platform(self), plink->master); plink_master_keep_alive = nmp_object_ref(NMP_OBJECT_UP_CAST(plink_master)); - if (master == NULL && plink_master && nm_streq0(plink_master->name, "ovs-system") + if (master == NULL && plink_master + && NM_IN_STRSET(plink_master->name, "ovs-system", "ovs-netdev") && plink_master->type == NM_LINK_TYPE_OPENVSWITCH) { _LOGD(LOGD_DEVICE, "the device claimed by openvswitch"); goto out; diff --git a/src/core/nm-manager.c b/src/core/nm-manager.c index a152344c52..b3ea9fea40 100644 --- a/src/core/nm-manager.c +++ b/src/core/nm-manager.c @@ -2792,7 +2792,7 @@ get_existing_connection(NMManager *self, NMDevice *device, gboolean *out_generat int master_ifindex = nm_platform_link_get_master(priv->platform, ifindex); /* Check that the master is activating before assuming a - * slave connection. However, ignore ovs-system master as + * slave connection. However, ignore ovs-system/ovs-netdev master as * we never manage it. */ if (master_ifindex |