diff options
author | Andrea Barberio <insomniac@slackware.it> | 2018-04-18 09:37:10 +0100 |
---|---|---|
committer | Andrea Barberio <insomniac@slackware.it> | 2018-04-18 09:37:10 +0100 |
commit | afb709fb09feceb466d462a2e8a926970f4a2243 (patch) | |
tree | 24ab18422f3bf87c57422a0dfa734363635f6241 /dhcpv6/option_userclass.go | |
parent | 940e2977fb5c0781c6eddf3c0b62baeec7de6011 (diff) |
Added missing field to user class, and added to ParseOption
Diffstat (limited to 'dhcpv6/option_userclass.go')
-rw-r--r-- | dhcpv6/option_userclass.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/dhcpv6/option_userclass.go b/dhcpv6/option_userclass.go index 6f62b23..98da207 100644 --- a/dhcpv6/option_userclass.go +++ b/dhcpv6/option_userclass.go @@ -23,6 +23,8 @@ func (op *OptUserClass) ToBytes() []byte { buf := make([]byte, 6) binary.BigEndian.PutUint16(buf[0:2], uint16(OPTION_USER_CLASS)) binary.BigEndian.PutUint16(buf[2:4], uint16(op.Length())) + // user-class-data has an internal data length field too.. + binary.BigEndian.PutUint16(buf[4:6], uint16(len(op.userClass))) buf = append(buf, op.userClass...) return buf } |