Closed eyakubovich closed 9 years ago
Thanks.
I'll review and get back to you.
For Reference: Extra info around the syscall package - https://golang.org/s/go1.4-syscall
I've pushed this to a separate branch (af_packet-sock) as I'm unable to see if it even build on Linux ( Windows Desktop :( ) I'll test later as some stage but I've changed the API so that you should find:
s, err := dhcp4client.NewPacketSock(10) ... c, err := dhcp4client.New(dhcp4client.HardwareAddr(m),dhcp4client.Connection(s)) ...
Works.
I like the changes. I didn't want to break the existing API but if that's ok, this cleans it up. I also realized that why I had a build tag on pktsock.go, there was nothing to disable ConnectPacket() function so it probably failed on non-Linux systems.
Let me know if you want me to version 1 this release and I'll start making sure I don't make any api changes within this version.
Using AF_PACKET is necessary to: (a) allow bcast traffic to go thru rp_filter enabled (b) ability to not use Broadcast flag and get packets unicasted back.