summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Jaggi <aj@open.ch>2017-09-08 13:46:20 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-09-08 13:54:03 +0200
commit084002351fbfd6b4e2d9c4c218288b2324ad81cd (patch)
tree0380ea7ef0615fe81cd8eb2ffbae7aef888ed9a3
parentMerge pull request #1118 from opensourcerouting/attr-kill-master (diff)
downloadfrr-084002351fbfd6b4e2d9c4c218288b2324ad81cd.tar.xz
frr-084002351fbfd6b4e2d9c4c218288b2324ad81cd.zip
bgpd: Fix AS_PATH size calculation for long paths
If you have an AS_PATH with more entries than what can be written into a single AS_SEGMENT_MAX it needs to be broken up. The code that noticed that the AS_PATH needs to be broken up was not correctly calculating the size of the resulting message. This patch addresses this issue. This patch was built from an email that Andreas sent to the dev alias for FRRouting. Fixes: #1114 Signed-off-by: Andreas Jaggi <aj@open.ch> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--bgpd/bgp_aspath.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c
index 2ce52d92a..2b776d218 100644
--- a/bgpd/bgp_aspath.c
+++ b/bgpd/bgp_aspath.c
@@ -892,7 +892,7 @@ size_t aspath_put(struct stream *s, struct aspath *as, int use32bit)
assegment_data_put(s, seg->as, AS_SEGMENT_MAX,
use32bit);
written += AS_SEGMENT_MAX;
- bytes += ASSEGMENT_SIZE(written, use32bit);
+ bytes += ASSEGMENT_SIZE(AS_SEGMENT_MAX, use32bit);
}
/* write the final segment, probably is also the first