summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/nclient4
AgeCommit message (Collapse)Author
2019-06-19nclient4: add logging optionsChris Koch
Signed-off-by: Chris Koch <chrisko@google.com>
2019-05-22Ignore bytes after end of IP packet in BroadcastRawUDPConn.ReadFrom (#292)lprylli
When reading raw packets from the network, it can happen that the raw ethernet packet read has undefined bytes after the end of the ip packet (either from the network or in some cases from the local stack). Those bytes should not be passed to the dhcp-receiver otherwise the option parser which is picky about final padding byte will silently discard the dhcp-reply. Rename ipLen, udpLen variables with more explicit names to avoid confusion between header, payload, total length possibly considered in this function. Tested: ast2500 bmc reproducing the issue + existing go test for coverage. Signed-off-by: Loic Prylli <lprylli@netflix.com>
2019-05-08[CI] Added lintersAndrea Barberio
Now the CI will also run golangci-lint Signed-off-by: Andrea Barberio <insomniac@slackware.it>
2019-04-17nclient4: fix conn race conditionChristopher Koch
Why did I ever think this would work?? Signed-off-by: Christopher Koch <chrisko@google.com>
2019-04-07nclient4: simplify New interfaceChristopher Koch
Signed-off-by: Christopher Koch <chrisko@google.com>
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>