summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/modifiers_test.go
diff options
context:
space:
mode:
authorTom McPhail <tom.mcphail@icloud.com>2020-06-01 23:17:56 +1000
committerTom McPhail <tom.mcphail@icloud.com>2020-06-01 23:40:22 +1000
commit09f6357e9117743012d95388156bc2f6ab606116 (patch)
tree573440499f10dff5dddf69b35ee6f8c5682eb84a /dhcpv6/modifiers_test.go
parented3125c2efe7026894d9ecf1c41d213d6c1f2010 (diff)
Add Client Link-Layer Address option for RFC 6939 support.
Signed-off-by: Tom McPhail <tom.mcphail@icloud.com>
Diffstat (limited to 'dhcpv6/modifiers_test.go')
-rw-r--r--dhcpv6/modifiers_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/dhcpv6/modifiers_test.go b/dhcpv6/modifiers_test.go
index 2354bd0..3c3204d 100644
--- a/dhcpv6/modifiers_test.go
+++ b/dhcpv6/modifiers_test.go
@@ -121,3 +121,16 @@ func TestWithIAPD(t *testing.T) {
require.Equal(t, 1, len(opt))
require.Equal(t, OptionIAPD, opt[0].Code())
}
+
+func TestWithClientLinkLayerAddress(t *testing.T) {
+ var d RelayMessage
+ mac, _ := net.ParseMAC("a4:83:e7:e3:df:88")
+ WithClientLinkLayerAddress(iana.HWTypeEthernet, mac)(&d)
+
+ opt := d.Options.GetOne(OptionClientLinkLayerAddr)
+ require.Equal(t, OptionClientLinkLayerAddr, opt.Code())
+
+ llt, lla := d.Options.ClientLinkLayerAddress()
+ require.Equal(t, iana.HWTypeEthernet, llt)
+ require.Equal(t, mac, lla)
+}