Age | Commit message (Collapse) | Author |
|
|
|
Any parameter passed to `require.NotNil()` after the first two will not be
tested but instead appended to the message that is printed if the test fails.
This means that `lease.ACK` was never tested to not be nil.
Signed-off-by: Dennis Marttinen <twelho@welho.tech>
|
|
Signed-off-by: Dennis Marttinen <twelho@welho.tech>
|
|
|
|
Add `SO_REUSEPORT` to aid in debugging and testing.
Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
|
|
Signed-off-by: Dennis Marttinen <twelho@welho.tech>
|
|
|
|
Signed-off-by: Chris Koch <chrisko@google.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>
|
|
which now returns a lease instead of ack
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
|
|
server6 object
Signed-off-by: Valerio Santinelli <santinelli@altralogica.it>
|
|
Fixes, among other things, u-root pxeserver
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
|
|
IPv6 addresses would not cause a crash, but would silently listen on the
wildcard address instead of the passed address, which is surprising at
best. Instead check for the address family and reject non-v4 addresses
Signed-off-by: Anatole Denis <natolumin@unverle.fr>
|
|
Tests use a randPort() workaround for not using port 0, as port 0 is not
usable with raw sockets.
We don't actually use raw sockets, so port 0 is fine, this makes use of
it which ensures we avoid port collisions.
Signed-off-by: Anatole Denis <natolumin@unverle.fr>
|
|
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>
|
|
The concrete type under the interface is known here since we create the
connection in the same function. Since *net.UDPConn implements
net.PacketConn anyway, returning the concrete type here is more powerful
and less risky than having downstream users cast the value themselves
There should be no code change for downstream users, with the exception
of explicit casts (`udpc := conn.(*net.UDPConn)`), which can simply be
removed
Signed-off-by: Anatole Denis <natolumin@unverle.fr>
|
|
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>
|
|
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>
|
|
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>
|
|
|
|
- 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>
|
|
|