summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/options.go
diff options
context:
space:
mode:
authorAndrea Barberio <insomniac@slackware.it>2017-12-08 16:11:11 +0000
committerAndrea Barberio <insomniac@slackware.it>2017-12-08 16:11:11 +0000
commitee15cd8efeb0ee0e722911e9827a2e45eef1f0b1 (patch)
treef2e57c8b59bf0fca758d6beb990368386b565a7f /dhcpv6/options.go
parent256d3cd222508c5b8fcc6cc1242774b10dbfa988 (diff)
Added DHCPv6.Length() and improved relay msg parsing
Diffstat (limited to 'dhcpv6/options.go')
-rw-r--r--dhcpv6/options.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/dhcpv6/options.go b/dhcpv6/options.go
index 2c5842c..2fcc9e9 100644
--- a/dhcpv6/options.go
+++ b/dhcpv6/options.go
@@ -96,6 +96,9 @@ func ParseOption(dataStart []byte) (Option, error) {
if err != nil {
return nil, err
}
+ if length != opt.Length() {
+ return nil, fmt.Errorf("different lengths for opt %v: %v != %v", code, length, opt.Length())
+ }
return opt, nil
}