chore: ignore interfaces not with FlagUp in local interface finding

This commit is contained in:
wwqgtxx committed 2025-04-27 09:40:17 +08:00
1 parent efc7abc6e0
commit d55b047125
1 file changed
+3
+3
View File
@@ -80,6 +80,9 @@ func getCache() (*ifaceCache, error) {
}
cache.ifMap[iface.Name] = ifaceObj
if iface.Flags&net.FlagUp == 0 {
continue // interface down
}
for _, prefix := range ipNets {
cache.ifTable.Insert(prefix, ifaceObj)
}