summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2022-08-31 10:36:24 +0200
committerLubomir Rintel <lkundrak@v3.sk>2022-09-07 14:08:22 +0200
commit269c39b3662a8370f6a0bf0587b4870bf9cf92b0 (patch)
treefd93b20a9b3a0a795e2720e261cda676478873e5
parent12e5b944f6a2a7c94a3f046eedba78ee56beb4d5 (diff)
device: don't ignore external slave removalsslave-removal
We've been outright ignoring master-slave checks if the link ended up without a master since commit 2e22880894cf ('device: don't remove the device from master if its link has no master'). This was done to deal with OpenVSwitch port-interface relationship, where the interface's platform link lacked an actual master in platform (what matters there is the OVSDB entry), but the fix was too wide. Let's be more diligent about limiting the special case to OpenVSwitch interfaces. Morale: Write better commit messages of future you is going to be upset Fixes: 2e22880894cf ('device: don't remove the device from master if its link has no master')
-rw-r--r--src/core/devices/nm-device.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c
index 6be8b06a6a..9f4c5bb7e8 100644
--- a/src/core/devices/nm-device.c
+++ b/src/core/devices/nm-device.c
@@ -6536,12 +6536,16 @@ device_recheck_slave_status(NMDevice *self, const NMPlatformLink *plink)
g_return_if_fail(plink);
- if (plink->master <= 0)
- goto out;
-
- master = nm_manager_get_device_by_ifindex(NM_MANAGER_GET, plink->master);
- 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 (plink->master > 0) {
+ master = nm_manager_get_device_by_ifindex(NM_MANAGER_GET, plink->master);
+ 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));
+ } else {
+ if (priv->master_ifindex == 0)
+ goto out;
+ master = NULL;
+ plink_master = NULL;
+ }
if (master == NULL && plink_master
&& NM_IN_STRSET(plink_master->name, "ovs-system", "ovs-netdev")