From fd037132e778e0187a0086b45945dbf6f632f9bd Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Sat, 30 May 2026 22:03:23 +0200 Subject: [PATCH] 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: 7c05ff16322c ('device: fix complete-connection for veth devices') --- src/core/devices/nm-device-ethernet.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/core/devices/nm-device-ethernet.c b/src/core/devices/nm-device-ethernet.c index 11f691ded9..b550b10ac4 100644 --- a/src/core/devices/nm-device-ethernet.c +++ b/src/core/devices/nm-device-ethernet.c @@ -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);