diff options
author | Chris Koch <chrisko@google.com> | 2019-12-28 00:57:21 -0800 |
---|---|---|
committer | insomniac <insomniacslk@users.noreply.github.com> | 2020-03-05 15:51:55 +0000 |
commit | c483f8beb41f894c3d9c5adf0781c73ca1fbd7ac (patch) | |
tree | 73f0afcf6f50af83220f4f2d67e7edbc2cb71326 /dhcpv6/iputils.go | |
parent | 8d3e32a40580e3e227f64d9068f84b321e7921b2 (diff) |
v6: add ClientID getter
Signed-off-by: Chris Koch <chrisko@google.com>
Diffstat (limited to 'dhcpv6/iputils.go')
-rw-r--r-- | dhcpv6/iputils.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/dhcpv6/iputils.go b/dhcpv6/iputils.go index b8c5876..9c18da2 100644 --- a/dhcpv6/iputils.go +++ b/dhcpv6/iputils.go @@ -83,11 +83,10 @@ func ExtractMAC(packet DHCPv6) (net.HardwareAddr, error) { return nil, err } } - optclientid := msg.GetOneOption(OptionClientID) - if optclientid == nil { + duid := msg.(*Message).Options.ClientID() + if duid == nil { return nil, fmt.Errorf("client ID not found in packet") } - duid := optclientid.(*OptClientId).Cid if duid.LinkLayerAddr == nil { return nil, fmt.Errorf("failed to extract MAC") } |