veth: fix updating peer when link changed

When creating the first device in a veth pair, the peer ifindex is
valid, but the peer device does not exist yet. This should be set
when update_properties() is called for the second device, but fix
the conditional.
This commit is contained in:
David Ward 2026-03-20 08:34:41 -04:00 committed by Íñigo Huguet
parent 631127d2e5
commit 372fb5792c

View file

@ -53,7 +53,7 @@ update_properties(NMDevice *device)
nm_device_parent_set_ifindex(device, peer_ifindex);
peer = nm_device_parent_get_device(device);
if (peer && NM_IS_DEVICE_VETH(peer) && nm_device_parent_get_ifindex(peer) <= 0)
if (peer && NM_IS_DEVICE_VETH(peer) && !nm_device_parent_get_device(peer))
update_properties(peer);
}