From 49508fba0031b89ca8aeaed8c9f7308393c58a5c Mon Sep 17 00:00:00 2001 From: Jochen Hiller Date: Sun, 31 May 2020 13:15:43 +0200 Subject: [PATCH] Changed due to review comments --- network.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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()) } }