From 19e23ba4bee6cb48d7077733f61b9ca548e60f20 Mon Sep 17 00:00:00 2001
From: caleb <yocalebo@gmail.com>
Date: Mon, 29 Jul 2024 15:11:01 -0400
Subject: [PATCH] properly exclude internal ifaces in get_nic_names

---
 src/middlewared/middlewared/plugins/network.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/middlewared/middlewared/plugins/network.py b/src/middlewared/middlewared/plugins/network.py
index 5bac389fdb42..4486b160b427 100644
--- a/src/middlewared/middlewared/plugins/network.py
+++ b/src/middlewared/middlewared/plugins/network.py
@@ -1922,9 +1922,9 @@ def ip_in_use(self, choices):
     @private
     def get_nic_names(self) -> set:
         """Get network interface names excluding internal interfaces"""
-        res, ignore = set(), set(self.middleware.call_sync('interface.internal_interfaces'))
+        res, ignore = set(), tuple(self.middleware.call_sync('interface.internal_interfaces'))
         with scandir('/sys/class/net/') as nics:
-            for nic in filter(lambda x: x.is_symlink() and x.name not in ignore, nics):
+            for nic in filter(lambda x: x.is_symlink() and not x.name.startswith(ignore), nics):
                 res.add(nic.name)
 
         return res