mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-05 21:07:41 +03:00
13 lines
291 B
Go
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)
|
|
})
|
|
}
|