]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Set last reset `No AFI/SAFI activated for peer` after we do defaults 17881/head
authorDonatas Abraitis <donatas@opensourcerouting.org>
Sat, 18 Jan 2025 12:54:20 +0000 (14:54 +0200)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Sun, 19 Jan 2025 09:08:00 +0000 (11:08 +0200)
Move checking if the peer is active only after we apply defaults for address
families.

If the family got activated after applying the defaults we should reset last_reset
reason.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgpd.c

index c2254ae791e987401900614993998eb11381b469..db74dd68d0d234cd770b9629cc4c3b8c2dee4698 100644 (file)
@@ -2026,8 +2026,11 @@ struct peer *peer_create(union sockunion *su, const char *conf_if,
        if (bgp->autoshutdown)
                peer_flag_set(peer, PEER_FLAG_SHUTDOWN);
        /* Set up peer's events and timers. */
-       else if (!active && peer_active(peer->connection))
+       else if (!active && peer_active(peer->connection)) {
+               if (peer->last_reset == PEER_DOWN_NOAFI_ACTIVATED)
+                       peer->last_reset = 0;
                bgp_timer_set(peer->connection);
+       }
 
        bgp_peer_gr_flags_update(peer);
        BGP_GR_ROUTER_DETECT_AND_SEND_CAPABILITY_TO_ZEBRA(bgp, bgp->peer);