summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/server4/server.go
AgeCommit message (Collapse)Author
2019-10-15server4: Respect listen addressAnatole Denis
NewIPv4UDPConn doesn't support listening on a specific address, only on the wildcard address. This extends it to allow listening on an address, and at the same time homogenizes the function signature with the NewIPv6UDPConn server6 equivalent. It modifies NewServer() to pass the full address given to it instead of just the port as well Note that listening on a non-wildcard interface is seldom useful as the socket won't receive broadcasts, so it is useless in a direct-attached server. It can be useful in a server only used behind relays This breaks API compatibility for NewIPv4UDPConn, which as far as I know nobody uses (yet) Signed-off-by: Anatole Denis <natolumin@unverle.fr>
2019-08-14Bind interface fix (#310)borna-blazevic
Added a bind to interface functionality.
2019-07-29server4: set peer to broadcast if client IP is zeroChris Koch
Clients without an IP set their source address to 0.0.0.0, so the peer returned by ReadFrom may not actually be the address to send to. Clients without an IP should have their response broadcast. Signed-off-by: Chris Koch <chrisko@google.com>
2019-04-17[server] Serve returns an error, and closes when doneAndrea Barberio
Server6 and Server4 had Serve methods that return without reporting an error, changed in this PR. Serve now also closes the connection when done. Signed-off-by: Andrea Barberio <insomniac@slackware.it>
2019-03-27client4: add a new DHCPv4 client.Christopher Koch
- Able to send UDP packets before interface is configured. - Able to use any net.PacketConn. - RFC2131-compliant retransmission logic. - Tests. - Race-condition-averse. Previous clients (both mine and the ones here) are prone to race condition errors. Having one and only one place that calls receive on the socket "continuously" without having to coordinate hand-offs makes the logic way easier to follow, and allows for multiple requests in flux at a time. Signed-off-by: Christopher Koch <chrisko@google.com>
2019-01-28dhcpv4: moved client into dhcpv4/client4Andrea Barberio