diff options
author | Chris Koch <chrisko@google.com> | 2019-06-27 10:09:34 -0700 |
---|---|---|
committer | insomniac <insomniacslk@users.noreply.github.com> | 2019-07-05 17:44:44 +0100 |
commit | 10d2fae058a94dddf9aa7259bf918691cf143ce4 (patch) | |
tree | 01b92bfb30be77d92a8af494106e48c179b5b5fa | |
parent | ec465b969b040b3b6a56e4a06c288782fae4b4d7 (diff) |
v4 discover: don't ask for broadcast
Usually this is used for clients that don't know how to receive any
other packets. We can deal with both a unicast or broadcast response
packet, so let's let the server decide on its own.
Signed-off-by: Chris Koch <chrisko@google.com>
-rw-r--r-- | dhcpv4/dhcpv4.go | 1 | ||||
-rw-r--r-- | dhcpv4/dhcpv4_test.go | 1 |
2 files changed, 0 insertions, 2 deletions
diff --git a/dhcpv4/dhcpv4.go b/dhcpv4/dhcpv4.go index d76a656..139c130 100644 --- a/dhcpv4/dhcpv4.go +++ b/dhcpv4/dhcpv4.go @@ -175,7 +175,6 @@ func NewDiscoveryForInterface(ifname string, modifiers ...Modifier) (*DHCPv4, er // HW type and specified hardware address. func NewDiscovery(hwaddr net.HardwareAddr, modifiers ...Modifier) (*DHCPv4, error) { return New(PrependModifiers(modifiers, - WithBroadcast(true), WithHwAddr(hwaddr), WithRequestedOptions( OptionSubnetMask, diff --git a/dhcpv4/dhcpv4_test.go b/dhcpv4/dhcpv4_test.go index 45adc8c..839be65 100644 --- a/dhcpv4/dhcpv4_test.go +++ b/dhcpv4/dhcpv4_test.go @@ -291,7 +291,6 @@ func TestNewDiscovery(t *testing.T) { require.Equal(t, OpcodeBootRequest, m.OpCode) require.Equal(t, iana.HWTypeEthernet, m.HWType) require.Equal(t, hwAddr, m.ClientHWAddr) - require.True(t, m.IsBroadcast()) require.True(t, m.Options.Has(OptionParameterRequestList)) } |