1
// Copyright 2012 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
5
// +build darwin freebsd linux netbsd openbsd windows
15
func setSyscallIPMreq(mreq *syscall.IPMreq, ifi *net.Interface) error {
19
ifat, err := ifi.Addrs()
23
for _, ifa := range ifat {
24
switch v := ifa.(type) {
26
if a := v.IP.To4(); a != nil {
27
copy(mreq.Interface[:], a)
31
if a := v.IP.To4(); a != nil {
32
copy(mreq.Interface[:], a)
38
if bytes.Equal(mreq.Multiaddr[:], net.IPv4zero.To4()) {
39
return errNoSuchMulticastInterface