Files
tun2socks/dialer/sockopt_openbsd.go

19 lines
420 B
Go

package dialer
import (
"net"
"syscall"
"golang.org/x/sys/unix"
)
func WithBindToInterface(_ *net.Interface) SocketOption { return UnsupportedSocketOption }
func WithRoutingMark(mark int) SocketOption {
return SocketOptionFunc(func(_, _ string, c syscall.RawConn) error {
return rawConnControl(c, func(fd uintptr) error {
return unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_RTABLE, mark)
})
})
}