diff options
Diffstat (limited to 'dhcpv6/dhcpv6relay.go')
-rw-r--r-- | dhcpv6/dhcpv6relay.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/dhcpv6/dhcpv6relay.go b/dhcpv6/dhcpv6relay.go index 12b677a..b8d635e 100644 --- a/dhcpv6/dhcpv6relay.go +++ b/dhcpv6/dhcpv6relay.go @@ -47,8 +47,16 @@ func (r *DHCPv6Relay) ToBytes() []byte { copy(ret[2:18], r.peerAddr) copy(ret[18:34], r.linkAddr) for _, opt := range r.options { - ret = append(opt.ToBytes()) + ret = append(ret, opt.ToBytes()...) } return ret } + +func (r *DHCPv6Relay) Length() int { + mLen := RelayHeaderSize + for _, opt := range r.options { + mLen += opt.Length() + } + return mLen +} |