ethernet: fix complete_connection rejecting veth with correct peer

complete_connection() unconditionally rejects veth connections that
already have a peer name set, even when the peer name matches the
device's actual peer. Only reject when the names differ.

Fixes: 7c05ff1632 ('device: fix complete-connection for veth devices')
This commit is contained in:
Beniamino Galvani 2026-05-30 22:03:23 +02:00
parent f5127d7b14
commit fd037132e7

View file

@ -1684,11 +1684,13 @@ complete_connection(NMDevice *device,
con_peer_name = nm_setting_veth_get_peer(s_veth);
if (con_peer_name) {
nm_utils_error_set(error,
NM_UTILS_ERROR_UNKNOWN,
"mismatching veth peer \"%s\"",
con_peer_name);
return FALSE;
if (!nm_streq(con_peer_name, peer_name)) {
nm_utils_error_set(error,
NM_UTILS_ERROR_UNKNOWN,
"mismatching veth peer \"%s\"",
con_peer_name);
return FALSE;
}
} else
g_object_set(s_veth, NM_SETTING_VETH_PEER, peer_name, NULL);