if !supportsIPv6() {
t.Skip("IPv6 is not supported")
}
- if os.Getuid() != 0 {
+ // On Windows, the test can be run by non-admin users.
+ if runtime.GOOS != "windows" && os.Getuid() != 0 {
t.Skip("must be root")
}
func multicastRIBContains(ip IP) (bool, error) {
switch runtime.GOOS {
- case "aix", "dragonfly", "netbsd", "openbsd", "plan9", "solaris", "illumos", "windows":
+ case "aix", "dragonfly", "netbsd", "openbsd", "plan9", "solaris", "illumos":
return true, nil // not implemented yet
case "linux":
if runtime.GOARCH == "arm" || runtime.GOARCH == "alpha" {
func SetsockoptIPMreq(fd Handle, level, opt int, mreq *IPMreq) (err error) {
return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(mreq)), int32(unsafe.Sizeof(*mreq)))
}
-func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (err error) { return EWINDOWS }
+func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (err error) {
+ return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(mreq)), int32(unsafe.Sizeof(*mreq)))
+}
func Getpid() (pid int) { return int(getCurrentProcessId()) }