summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/option_serverid.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv6/option_serverid.go')
-rw-r--r--dhcpv6/option_serverid.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/dhcpv6/option_serverid.go b/dhcpv6/option_serverid.go
index bdfc290..4c35cc1 100644
--- a/dhcpv6/option_serverid.go
+++ b/dhcpv6/option_serverid.go
@@ -22,12 +22,10 @@ func (op *optServerID) String() string {
return fmt.Sprintf("%s: %v", op.Code(), op.DUID)
}
-// parseOptServerID builds an optServerID structure from a sequence of bytes.
-// The input data does not include option code and length bytes.
-func parseOptServerID(data []byte) (*optServerID, error) {
- sid, err := DUIDFromBytes(data)
- if err != nil {
- return nil, err
- }
- return &optServerID{sid}, nil
+// FromBytes builds an optServerID structure from a sequence of bytes. The
+// input data does not include option code and length bytes.
+func (op *optServerID) FromBytes(data []byte) error {
+ var err error
+ op.DUID, err = DUIDFromBytes(data)
+ return err
}