public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Hannes Laimer <h.laimer@proxmox.com>
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	[thread overview]
Message-ID: <20260515110648.217493-4-h.laimer@proxmox.com> (raw)
In-Reply-To: <20260515110648.217493-1-h.laimer@proxmox.com>

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 <h.laimer@proxmox.com>
---
 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





  parent reply	other threads:[~2026-05-15 11:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-15 11:06 [PATCH network v2 0/4] sdn: evpn: IPv6 underlay support Hannes Laimer
2026-05-15 11:06 ` [PATCH pve-network v2 1/4] sdn: evpn: prepare " Hannes Laimer
2026-05-15 11:06 ` [PATCH pve-network v2 2/4] sdn: evpn: keep router-id valid on IPv6 underlay Hannes Laimer
2026-05-15 11:06 ` Hannes Laimer [this message]
2026-05-15 11:06 ` [PATCH pve-network v2 4/4] sdn: evpn: add tests covering ipv6 underlays Hannes Laimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260515110648.217493-4-h.laimer@proxmox.com \
    --to=h.laimer@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal