From da69dad309583925ff4f8d0454bd0fb5bb6a1402 Mon Sep 17 00:00:00 2001 From: Christopher Koch Date: Sun, 20 Jan 2019 20:13:51 +0000 Subject: dhcpv6: move option code and length marshaling to Options.ToBytes. --- dhcpv6/option_domainsearchlist.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'dhcpv6/option_domainsearchlist.go') diff --git a/dhcpv6/option_domainsearchlist.go b/dhcpv6/option_domainsearchlist.go index 404a109..21d7c23 100644 --- a/dhcpv6/option_domainsearchlist.go +++ b/dhcpv6/option_domainsearchlist.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/insomniacslk/dhcp/rfc1035label" - "github.com/u-root/u-root/pkg/uio" ) // OptDomainSearchList list implements a OptionDomainSearchList option @@ -21,11 +20,7 @@ func (op *OptDomainSearchList) Code() OptionCode { // ToBytes marshals this option to bytes. func (op *OptDomainSearchList) ToBytes() []byte { - buf := uio.NewBigEndianBuffer(nil) - buf.Write16(uint16(OptionDomainSearchList)) - buf.Write16(uint16(op.Length())) - buf.WriteBytes(op.DomainSearchList.ToBytes()) - return buf.Data() + return op.DomainSearchList.ToBytes() } func (op *OptDomainSearchList) Length() int { -- cgit v1.2.3