summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/option_iaprefix.go
diff options
context:
space:
mode:
authorChris Koch <chrisko@google.com>2020-03-06 21:58:45 -0800
committerChris Koch <chrisko@google.com>2020-03-06 22:03:11 -0800
commitf22253b4fdf6b07f3ab92d457ac00c330b9f3470 (patch)
tree1dc75955efe4c32d6b70869bf00ed984c47539e6 /dhcpv6/option_iaprefix.go
parent99cbb09fb7b9ed72366e4c3e7def412d8e461539 (diff)
dhcpv6: always write 16-byte IPs
Signed-off-by: Chris Koch <chrisko@google.com>
Diffstat (limited to 'dhcpv6/option_iaprefix.go')
-rw-r--r--dhcpv6/option_iaprefix.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/dhcpv6/option_iaprefix.go b/dhcpv6/option_iaprefix.go
index c66b242..bb907b2 100644
--- a/dhcpv6/option_iaprefix.go
+++ b/dhcpv6/option_iaprefix.go
@@ -34,12 +34,7 @@ func (op *OptIAPrefix) ToBytes() []byte {
t2.Marshal(buf)
buf.Write8(op.prefixLength)
- prefix := op.ipv6Prefix.To16()
- if prefix != nil {
- buf.WriteBytes(prefix)
- } else {
- buf.WriteBytes(make([]byte, net.IPv6len))
- }
+ write16(buf, op.ipv6Prefix)
buf.WriteBytes(op.Options.ToBytes())
return buf.Data()
}