dhcp4 icon indicating copy to clipboard operation
dhcp4 copied to clipboard

I suggest to migrate from deprecated syscall package to golang.org/x/sys/unix package

Open harobed opened this issue 7 years ago • 3 comments

I think that syscall Golang package is deprecated:

NOTE: This package is locked down. Code outside the standard Go repository should be migrated to use the corresponding package in the golang.org/x/sys repository. That is also where updates required by new systems or versions should be applied. Signal, Errno and SysProcAttr are not yet available in golang.org/x/sys and must still be referenced from the syscall package. See https://golang.org/s/go1.4-syscall for more information.

I think dhcp4 lib need to migrate to https://godoc.org/golang.org/x/sys/unix

harobed avatar Jun 17 '18 09:06 harobed

Agreed in principal. However the current syscall package meets the current needs. I think the best way forward is to leave the bound_linux.go as is and create a new Conn with the new syscall package, that way it can be tested to death before rolling it out.

krolaw avatar Jul 25 '18 20:07 krolaw

I think this may be biting us for an MacOS X build:

../../go/src/github.com/google/gopacket/pcapgo/capture.go:46:46: ETH_P_ALL not declared by package syscall

wbrown-lg avatar Sep 17 '18 18:09 wbrown-lg

I think this may be biting us for an MacOS X build:

../../go/src/github.com/google/gopacket/pcapgo/capture.go:46:46: ETH_P_ALL not declared by package syscall

Dhcp4 doesn't import syscall on darwin targets. I presume you are using gopacket with dhcp4, which is introducing the syscall import. As such, you may want to contact gopacket. Alas, moving gopacket to https://godoc.org/golang.org/x/sys/unix may not help as ETH_P_ALL is listed in https://github.com/golang/sys/blob/master/unix/zerrors_linux_amd64.go, which only gets imported on linux (not darwin) - so you'll probably get the same error anyway.

krolaw avatar Sep 23 '18 10:09 krolaw