initial commit
This commit is contained in:
14
common/net/dialer/dialer_linux.go
Normal file
14
common/net/dialer/dialer_linux.go
Normal file
@ -0,0 +1,14 @@
|
||||
package dialer
|
||||
|
||||
import (
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func bindDevice(fd uintptr, ifceName string) error {
|
||||
// unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_REUSEADDR, 1)
|
||||
// unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_REUSEPORT, 1)
|
||||
if ifceName == "" {
|
||||
return nil
|
||||
}
|
||||
return unix.BindToDevice(int(fd), ifceName)
|
||||
}
|
Reference in New Issue
Block a user