Although it looks like the sequencing of writing bs to the socket
and reusing the slice for the read test is guaranteed by there being
a receive from the socket in between, the race detector disagrees, and
found a race.
Some DHCP messages are broadcast to 255.255.255.255, and binding to a
specific address filters those packets out. Instead, we have to translate
the "listen on ip:port" intent to "listen on interface:port", and filter
based on the interface that received the packet.
Fixes#27.
pixiecore: Plumb NewSnooperConn into Server as an advanced option.
pixiecore/cli: Plumb DHCPNoBind to the CLI.
Now, by default, Pixiecore will bind() to the DHCP server port in a way
that shows up in `netstat` by default. If you want to enable the "coexist
with my existing DHCP server" mode, you need to explicitly pass
--dhcp-no-bind.
As it turns out, it's fairly difficult to do anything useful with DHCP
without this information, and the Conn implementations I can think of
all provide the information, so we might as well make it a requirement.
Conn is supposed to accept "" to mean "listen for DHCP on all interfaces",
but portableConn didn't correctly handle that.
And I got the comparison wrong on ifidx in the portable send function, so
packets got sent out entirely the wrong interface :(.