localIPv4MCastAddrs if(net.FlagUp == 0 )continue

This commit is contained in:
fanhai 2021-03-10 15:20:16 +08:00 committed by Huin
parent e7fc2c5b62
commit 0ca763054c

View File

@ -48,7 +48,7 @@ func localIPv4MCastAddrs() ([]string, error) {
// Find the set of addresses to listen on.
var addrs []string
for _, iface := range ifaces {
if iface.Flags&net.FlagMulticast == 0 || iface.Flags&net.FlagLoopback != 0 {
if iface.Flags&net.FlagMulticast == 0 || iface.Flags&net.FlagLoopback != 0 || iface.Flags&net.FlagUp == 0 {
// Does not support multicast or is a loopback address.
continue
}