1 // Copyright 2011 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.
13 func setIPv4MulticastInterface(fd
*netFD
, ifi
*Interface
) error
{
14 ip
, err
:= interfaceToIPv4Addr(ifi
)
16 return os
.NewSyscallError("setsockopt", err
)
20 if err
:= fd
.incref(); err
!= nil {
24 return os
.NewSyscallError("setsockopt", syscall
.Setsockopt(fd
.sysfd
, syscall
.IPPROTO_IP
, syscall
.IP_MULTICAST_IF
, (*byte)(unsafe
.Pointer(&a
[0])), 4))
27 func setIPv4MulticastLoopback(fd
*netFD
, v
bool) error
{
28 if err
:= fd
.incref(); err
!= nil {
32 return os
.NewSyscallError("setsockopt", syscall
.SetsockoptInt(fd
.sysfd
, syscall
.IPPROTO_IP
, syscall
.IP_MULTICAST_LOOP
, boolint(v
)))