From 07e0ab48d194b8bd6663a34887c2e753720ae4d3 Mon Sep 17 00:00:00 2001 From: Fernando Fernandez Mancera Date: Tue, 27 Sep 2022 12:26:14 +0200 Subject: [PATCH] veth: drop iface peer check during create_and_realize() When fetching the parent device, if the system is slow, NetworkManager can hit a race condition where the property is still NULL. In that case, NetworkManager should create the veth link. Checking that the peer device exists, it is type NM_DEVICE_TYPE_VETH and it have a parent device is enough to know that we can skip the link creation. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1399 https://bugzilla.redhat.com/show_bug.cgi?id=2129829 Fixes: 4655b7c30846 ('veth: fix veth activation on booting') --- src/core/devices/nm-device-veth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/devices/nm-device-veth.c b/src/core/devices/nm-device-veth.c index 63dfd8bbc4..c3482e7885 100644 --- a/src/core/devices/nm-device-veth.c +++ b/src/core/devices/nm-device-veth.c @@ -101,8 +101,8 @@ create_and_realize(NMDevice *device, peer = nm_setting_veth_get_peer(s_veth); peer_device = nm_manager_get_device(NM_MANAGER_GET, peer, NM_DEVICE_TYPE_VETH); if (peer_device) { - /* The veth device and its peer already exist. No need to create it again. */ - if (nm_streq0(nm_device_get_iface(nm_device_parent_get_device(peer_device)), iface)) + if (nm_device_parent_get_device(peer_device)) + /* The veth device and its peer already exist. No need to create it again. */ return TRUE; }