From d2ba78929f63d49e78140f28995cc745c1c95966 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 26 Aug 2023 18:07:04 -0400 Subject: bgpd: bgp_fsm_change_status/BGP_TIMER_ON and BGP_EVENT_ADD Modify bgp_fsm_change_status to be connection oriented and also make the BGP_TIMER_ON and BGP_EVENT_ADD macros connection oriented as well. Attempt to make peer_xfer_conn a bit more understandable because, frankly it was/is confusing. Signed-off-by: Donald Sharp --- bgpd/bgp_zebra.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'bgpd/bgp_zebra.c') diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 1020e4330..3d993e12c 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -143,8 +143,8 @@ static void bgp_start_interface_nbrs(struct bgp *bgp, struct interface *ifp) if (peer->conf_if && (strcmp(peer->conf_if, ifp->name) == 0) && !peer_established(peer->connection)) { if (peer_active(peer)) - BGP_EVENT_ADD(peer, BGP_Stop); - BGP_EVENT_ADD(peer, BGP_Start); + BGP_EVENT_ADD(peer->connection, BGP_Stop); + BGP_EVENT_ADD(peer->connection, BGP_Start); } } } @@ -183,7 +183,7 @@ static void bgp_nbr_connected_delete(struct bgp *bgp, struct nbr_connected *ifc, if (peer->conf_if && (strcmp(peer->conf_if, ifc->ifp->name) == 0)) { peer->last_reset = PEER_DOWN_NBR_ADDR_DEL; - BGP_EVENT_ADD(peer, BGP_Stop); + BGP_EVENT_ADD(peer->connection, BGP_Stop); } } /* Free neighbor also, if we're asked to. */ @@ -279,7 +279,7 @@ static int bgp_ifp_down(struct interface *ifp) continue; if (ifp == peer->nexthop.ifp) { - BGP_EVENT_ADD(peer, BGP_Stop); + BGP_EVENT_ADD(peer->connection, BGP_Stop); peer->last_reset = PEER_DOWN_IF_DOWN; } } @@ -515,7 +515,8 @@ static int bgp_interface_vrf_update(ZAPI_CALLBACK_ARGS) continue; if (ifp == peer->nexthop.ifp) - BGP_EVENT_ADD(peer, BGP_Stop); + BGP_EVENT_ADD(peer->connection, + BGP_Stop); } } } -- cgit v1.2.3