diff options
author | Emanuele Fia <name29@fb.com> | 2022-03-31 20:38:34 +0100 |
---|---|---|
committer | Emanuele Fia <name29@fb.com> | 2022-04-01 16:51:08 +0100 |
commit | cef7f4a9829be517745c0c07658f1344989d150f (patch) | |
tree | 8da20e3c66df0b3243effa07291f204eef15027f /dhcpv6/options.go | |
parent | 07cc76ec259f5fff3e81e11b340167a690bca9a1 (diff) |
Adding support for DHCPv6 for Ciena
Signed-off-by: Emanuele Fia <name29@fb.com>
Diffstat (limited to 'dhcpv6/options.go')
-rw-r--r-- | dhcpv6/options.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/dhcpv6/options.go b/dhcpv6/options.go index bf523dd..f8445bb 100644 --- a/dhcpv6/options.go +++ b/dhcpv6/options.go @@ -208,12 +208,10 @@ func (o *Options) FromBytesWithParser(data []byte, parser OptionParser) error { // Consume, but do not Copy. Each parser will make a copy of // pertinent data. optData := buf.Consume(length) - if err := buf.Error(); err != nil { - return fmt.Errorf("Unable to read payload of option code %d with option length %d: %v", code, length, err) - } + opt, err := parser(code, optData) if err != nil { - return fmt.Errorf("Unable to parse option code %d with option length %d : %v [data %x]", code, length, err, optData) + return err } *o = append(*o, opt) } |