diff --git a/util/addr.go b/util/addr.go index b6ec49e1..44354dab 100644 --- a/util/addr.go +++ b/util/addr.go @@ -27,6 +27,8 @@ func AddrIP(addr net.Addr) net.IP { switch raw := addr.(type) { case *net.UDPAddr: return raw.IP + case *net.TCPAddr: + return raw.IP default: host, _, err := net.SplitHostPort(addr.String()) if err != nil {