[pve-devel] [PATCH pve-manager 1/4] network-interface-pinning: use ifindex as order for pinning
Stefan Hanreich
s.hanreich at proxmox.com
Thu Jul 24 11:32:21 CEST 2025
While ifindex is not guaranteed to be stable across reboots, it seems
like a good enough heuristic for making sure interfaces with multiple
ports are clamped together when pinning.
Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
PVE/CLI/proxmox_network_interface_pinning.pm | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/PVE/CLI/proxmox_network_interface_pinning.pm b/PVE/CLI/proxmox_network_interface_pinning.pm
index 3f1a83f10..05b1de38a 100644
--- a/PVE/CLI/proxmox_network_interface_pinning.pm
+++ b/PVE/CLI/proxmox_network_interface_pinning.pm
@@ -257,7 +257,11 @@ package PVE::CLI::proxmox_network_interface_pinning::InterfaceMapping {
my %existing_names = map { $_ => 1 } values $pinned->%*;
- for my $ifname (sort keys $ip_links->%*) {
+ my @sorted_links = sort {
+ $ip_links->{$a}->{ifindex} <=> $ip_links->{$b}->{ifindex};
+ } keys $ip_links->%*;
+
+ for my $ifname (@sorted_links) {
my $ip_link = $ip_links->{$ifname};
my $generated_name;
--
2.39.5
More information about the pve-devel
mailing list