]> git.proxmox.com Git - mirror_frr.git/commit - bgpd/bgpd.c
bgpd: apply maximum-prefix-out without clearing the neighbor
authorLouis Scalbert <louis.scalbert@6wind.com>
Wed, 20 Oct 2021 14:26:30 +0000 (16:26 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Thu, 20 Jan 2022 17:19:37 +0000 (18:19 +0100)
commitd0bf49ecd57e7376e9498a8f3e2e216ae7a59377
tree6e392c24c6dfa1ebf1caceace7c66c6613398a56
parente02672605b3fbbd4fc2df096c8e47bb41c366da9
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>
bgpd/bgp_conditional_adv.c
bgpd/bgp_route.c
bgpd/bgp_updgrp.h
bgpd/bgp_updgrp_adv.c
bgpd/bgp_updgrp_packet.c
bgpd/bgp_vty.c
bgpd/bgpd.c
bgpd/bgpd.h