We generate a list of existing pins as a reference throughout the
pinning tool. It works by reading the existing link files and looking
up interfaces with the corresponding MAC address. If pins have already
been applied, this would return a mapping of the pinned name to itself
(nic0 => nic0).

We use this list for filtering what we write to the pending
configuration, in order to avoid re-introducing already pinned names
to the pending configuration. This reflexive entry would cause the
interfaces file generation to filter all pinned network interfaces
after reboot, leading to invalid ifupdown2 configuration files. Fix
this by filtering entries in the existing-pins list who are reflexive.

Signed-off-by: Stefan Hanreich <s.hanre...@proxmox.com>
Link: https://lore.proxmox.com/20250717152841.397830-7-s.hanre...@proxmox.com
---
 PVE/CLI/proxmox_network_interface_pinning.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/PVE/CLI/proxmox_network_interface_pinning.pm 
b/PVE/CLI/proxmox_network_interface_pinning.pm
index b45cc973a..9dbf91e73 100644
--- a/PVE/CLI/proxmox_network_interface_pinning.pm
+++ b/PVE/CLI/proxmox_network_interface_pinning.pm
@@ -311,7 +311,8 @@ sub resolve_pinned {
             next;
         }
 
-        $resolved->{ $mac_lookup{$mac} } = $pinned->{$mac};
+        $resolved->{ $mac_lookup{$mac} } = $pinned->{$mac}
+            if $mac_lookup{$mac} ne $pinned->{$mac};
     }
 
     return $resolved;
-- 
2.39.5


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to