summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/option_broadcast_address_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv4/option_broadcast_address_test.go')
-rw-r--r--dhcpv4/option_broadcast_address_test.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/dhcpv4/option_broadcast_address_test.go b/dhcpv4/option_broadcast_address_test.go
index 3572dc0..1feb6cc 100644
--- a/dhcpv4/option_broadcast_address_test.go
+++ b/dhcpv4/option_broadcast_address_test.go
@@ -29,16 +29,10 @@ func TestParseOptBroadcastAddress(t *testing.T) {
o, err = ParseOptBroadcastAddress([]byte{})
require.Error(t, err, "empty byte stream")
- o, err = ParseOptBroadcastAddress([]byte{byte(OptionBroadcastAddress), 4, 192})
- require.Error(t, err, "short byte stream")
-
- o, err = ParseOptBroadcastAddress([]byte{byte(OptionBroadcastAddress), 3, 192, 168, 0, 1})
+ o, err = ParseOptBroadcastAddress([]byte{192, 168, 0})
require.Error(t, err, "wrong IP length")
- o, err = ParseOptBroadcastAddress([]byte{53, 4, 192, 168, 1})
- require.Error(t, err, "wrong option code")
-
- o, err = ParseOptBroadcastAddress([]byte{byte(OptionBroadcastAddress), 4, 192, 168, 0, 1})
+ o, err = ParseOptBroadcastAddress([]byte{192, 168, 0, 1})
require.NoError(t, err)
require.Equal(t, net.IP{192, 168, 0, 1}, o.BroadcastAddress)
}