diff options
author | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2017-05-05 09:17:50 -0400 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-05-10 15:46:04 +0900 |
commit | 540d77319c6eaa1eefd7b52df2a4771c7ee565ac (patch) | |
tree | 5161950a889037e9566811e5f87347bb16d96aaa /packet/mrt | |
parent | ae1da6974aa8ca437e0a4070da1ebbf7b181e2e2 (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')
-rw-r--r-- | packet/mrt/mrt.go | 2 |
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()) |