summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/option_clientid.go
diff options
context:
space:
mode:
authorChristopher Koch <c@chrisko.ch>2019-01-20 20:13:51 +0000
committerinsomniac <insomniacslk@users.noreply.github.com>2019-01-26 23:34:26 +0000
commitda69dad309583925ff4f8d0454bd0fb5bb6a1402 (patch)
tree59ab134698084993a6254afe70ff8035b7b4f655 /dhcpv6/option_clientid.go
parent3478513076477d0f19eaeaf441f29949a9f6bc92 (diff)
dhcpv6: move option code and length marshaling to Options.ToBytes.
Diffstat (limited to 'dhcpv6/option_clientid.go')
-rw-r--r--dhcpv6/option_clientid.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/dhcpv6/option_clientid.go b/dhcpv6/option_clientid.go
index 92ceb24..d0d31d6 100644
--- a/dhcpv6/option_clientid.go
+++ b/dhcpv6/option_clientid.go
@@ -2,8 +2,6 @@ package dhcpv6
import (
"fmt"
-
- "github.com/u-root/u-root/pkg/uio"
)
// OptClientId represents a Client ID option
@@ -20,11 +18,7 @@ func (op *OptClientId) Code() OptionCode {
// ToBytes marshals the Client ID option as defined by RFC 3315, Section 22.2.
func (op *OptClientId) ToBytes() []byte {
- buf := uio.NewBigEndianBuffer(nil)
- buf.Write16(uint16(OptionClientID))
- buf.Write16(uint16(op.Length()))
- buf.WriteBytes(op.Cid.ToBytes())
- return buf.Data()
+ return op.Cid.ToBytes()
}
func (op *OptClientId) Length() int {