mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 03:47:47 +00:00
bgpd: peer restart after shutdown fix.
* Peers are now automatically restarted by the reconnect timer instead of a ManualStart event after lifting the administrative shutdown. * Question of when to log what remains. * Compiles and works as intended now. Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
This commit is contained in:
parent
cb9196e77a
commit
e03f1f184f
28
bgpd/bgpd.c
28
bgpd/bgpd.c
@ -4033,6 +4033,10 @@ void bgp_shutdown_enable(struct bgp *bgp)
|
|||||||
if (CHECK_FLAG(bgp->flags, BGP_FLAG_SHUTDOWN))
|
if (CHECK_FLAG(bgp->flags, BGP_FLAG_SHUTDOWN))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* TODO: log message
|
||||||
|
zlog_info("Enabled administrative shutdown on BGP instance %s",
|
||||||
|
bgp->name); */
|
||||||
|
|
||||||
/* iterate through peers of BGP instance */
|
/* iterate through peers of BGP instance */
|
||||||
for (ALL_LIST_ELEMENTS_RO(bgp->peer, node, peer)) {
|
for (ALL_LIST_ELEMENTS_RO(bgp->peer, node, peer)) {
|
||||||
/* continue, if peer is already in administrative shutdown. */
|
/* continue, if peer is already in administrative shutdown. */
|
||||||
@ -4050,6 +4054,11 @@ void bgp_shutdown_enable(struct bgp *bgp)
|
|||||||
|
|
||||||
/* trigger a RFC 4271 ManualStop event */
|
/* trigger a RFC 4271 ManualStop event */
|
||||||
BGP_EVENT_ADD(peer, BGP_Stop);
|
BGP_EVENT_ADD(peer, BGP_Stop);
|
||||||
|
|
||||||
|
/* TODO: log message per peer?
|
||||||
|
if (bgp_debug_neighbor_events(peer))
|
||||||
|
zlog_debug("Neighbor %s is now in administrative shutdown.",
|
||||||
|
peer->host); */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set the BGP instances shutdown flag */
|
/* set the BGP instances shutdown flag */
|
||||||
@ -4059,26 +4068,13 @@ void bgp_shutdown_enable(struct bgp *bgp)
|
|||||||
/* Disable global administrative shutdown of all peers of BGP instance */
|
/* Disable global administrative shutdown of all peers of BGP instance */
|
||||||
void bgp_shutdown_disable(struct bgp *bgp)
|
void bgp_shutdown_disable(struct bgp *bgp)
|
||||||
{
|
{
|
||||||
struct peer *peer;
|
|
||||||
struct listnode *node;
|
|
||||||
|
|
||||||
/* do nothing if not shut down. */
|
/* do nothing if not shut down. */
|
||||||
if (!CHECK_FLAG(bgp->flags, BGP_FLAG_SHUTDOWN))
|
if (!CHECK_FLAG(bgp->flags, BGP_FLAG_SHUTDOWN))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* iterate through peers of BGP instance */
|
/* TODO: log message
|
||||||
for (ALL_LIST_ELEMENTS_RO(bgp->peer, node, peer)) {
|
zlog_info("Disabled administrative shutdown on BGP instance %s",
|
||||||
/* respect individual peer shutdown */
|
bgp->name); */
|
||||||
if (CHECK_FLAG(peer->flags, PEER_FLAG_SHUTDOWN))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* respect peer group shutdown */
|
|
||||||
if (CHECK_FLAG(peer->group->conf->flags, PEER_FLAG_SHUTDOWN))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* trigger a RFC 4721 ManualStart event. */
|
|
||||||
BGP_EVENT_ADD(peer, BGP_Start);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* clear the BGP instances shutdown flag */
|
/* clear the BGP instances shutdown flag */
|
||||||
UNSET_FLAG(bgp->flags, BGP_FLAG_SHUTDOWN);
|
UNSET_FLAG(bgp->flags, BGP_FLAG_SHUTDOWN);
|
||||||
|
Loading…
Reference in New Issue
Block a user