diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-08-24 13:02:28 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-08-24 13:02:28 +0900 |
commit | 64ddb52890451da4c9877f8b3273fb9fe35f878c (patch) | |
tree | a5f318298f23134bbba51103aafe406f5597face /packet/bgp.go | |
parent | 67dcfd267d681012c2dcab7eaef657884e753a05 (diff) |
pack multiple NLRIs into one BGP update message
With this patch, bobgpd packs multiple NLRIs into one BGP update
message (IOW, multiple paths into one update message).
We do only with ipv4 since we could have lots of routes. If you don't
have lots, it's not worth having the complicated logic for such route
families.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'packet/bgp.go')
-rw-r--r-- | packet/bgp.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/packet/bgp.go b/packet/bgp.go index c910f310..d1c77303 100644 --- a/packet/bgp.go +++ b/packet/bgp.go @@ -2703,6 +2703,9 @@ type PathAttribute struct { } func (p *PathAttribute) Len() int { + if p.Length == 0 { + p.Length = uint16(len(p.Value)) + } l := 2 + p.Length if p.Flags&BGP_ATTR_FLAG_EXTENDED_LENGTH != 0 { l += 2 |