summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/nclient4
diff options
context:
space:
mode:
authorChris Koch <chrisko@google.com>2019-07-28 22:43:07 -0700
committerinsomniac <insomniacslk@users.noreply.github.com>2019-07-29 08:34:01 +0100
commit6d0d21cc633742eb4de9b08ad7a53572a6907623 (patch)
tree72cdadae64b0e6af751446b0361e9cb9f223ac15 /dhcpv4/nclient4
parentf672bc204f35cdafd26aeefa5faf44ab4de7c4dc (diff)
server4: set peer to broadcast if client IP is zero
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>
Diffstat (limited to 'dhcpv4/nclient4')
-rw-r--r--dhcpv4/nclient4/client_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/dhcpv4/nclient4/client_test.go b/dhcpv4/nclient4/client_test.go
index 274c94b..c299697 100644
--- a/dhcpv4/nclient4/client_test.go
+++ b/dhcpv4/nclient4/client_test.go
@@ -50,7 +50,7 @@ func serveAndClient(ctx context.Context, responses [][]*dhcpv4.DHCPv4, opts ...C
panic(err)
}
- clientConn := NewBroadcastUDPConn(clientRawConn, &net.UDPAddr{IP: net.IPv4zero, Port: ClientPort})
+ clientConn := NewBroadcastUDPConn(clientRawConn, &net.UDPAddr{Port: ClientPort})
serverConn := NewBroadcastUDPConn(serverRawConn, &net.UDPAddr{Port: ServerPort})
o := []ClientOpt{WithRetry(1), WithTimeout(2 * time.Second)}