sing/common/control/mark_linux.go
2022-07-17 14:39:25 +08:00

13 lines
284 B
Go

package control
import (
"syscall"
)
func RoutingMark(mark int) Func {
return func(network, address string, conn syscall.RawConn) error {
return Control(conn, func(fd uintptr) error {
return syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, syscall.SO_MARK, mark)
})
}
}