diff --git a/network.go b/network.go index 602aff0..c892117 100644 --- a/network.go +++ b/network.go @@ -48,8 +48,8 @@ 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 { - // Does not support multicast. + if iface.Flags&net.FlagMulticast == 0 || iface.Flags&net.FlagLoopback != 0 { + // Does not support multicast or is a loopback address. continue } ifaceAddrs, err := iface.Addrs() @@ -67,11 +67,6 @@ func localIPv4MCastAddrs() ([]string, error) { // Not IPv4. continue } - // Fix #33: consider NOT loopback IP addresses - if addr.IP.IsLoopback() { - // do not use local address - continue - } addrs = append(addrs, addr.IP.String()) } }