From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id C08BF1FF14C for ; Fri, 15 May 2026 13:07:00 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E57CC8CB8; Fri, 15 May 2026 13:06:57 +0200 (CEST) From: Hannes Laimer To: pve-devel@lists.proxmox.com Subject: [PATCH pve-network v2 3/4] sdn: stabilize peer IP ordering when generating sdn config Date: Fri, 15 May 2026 13:06:47 +0200 Message-ID: <20260515110648.217493-4-h.laimer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260515110648.217493-1-h.laimer@proxmox.com> References: <20260515110648.217493-1-h.laimer@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778843207082 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.918 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_MAILER 2 Automated Mailer Tag Left in Email SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: CDYIKS5AWFRQS64GI5CDNUTJWFNMZK3Z X-Message-ID-Hash: CDYIKS5AWFRQS64GI5CDNUTJWFNMZK3Z X-MailFrom: h.laimer@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Sort peer iteration so the generated config is stable across runs. Without this, hash iteration order leaks into the output and multi-peer tests fail randomly. Signed-off-by: Hannes Laimer --- src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 4 ++-- src/PVE/Network/SDN/Zones/EvpnPlugin.pm | 4 ++-- src/PVE/Network/SDN/Zones/VxlanPlugin.pm | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm index 6568459..f23cb8b 100644 --- a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm +++ b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm @@ -380,8 +380,8 @@ sub generate_zone_frr_config { return; } - for my $node (values %$nodes) { - push @peers, $node->{$addr_key}; + for my $node_id (sort keys %$nodes) { + push @peers, $nodes->{$node_id}->{$addr_key}; } $loopback = "dummy_$fabric->{id}"; diff --git a/src/PVE/Network/SDN/Zones/EvpnPlugin.pm b/src/PVE/Network/SDN/Zones/EvpnPlugin.pm index 0be304a..9b06d66 100644 --- a/src/PVE/Network/SDN/Zones/EvpnPlugin.pm +++ b/src/PVE/Network/SDN/Zones/EvpnPlugin.pm @@ -196,8 +196,8 @@ sub generate_sdn_config { "Node $local_node requires a $addr_key address in the fabric $fabric->{id} to configure the EVPN zone" if !$current_node->{$addr_key}; - for my $node (values %$nodes) { - push @peers, $node->{$addr_key}; + for my $node_id (sort keys %$nodes) { + push @peers, $nodes->{$node_id}->{$addr_key}; } $loopback = "dummy_$fabric->{id}"; diff --git a/src/PVE/Network/SDN/Zones/VxlanPlugin.pm b/src/PVE/Network/SDN/Zones/VxlanPlugin.pm index 1db610f..a408261 100644 --- a/src/PVE/Network/SDN/Zones/VxlanPlugin.pm +++ b/src/PVE/Network/SDN/Zones/VxlanPlugin.pm @@ -127,7 +127,7 @@ sub generate_sdn_config { my @iface_config = (); push @iface_config, "vxlan-id $tag"; - for my $address (@peers) { + for my $address (sort @peers) { next if $address eq $ifaceip; push @iface_config, "vxlan_remoteip $address"; } -- 2.47.3