From da69dad309583925ff4f8d0454bd0fb5bb6a1402 Mon Sep 17 00:00:00 2001 From: Christopher Koch Date: Sun, 20 Jan 2019 20:13:51 +0000 Subject: dhcpv6: move option code and length marshaling to Options.ToBytes. --- dhcpv6/option_interfaceid_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'dhcpv6/option_interfaceid_test.go') diff --git a/dhcpv6/option_interfaceid_test.go b/dhcpv6/option_interfaceid_test.go index b8c6b42..ec9e80d 100644 --- a/dhcpv6/option_interfaceid_test.go +++ b/dhcpv6/option_interfaceid_test.go @@ -23,13 +23,11 @@ func TestOptInterfaceId(t *testing.T) { func TestOptInterfaceIdToBytes(t *testing.T) { interfaceId := []byte("DSLAM01 eth2/1/01/21") - expected := []byte{00, 18, 00, byte(len(interfaceId))} - expected = append(expected, interfaceId...) opt := OptInterfaceId{} opt.SetInterfaceID(interfaceId) toBytes := opt.ToBytes() - if !bytes.Equal(toBytes, expected) { - t.Fatalf("Invalid ToBytes result. Expected %v, got %v", expected, toBytes) + if !bytes.Equal(toBytes, interfaceId) { + t.Fatalf("Invalid ToBytes result. Expected %v, got %v", interfaceId, toBytes) } } -- cgit v1.2.3