diff options
author | Louis Scalbert <louis.scalbert@6wind.com> | 2021-10-20 16:26:30 +0200 |
---|---|---|
committer | Louis Scalbert <louis.scalbert@6wind.com> | 2022-01-20 18:19:37 +0100 |
commit | d0bf49ecd57e7376e9498a8f3e2e216ae7a59377 (patch) | |
tree | 6e392c24c6dfa1ebf1caceace7c66c6613398a56 /bgpd/bgp_updgrp_packet.c | |
parent | bgpd: fix calculation of update-group hash with maximum-prefix-out (diff) | |
download | frr-d0bf49ecd57e7376e9498a8f3e2e216ae7a59377.tar.xz frr-d0bf49ecd57e7376e9498a8f3e2e216ae7a59377.zip |
bgpd: apply maximum-prefix-out without clearing the neighbor
Abstract:
- The command "neighbor PEER maximum-prefix-out NUMBER" cannot be applied
without clearing the BGP neighbor.
- Apply the maximum-prefix-out value as soon as it is modified without
clearing the neighbor.
subgroup_update_packet() and subgroup_withdraw_packet() respectively
manages the announcement and withdrawal BGP message to the peer.
subgrp->scount counter counts the number of sent prefixes.
Before the patch, the maximum out prefix limitation was applied in
subgroup_update_packet() in order that subgrp->scount never exceeds the
limit. Setting a limit inferior to the effective number of sent prefix
did not result in sending any withdrawal message to reduce the number of
sent prefixes. Without clearing the BGP neighbor, the limitation only
applied to the announcement of new prefixes when the limitation was
over.
With the patch, the limitation is checked in subgroup_announce_check().
The function is intended to say whether a prefix has to be announced in
regards to the prefix-list, route-map... Now when a maximum-prefix-out
value is changed/removed, the neighbor AFI/SAFI table is re-parsed in
the same way as for the application of route-map, prefix-lists...
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'bgpd/bgp_updgrp_packet.c')
-rw-r--r-- | bgpd/bgp_updgrp_packet.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c index 9c32c7ed1..341c7dd78 100644 --- a/bgpd/bgp_updgrp_packet.c +++ b/bgpd/bgp_updgrp_packet.c @@ -709,21 +709,6 @@ struct bpacket *subgroup_update_packet(struct update_subgroup *subgrp) addpath_tx_id = adj->addpath_tx_id; path = adv->pathi; - /* Check if we need to add a prefix to the packet if - * maximum-prefix-out is set for the peer. - */ - if (CHECK_FLAG(peer->af_flags[afi][safi], - PEER_FLAG_MAX_PREFIX_OUT) - && subgrp->scount >= peer->pmax_out[afi][safi]) { - if (BGP_DEBUG(update, UPDATE_OUT) - || BGP_DEBUG(update, UPDATE_PREFIX)) { - zlog_debug( - "%s reached maximum prefix to be send (%u)", - peer->host, peer->pmax_out[afi][safi]); - } - goto next; - } - space_remaining = STREAM_CONCAT_REMAIN(s, snlri, STREAM_SIZE(s)) - BGP_MAX_PACKET_SIZE_OVERFLOW; space_needed = @@ -876,7 +861,6 @@ struct bpacket *subgroup_update_packet(struct update_subgroup *subgrp) subgrp->scount++; adj->attr = bgp_attr_intern(adv->baa->attr); -next: adv = bgp_advertise_clean_subgroup(subgrp, adj); } |