Skip to content

Commit

Permalink
bgpd:Fix for AS_PATH size calculation for long AS Paths
Browse files Browse the repository at this point in the history
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.

Fixes:#963
Reported by: Andrew Kerr <[email protected]>
  • Loading branch information
balajig committed Sep 11, 2017
1 parent 3775c6f commit d3cd3f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bgpd/bgp_aspath.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ aspath_put (struct stream *s, struct aspath *as, int use32bit )
assegment_header_put (s, seg->type, AS_SEGMENT_MAX);
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 */
Expand Down

0 comments on commit d3cd3f0

Please sign in to comment.