From 307f1cd1b31c540ae4d90a6209b7c40e3a53fc64 Mon Sep 17 00:00:00 2001 From: Andrea Barberio Date: Wed, 13 Dec 2017 19:01:27 +0000 Subject: Fixed off by one --- dhcpv6/option_nii.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dhcpv6/option_nii.go b/dhcpv6/option_nii.go index 1df1579..85c9d4b 100644 --- a/dhcpv6/option_nii.go +++ b/dhcpv6/option_nii.go @@ -39,10 +39,10 @@ func (op *OptNetworkInterfaceId) Code() OptionCode { func (op *OptNetworkInterfaceId) ToBytes() []byte { buf := make([]byte, 7) binary.BigEndian.PutUint16(buf[0:2], uint16(OPTION_NII)) - binary.BigEndian.PutUint16(buf[2:5], uint16(op.Length())) - buf[5] = op.type_ - buf[6] = op.major - buf[7] = op.minor + binary.BigEndian.PutUint16(buf[2:4], uint16(op.Length())) + buf[4] = op.type_ + buf[5] = op.major + buf[6] = op.minor return buf } -- cgit v1.2.3