summaryrefslogtreecommitdiffhomepage
path: root/packet/mrt/mrt.go
diff options
context:
space:
mode:
authorWataru Ishida <ishida.wataru@lab.ntt.co.jp>2017-05-05 09:17:50 -0400
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-05-10 15:46:04 +0900
commit540d77319c6eaa1eefd7b52df2a4771c7ee565ac (patch)
tree5161950a889037e9566811e5f87347bb16d96aaa /packet/mrt/mrt.go
parentae1da6974aa8ca437e0a4070da1ebbf7b181e2e2 (diff)
mrt: fix bug of general address family rib serialization
allocate a slice with 2 byte length (not 2 byte capacity) for PutUint16() fixes #1313 Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'packet/mrt/mrt.go')
-rw-r--r--packet/mrt/mrt.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/packet/mrt/mrt.go b/packet/mrt/mrt.go
index 041a2802..8947648a 100644
--- a/packet/mrt/mrt.go
+++ b/packet/mrt/mrt.go
@@ -465,7 +465,7 @@ func (u *Rib) Serialize() ([]byte, error) {
switch rf {
case bgp.RF_IPv4_UC, bgp.RF_IPv4_MC, bgp.RF_IPv6_UC, bgp.RF_IPv6_MC:
default:
- bbuf := make([]byte, 0, 2)
+ bbuf := make([]byte, 2)
binary.BigEndian.PutUint16(bbuf, u.Prefix.AFI())
buf = append(buf, bbuf...)
buf = append(buf, u.Prefix.SAFI())