Age | Commit message (Collapse) | Author |
|
Signed-off-by: Antonio Huete Jimenez <tuxillo@quantumachine.net>
|
|
Signed-off-by: KonnovKM <boneyandoom@gmail.com>
|
|
Signed-off-by: KonnovKM <boneyandoom@gmail.com>
|
|
Signed-off-by: KonnovKM <boneyandoom@gmail.com>
|
|
Signed-off-by: KonnovKM <boneyandoom@gmail.com>
|
|
Signed-off-by: Brian Kemper <bkemper@gmail.com>
|
|
Signed-off-by: Brian Kemper <bkemper@gmail.com>
|
|
|
|
Signed-off-by: Dennis Marttinen <twelho@welho.tech>
|
|
Signed-off-by: Dennis Marttinen <twelho@welho.tech>
|
|
Signed-off-by: Dennis Marttinen <twelho@welho.tech>
|
|
Signed-off-by: Dennis Marttinen <twelho@welho.tech>
|
|
mdlayher/raw supports them, so why don't we support them, too.
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
This should fix the panic we've seen with the malformed packets on the
wire. Remaining buffer size should be checked before trying to access
the data, otherwise Go might panic on out of bounds slice operation.
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
|
|
u-root -> dhcp -> u-root is the circular dependency. Which is fine,
except we messed up modules in u-root big time. We need to break the
circular dep for now.
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
Ensure server identifier matches the offer server identifier when
looking for ACKs or NAKs.
This protects against rogue DHCP servers NAKing requests the shouldn't.
Signed-off-by: Moritz Fischer <moritzf@google.com>
Co-authored-by: Moritz Fischer <moritzf@google.com>
|
|
Signed-off-by: yaocw2020 <yaocanwu@gmail.com>
|
|
For any users to write their own Discover or Request methods, they need
access to the ifaceHWAddr and serverAddr.
Discovered while trying to move pinterest/bender to nclients.
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
- add NewReleaseFromLease and update Client.Release() accordingly
- update lease_test.go accordingly
- remove example_lease_test.go
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
- fix a data race in lease_test.go
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
- update lease_test.go make sure server side error is caught
- some minor fixes based on PR discussion
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
- change Client.Request so it now only return Lease
- change test case and example accordingly
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
testing
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
- update example_lease_test.go accordingly
- add lease_test.go, which contain some test cases for lease&release, using socketpair
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
- fix a few more lint complains
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
This option allows to receive answers DHCP with arbitrary client addresses
Signed-off-by: Dmitrii Okunev <xaionaro@fb.com>
|
|
Signed-off-by: Dmitrii Okunev <xaionaro@fb.com>
|
|
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
RFC 1700 recommends a value of 64 for the default IP time to live (TTL)
parameter. This is only necessary for the V4 client because it uses
the net.PacketConn, while the IPv6 implementation uses a net.UDPConn instead.
From https://tools.ietf.org/html/rfc1700:
IP TIME TO LIVE PARAMETER
The current recommended default time to live (TTL) for the
Internet Protocol (IP) [45,105] is 64.
Signed-off-by: Ross Hanson <rosshanson@google.com>
|
|
Added a bind to interface functionality.
|
|
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>
|
|
No need to convert these types.
|
|
Simple, nit-picky typo fixes.
|
|
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
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>
|
|
Now the CI will also run golangci-lint
Signed-off-by: Andrea Barberio <insomniac@slackware.it>
|
|
Why did I ever think this would work??
Signed-off-by: Christopher Koch <chrisko@google.com>
|
|
Signed-off-by: Christopher Koch <chrisko@google.com>
|
|
- 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>
|