summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/option_fqdn.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv6/option_fqdn.go')
-rw-r--r--dhcpv6/option_fqdn.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/dhcpv6/option_fqdn.go b/dhcpv6/option_fqdn.go
index 73a525a..adb47fb 100644
--- a/dhcpv6/option_fqdn.go
+++ b/dhcpv6/option_fqdn.go
@@ -32,15 +32,14 @@ func (op *OptFQDN) String() string {
return fmt.Sprintf("%s: {Flags=%d DomainName=%s}", op.Code(), op.Flags, op.DomainName)
}
-// ParseOptFQDN deserializes from bytes to build a OptFQDN structure.
-func ParseOptFQDN(data []byte) (*OptFQDN, error) {
- var opt OptFQDN
+// FromBytes deserializes from bytes to build a OptFQDN structure.
+func (op *OptFQDN) FromBytes(data []byte) error {
var err error
buf := uio.NewBigEndianBuffer(data)
- opt.Flags = buf.Read8()
- opt.DomainName, err = rfc1035label.FromBytes(buf.ReadAll())
+ op.Flags = buf.Read8()
+ op.DomainName, err = rfc1035label.FromBytes(buf.ReadAll())
if err != nil {
- return nil, err
+ return err
}
- return &opt, buf.FinError()
+ return buf.FinError()
}