summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/dhcpv6relay_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv6/dhcpv6relay_test.go')
-rw-r--r--dhcpv6/dhcpv6relay_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/dhcpv6/dhcpv6relay_test.go b/dhcpv6/dhcpv6relay_test.go
index a7918ab..c383487 100644
--- a/dhcpv6/dhcpv6relay_test.go
+++ b/dhcpv6/dhcpv6relay_test.go
@@ -36,6 +36,17 @@ func TestRelayMessage(t *testing.T) {
}
}
+func TestRelayMessageToBytesDefault(t *testing.T) {
+ want := []byte{
+ 12, // MessageTypeRelayForward
+ 0, // hop count
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // link addr
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // peer addr
+ }
+ r := RelayMessage{MessageType: MessageTypeRelayForward}
+ require.Equal(t, r.ToBytes(), want)
+}
+
func TestRelayMessageToBytes(t *testing.T) {
expected := []byte{
12, // MessageTypeRelayForward