ignore Loopback Address (LVS,DR mode)

This commit is contained in:
huanghaoyan 2019-08-26 14:37:49 +08:00
parent abadb2211e
commit 35e7b9551f

View File

@ -46,6 +46,9 @@ func Extract(addr string) (string, error) {
// ignore error, interface can dissapear from system
continue
}
if iface.Flags&net.FlagLoopback != 0 {
continue
}
addrs = append(addrs, ifaceAddrs...)
}