undefined: syscall.SYS_GETSOCKOPT
isomorphisms opened this issue · comments
$ go get -u github.com/timpalpant/go-iex/pcap2json
go install github.com/timpalpant/go-iex/pcap2json
pcap# github.com/mdlayher/raw
../../go/src/github.com/mdlayher/raw/raw_linux.go:316:32: undefined: syscall.SYS_GETSOCKOPT
../../go/src/github.com/mdlayher/raw/raw_linux.go:329:32: undefined: syscall.SYS_SETSOCKOPT
../../go/src/github.com/mdlayher/raw/timeval.go:17:6: cannot use int64(timeout / time.Second) (type int64) as type int32 in field value
../../go/src/github.com/mdlayher/raw/timeval.go:18:7: cannot use int64(timeout % time.Second / time.Microsecond) (type int64) as type int32 in field value
$ go install github.com/timpalpant/go-iex/pcap2json
github.com/mdlayher/raw
../../go/src/github.com/mdlayher/raw/raw_linux.go:316:32: undefined: syscall.SYS_GETSOCKOPT
../../go/src/github.com/mdlayher/raw/raw_linux.go:329:32: undefined: syscall.SYS_SETSOCKOPT
../../go/src/github.com/mdlayher/raw/timeval.go:17:6: cannot use int64(timeout / time.Second) (type int64) as type int32 in field value
../../go/src/github.com/mdlayher/raw/timeval.go:18:7: cannot use int64(timeout % time.Second / time.Microsecond) (type int64) as type int32 in field value
It seems that github.com/google/gopacket
has introduced features that only compile on Linux (google/gopacket#514).
I've checked in a vendored copy of compatible dependency versions (for me, on mac). Give it a shot. If it still does not build, please include the output of go version
.
FYI, this issue was also present on i386 Linux (32bit) but fixed by the commits merged today into mdlayher/raw at mdlayher/raw#32 .. if this still doesn't compile on macOS maybe open an issue there?
This appears fixed in google/gopacket#521. I am bumping the version referenced in go.mod
here.