[pve-devel] [PATCH pve-manager 1/2] network-interface-pinning: fix subsequent invocations

Stefan Hanreich s.hanreich at proxmox.com
Fri Jul 18 18:26:09 CEST 2025


The fix introduced in 5b5db0e67 fixed the scenario where pins were
already applied, but broke the case where they weren't yet applied,
since now not-yet-applied pins would get overwritten again on
subsequent invocations of the pinning tool.

Move the check for the same name to the update_etc_network_interfaces
call, where it is actually required - instead of filtering already in
the resolve_pinned function, which is also used in the generate body
to filter eligible links for pinning.

Fixes: 5b5db0e67
Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
 PVE/CLI/proxmox_network_interface_pinning.pm | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/PVE/CLI/proxmox_network_interface_pinning.pm b/PVE/CLI/proxmox_network_interface_pinning.pm
index 17b507911..8b7127488 100644
--- a/PVE/CLI/proxmox_network_interface_pinning.pm
+++ b/PVE/CLI/proxmox_network_interface_pinning.pm
@@ -79,7 +79,7 @@ my sub update_etc_network_interfaces {
         for my $iface_name (keys $old_ifaces->%*) {
             my $iface = $old_ifaces->{$iface_name};
 
-            if ($existing_pins->{$iface_name}) {
+            if ($existing_pins->{$iface_name} && $existing_pins->{$iface_name} ne $iface_name) {
                 # reading the interfaces file adds active interfaces to the
                 # configuration - we do not want to include already pinned
                 # interfaces in the new configuration when writing the new
@@ -328,8 +328,7 @@ sub resolve_pinned {
             next;
         }
 
-        $resolved->{ $mac_lookup{$mac} } = $pinned->{$mac}
-            if $mac_lookup{$mac} ne $pinned->{$mac};
+        $resolved->{ $mac_lookup{$mac} } = $pinned->{$mac};
     }
 
     return $resolved;
-- 
2.39.5




More information about the pve-devel mailing list