net: ListenMulticastUDP to listen concurrently across multiple listeners

This CL introduces new function ListenMulticastUDP to fix
multicast UDP listening across multiple listeners issue,
to replace old multicast methods JoinGroup and LeaveGroup
on UDPConn.

This CL also enables multicast testing by default.

Fixes #2730.

R=rsc, paul.a.lalonde, fullung, devon.odell
CC=golang-dev
https://golang.org/cl/5562048
diff --git a/src/pkg/net/sock_bsd.go b/src/pkg/net/sock_bsd.go
index 630a91ed..7c693a2 100644
--- a/src/pkg/net/sock_bsd.go
+++ b/src/pkg/net/sock_bsd.go
@@ -31,3 +31,27 @@
 	}
 	return int(n)
 }
+
+func listenerSockaddr(s, f int, la syscall.Sockaddr, toAddr func(syscall.Sockaddr) Addr) (syscall.Sockaddr, error) {
+	a := toAddr(la)
+	if a == nil {
+		return la, nil
+	}
+	switch v := a.(type) {
+	case *UDPAddr:
+		if v.IP.IsMulticast() {
+			err := setDefaultMulticastSockopts(s)
+			if err != nil {
+				return nil, err
+			}
+			switch f {
+			case syscall.AF_INET:
+				v.IP = IPv4zero
+			case syscall.AF_INET6:
+				v.IP = IPv6unspecified
+			}
+			return v.sockaddr(f)
+		}
+	}
+	return la, nil
+}