sing/common/control/bind_linux.go
2022-09-14 12:52:34 +08:00

13 lines
291 B
Go

package control
import (
"syscall"
"golang.org/x/sys/unix"
)
func bindToInterface(conn syscall.RawConn, network string, address string, interfaceName string, interfaceIndex int) error {
return Raw(conn, func(fd uintptr) error {
return unix.BindToDevice(int(fd), interfaceName)
})
}