chore: ignore interfaces not with FlagUp in local interface finding

This commit is contained in:
wwqgtxx 2025-04-27 09:39:46 +08:00
parent efc7abc6e0
commit d55b047125

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)
}