summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/option_dns.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv6/option_dns.go')
-rw-r--r--dhcpv6/option_dns.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/dhcpv6/option_dns.go b/dhcpv6/option_dns.go
index f69973a..af9bafe 100644
--- a/dhcpv6/option_dns.go
+++ b/dhcpv6/option_dns.go
@@ -34,14 +34,12 @@ func (op *optDNS) String() string {
return fmt.Sprintf("%s: %v", op.Code(), op.NameServers)
}
-// parseOptDNS builds an optDNS structure
-// from a sequence of bytes. The input data does not include option code and length
-// bytes.
-func parseOptDNS(data []byte) (*optDNS, error) {
- var opt optDNS
+// FromBytes builds an optDNS structure from a sequence of bytes. The input
+// data does not include option code and length bytes.
+func (op *optDNS) FromBytes(data []byte) error {
buf := uio.NewBigEndianBuffer(data)
for buf.Has(net.IPv6len) {
- opt.NameServers = append(opt.NameServers, buf.CopyN(net.IPv6len))
+ op.NameServers = append(op.NameServers, buf.CopyN(net.IPv6len))
}
- return &opt, buf.FinError()
+ return buf.FinError()
}