Skip to content

Commit

Permalink
bgpd: Stop LLGR timer when the connection is established
Browse files Browse the repository at this point in the history
When the connection goes up, the timer is not stopped and if we have a
subsequent GR event we have an old timer which is not as we expect.

Before:
```
spine1-debian-11# sh ip bgp 192.168.100.1/32
BGP routing table entry for 192.168.100.1/32, version 95
Paths: (1 available, best #1, table default, mark routes to be retained for a longer time. Requires support for Long-lived BGP Graceful Restart)
  Not advertised to any peer
  65001 47583, (stale)
    192.168.0.1 from 192.168.0.1 (100.100.200.100)
      Origin incomplete, valid, external, best (First path received)
      Community: llgr-stale
      Last update: Mon Mar 28 08:27:53 2022
      Time until Long-lived stale route deleted: 23 <<<<<<<<<<<<

spine1-debian-11# sh ip bgp 192.168.100.1/32
BGP routing table entry for 192.168.100.1/32, version 103
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  192.168.0.1
  65001 47583
    192.168.0.1 from 192.168.0.1 (100.100.200.100)
      Origin incomplete, valid, external, best (First path received)
      Last update: Mon Mar 28 08:43:29 2022

spine1-debian-11# sh ip bgp 192.168.100.1/32
BGP routing table entry for 192.168.100.1/32, version 103
Paths: (1 available, best #1, table default, mark routes to be retained for a longer time. Requires support for Long-lived BGP Graceful Restart)
  Not advertised to any peer
  65001 47583, (stale)
    192.168.0.1 from 192.168.0.1 (100.100.200.100)
      Origin incomplete, valid, external, best (First path received)
      Community: llgr-stale
      Last update: Mon Mar 28 08:43:30 2022
      Time until Long-lived stale route deleted: 17 <<<<<<<<<<<<<<<
```

After:
```
spine1-debian-11# sh ip bgp 192.168.100.1/32
BGP routing table entry for 192.168.100.1/32, version 79
Paths: (1 available, best #1, table default, mark routes to be retained for a longer time. Requires support for Long-lived BGP Graceful Restart)
  Not advertised to any peer
  65001 47583, (stale)
    192.168.0.1 from 192.168.0.1 (0.0.0.0)
      Origin incomplete, valid, external, best (First path received)
      Community: llgr-stale
      Last update: Mon Mar 28 09:05:18 2022
      Time until Long-lived stale route deleted: 24 <<<<<<<<<<<<<<<

spine1-debian-11# sh ip bgp 192.168.100.1/32
BGP routing table entry for 192.168.100.1/32, version 87
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  192.168.0.1
  65001 47583
    192.168.0.1 from 192.168.0.1 (100.100.200.100)
      Origin incomplete, valid, external, best (First path received)
      Last update: Mon Mar 28 09:05:25 2022

spine1-debian-11# sh ip bgp 192.168.100.1/32
BGP routing table entry for 192.168.100.1/32, version 87
Paths: (1 available, best #1, table default, mark routes to be retained for a longer time. Requires support for Long-lived BGP Graceful Restart)
  Not advertised to any peer
  65001 47583, (stale)
    192.168.0.1 from 192.168.0.1 (100.100.200.100)
      Origin incomplete, valid, external, best (First path received)
      Community: llgr-stale
      Last update: Mon Mar 28 09:05:29 2022
      Time until Long-lived stale route deleted: 29 <<<<<<<<<<<<<<
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
  • Loading branch information
ton31337 committed Mar 28, 2022
1 parent f0a7100 commit 0d4532c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bgpd/bgp_fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2200,8 +2200,18 @@ static int bgp_establish(struct peer *peer)

peer->uptime = bgp_clock();

/* Send route-refresh when ORF is enabled */
/* Send route-refresh when ORF is enabled.
* Stop Long-lived Graceful Restart timers.
*/
FOREACH_AFI_SAFI (afi, safi) {
if (peer->t_llgr_stale[afi][safi]) {
BGP_TIMER_OFF(peer->t_llgr_stale[afi][safi]);
if (bgp_debug_neighbor_events(peer))
zlog_debug(
"%s Long-lived stale timer stopped for afi/safi: %d/%d",
peer->host, afi, safi);
}

if (CHECK_FLAG(peer->af_cap[afi][safi],
PEER_CAP_ORF_PREFIX_SM_ADV)) {
if (CHECK_FLAG(peer->af_cap[afi][safi],
Expand Down

0 comments on commit 0d4532c

Please sign in to comment.