mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-27 13:46:45 +00:00
bgpd: Make suppress-fib-pending
clear peering
When a peer has come up and already started installing
routes into the rib and `suppress-fib-pending` is either
turned on or off. BGP is left with some routes that
may need to be withdrawn from peers and routes that
it does not know the status of. Clear the BGP peers
for the interesting parties and let's let us come
up to speed as needed.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit bdb5ae8bce
)
This commit is contained in:
parent
7163844e77
commit
6fb4068f35
@ -562,42 +562,45 @@ void bgp_delayopen_timer(struct event *thread)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* BGP Peer Down Cause */
|
/* BGP Peer Down Cause */
|
||||||
const char *const peer_down_str[] = {"",
|
const char *const peer_down_str[] = {
|
||||||
"Router ID changed",
|
"",
|
||||||
"Remote AS changed",
|
"Router ID changed",
|
||||||
"Local AS change",
|
"Remote AS changed",
|
||||||
"Cluster ID changed",
|
"Local AS change",
|
||||||
"Confederation identifier changed",
|
"Cluster ID changed",
|
||||||
"Confederation peer changed",
|
"Confederation identifier changed",
|
||||||
"RR client config change",
|
"Confederation peer changed",
|
||||||
"RS client config change",
|
"RR client config change",
|
||||||
"Update source change",
|
"RS client config change",
|
||||||
"Address family activated",
|
"Update source change",
|
||||||
"Admin. shutdown",
|
"Address family activated",
|
||||||
"User reset",
|
"Admin. shutdown",
|
||||||
"BGP Notification received",
|
"User reset",
|
||||||
"BGP Notification send",
|
"BGP Notification received",
|
||||||
"Peer closed the session",
|
"BGP Notification send",
|
||||||
"Neighbor deleted",
|
"Peer closed the session",
|
||||||
"Peer-group add member",
|
"Neighbor deleted",
|
||||||
"Peer-group delete member",
|
"Peer-group add member",
|
||||||
"Capability changed",
|
"Peer-group delete member",
|
||||||
"Passive config change",
|
"Capability changed",
|
||||||
"Multihop config change",
|
"Passive config change",
|
||||||
"NSF peer closed the session",
|
"Multihop config change",
|
||||||
"Intf peering v6only config change",
|
"NSF peer closed the session",
|
||||||
"BFD down received",
|
"Intf peering v6only config change",
|
||||||
"Interface down",
|
"BFD down received",
|
||||||
"Neighbor address lost",
|
"Interface down",
|
||||||
"No path to specified Neighbor",
|
"Neighbor address lost",
|
||||||
"Waiting for Peer IPv6 LLA",
|
"No path to specified Neighbor",
|
||||||
"Waiting for VRF to be initialized",
|
"Waiting for Peer IPv6 LLA",
|
||||||
"No AFI/SAFI activated for peer",
|
"Waiting for VRF to be initialized",
|
||||||
"AS Set config change",
|
"No AFI/SAFI activated for peer",
|
||||||
"Waiting for peer OPEN",
|
"AS Set config change",
|
||||||
"Reached received prefix count",
|
"Waiting for peer OPEN",
|
||||||
"Socket Error",
|
"Reached received prefix count",
|
||||||
"Admin. shutdown (RTT)"};
|
"Socket Error",
|
||||||
|
"Admin. shutdown (RTT)",
|
||||||
|
"Suppress Fib Turned On or Off",
|
||||||
|
};
|
||||||
|
|
||||||
static void bgp_graceful_restart_timer_off(struct peer_connection *connection,
|
static void bgp_graceful_restart_timer_off(struct peer_connection *connection,
|
||||||
struct peer *peer)
|
struct peer *peer)
|
||||||
|
38
bgpd/bgpd.c
38
bgpd/bgpd.c
@ -410,6 +410,9 @@ void bgp_router_id_static_set(struct bgp *bgp, struct in_addr id)
|
|||||||
void bm_wait_for_fib_set(bool set)
|
void bm_wait_for_fib_set(bool set)
|
||||||
{
|
{
|
||||||
bool send_msg = false;
|
bool send_msg = false;
|
||||||
|
struct bgp *bgp;
|
||||||
|
struct peer *peer;
|
||||||
|
struct listnode *next, *node;
|
||||||
|
|
||||||
if (bm->wait_for_fib == set)
|
if (bm->wait_for_fib == set)
|
||||||
return;
|
return;
|
||||||
@ -428,12 +431,32 @@ void bm_wait_for_fib_set(bool set)
|
|||||||
if (send_msg && zclient)
|
if (send_msg && zclient)
|
||||||
zebra_route_notify_send(ZEBRA_ROUTE_NOTIFY_REQUEST,
|
zebra_route_notify_send(ZEBRA_ROUTE_NOTIFY_REQUEST,
|
||||||
zclient, set);
|
zclient, set);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If this is configed at a time when peers are already set
|
||||||
|
* FRR needs to reset the connection(s) as that some installs
|
||||||
|
* may have already happened in some shape fashion or form
|
||||||
|
* let's just start over
|
||||||
|
*/
|
||||||
|
for (ALL_LIST_ELEMENTS_RO(bm->bgp, next, bgp)) {
|
||||||
|
for (ALL_LIST_ELEMENTS_RO(bgp->peer, node, peer)) {
|
||||||
|
if (!BGP_IS_VALID_STATE_FOR_NOTIF(
|
||||||
|
peer->connection->status))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
peer->last_reset = PEER_DOWN_SUPPRESS_FIB_PENDING;
|
||||||
|
bgp_notify_send(peer->connection, BGP_NOTIFY_CEASE,
|
||||||
|
BGP_NOTIFY_CEASE_CONFIG_CHANGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the suppress fib pending for the bgp configuration */
|
/* Set the suppress fib pending for the bgp configuration */
|
||||||
void bgp_suppress_fib_pending_set(struct bgp *bgp, bool set)
|
void bgp_suppress_fib_pending_set(struct bgp *bgp, bool set)
|
||||||
{
|
{
|
||||||
bool send_msg = false;
|
bool send_msg = false;
|
||||||
|
struct peer *peer;
|
||||||
|
struct listnode *node;
|
||||||
|
|
||||||
if (bgp->inst_type == BGP_INSTANCE_TYPE_VIEW)
|
if (bgp->inst_type == BGP_INSTANCE_TYPE_VIEW)
|
||||||
return;
|
return;
|
||||||
@ -465,6 +488,21 @@ void bgp_suppress_fib_pending_set(struct bgp *bgp, bool set)
|
|||||||
zebra_route_notify_send(ZEBRA_ROUTE_NOTIFY_REQUEST,
|
zebra_route_notify_send(ZEBRA_ROUTE_NOTIFY_REQUEST,
|
||||||
zclient, set);
|
zclient, set);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If this is configed at a time when peers are already set
|
||||||
|
* FRR needs to reset the connection as that some installs
|
||||||
|
* may have already happened in some shape fashion or form
|
||||||
|
* let's just start over
|
||||||
|
*/
|
||||||
|
for (ALL_LIST_ELEMENTS_RO(bgp->peer, node, peer)) {
|
||||||
|
if (!BGP_IS_VALID_STATE_FOR_NOTIF(peer->connection->status))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
peer->last_reset = PEER_DOWN_SUPPRESS_FIB_PENDING;
|
||||||
|
bgp_notify_send(peer->connection, BGP_NOTIFY_CEASE,
|
||||||
|
BGP_NOTIFY_CEASE_CONFIG_CHANGE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BGP's cluster-id control. */
|
/* BGP's cluster-id control. */
|
||||||
|
@ -1742,6 +1742,7 @@ struct peer {
|
|||||||
#define PEER_DOWN_PFX_COUNT 33U /* Reached received prefix count */
|
#define PEER_DOWN_PFX_COUNT 33U /* Reached received prefix count */
|
||||||
#define PEER_DOWN_SOCKET_ERROR 34U /* Some socket error happened */
|
#define PEER_DOWN_SOCKET_ERROR 34U /* Some socket error happened */
|
||||||
#define PEER_DOWN_RTT_SHUTDOWN 35U /* Automatically shutdown due to RTT */
|
#define PEER_DOWN_RTT_SHUTDOWN 35U /* Automatically shutdown due to RTT */
|
||||||
|
#define PEER_DOWN_SUPPRESS_FIB_PENDING 36U /* Suppress fib pending changed */
|
||||||
/*
|
/*
|
||||||
* Remember to update peer_down_str in bgp_fsm.c when you add
|
* Remember to update peer_down_str in bgp_fsm.c when you add
|
||||||
* a new value to the last_reset reason
|
* a new value to the last_reset reason
|
||||||
|
Loading…
Reference in New Issue
Block a user