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 <[email protected]> --- 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 _______________________________________________ pve-devel mailing list [email protected] https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
