diff --git a/Makefile b/Makefile index 2d215dc..eb37053 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ NAME=gost BINDIR=bin VERSION=$(shell cat gost.go | grep 'Version =' | sed 's/.*\"\(.*\)\".*/\1/g') GOBUILD=CGO_ENABLED=0 go build --ldflags="-s -w" -v -x -a -GOFILES=cmd/gost/* +GOFILES=cmd/gost/*.go PLATFORM_LIST = \ darwin-amd64 \ diff --git a/chain.go b/chain.go index 9a973ff..966a53f 100644 --- a/chain.go +++ b/chain.go @@ -133,10 +133,6 @@ func (c *Chain) DialContext(ctx context.Context, network, address string, opts . return } -func setSocketMark(fd int, value int) (e error) { - return syscall.SetsockoptInt(fd, syscall.SOL_SOCKET, syscall.SO_MARK, value) -} - func (c *Chain) dialWithOptions(ctx context.Context, network, address string, options *ChainOptions) (net.Conn, error) { if options == nil { options = &ChainOptions{} diff --git a/sockopts_linux.go b/sockopts_linux.go new file mode 100644 index 0000000..f35423e --- /dev/null +++ b/sockopts_linux.go @@ -0,0 +1,7 @@ +package gost + +import "syscall" + +func setSocketMark(fd int, value int) (e error) { + return syscall.SetsockoptInt(fd, syscall.SOL_SOCKET, syscall.SO_MARK, value) +} diff --git a/sockopts_other.go b/sockopts_other.go new file mode 100644 index 0000000..c0dd1b8 --- /dev/null +++ b/sockopts_other.go @@ -0,0 +1,7 @@ +//go:build !linux + +package gost + +func setSocketMark(fd int, value int) (e error) { + return nil +}