Update dependencies
This commit is contained in:
19
vendor/github.com/insomniacslk/dhcp/interfaces/bindtodevice_bsd.go
generated
vendored
Normal file
19
vendor/github.com/insomniacslk/dhcp/interfaces/bindtodevice_bsd.go
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// +build aix freebsd openbsd netbsd dragonfly
|
||||
|
||||
package interfaces
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// BindToInterface emulates linux's SO_BINDTODEVICE option for a socket by using
|
||||
// IP_RECVIF.
|
||||
func BindToInterface(fd int, ifname string) error {
|
||||
iface, err := net.InterfaceByName(ifname)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return unix.SetsockoptInt(fd, unix.IPPROTO_IP, unix.IP_RECVIF, iface.Index)
|
||||
}
|
||||
Reference in New Issue
Block a user