Skip to content

Commit

Permalink
Merge pull request #17904 from louis-6wind/fix-bfd-pg-update-group
Browse files Browse the repository at this point in the history
bgpd: fix bfd with update-source in peer-group
  • Loading branch information
ton31337 authored Jan 23, 2025
2 parents c6c570a + dee3fd6 commit 4a2612c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
4 changes: 4 additions & 0 deletions bgpd/bgp_bfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ void bgp_peer_config_apply(struct peer *p, struct peer_group *pg)
*/
gconfig = pg->conf;

if (CHECK_FLAG(gconfig->flags, PEER_FLAG_UPDATE_SOURCE) ||
CHECK_FLAG(p->flags_override, PEER_FLAG_UPDATE_SOURCE))
bgp_peer_bfd_update_source(p);

/*
* If using default control plane independent configuration,
* then prefer group's (e.g. it means it wasn't manually configured).
Expand Down
12 changes: 12 additions & 0 deletions tests/topotests/bgp_bfd_session/r1/frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,16 @@ router bgp 65000
neighbor 192.168.1.3 bfd
neighbor 192.168.1.3 ebgp-multihop 20
neighbor 192.168.1.3 update-source r1-eth0
neighbor PG peer-group
neighbor PG remote-as auto
neighbor PG bfd
neighbor PG ebgp-multihop 15
neighbor PG update-source 10.0.0.1
neighbor 192.168.1.4 peer-group PG
neighbor PG2 peer-group
neighbor PG2 remote-as auto
neighbor PG2 bfd
neighbor PG2 ebgp-multihop 25
neighbor 192.168.1.5 peer-group PG2
neighbor 192.168.1.5 update-source 10.0.0.1
exit
24 changes: 23 additions & 1 deletion tests/topotests/bgp_bfd_session/test_bgp_bfd_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,29 @@ def _bfd_session():
"diagnostic": "ok",
"remote-diagnostic": "ok",
"type": "dynamic",
}
},
{
"multihop": True,
"peer": "192.168.1.4",
"local": "10.0.0.1",
"vrf": "default",
"minimum-ttl": 241,
"status": "down",
"diagnostic": "ok",
"remote-diagnostic": "ok",
"type": "dynamic",
},
{
"multihop": True,
"peer": "192.168.1.5",
"local": "10.0.0.1",
"vrf": "default",
"minimum-ttl": 231,
"status": "down",
"diagnostic": "ok",
"remote-diagnostic": "ok",
"type": "dynamic",
},
]
return topotest.json_cmp(output, expected)

Expand Down

0 comments on commit 4a2612c

Please sign in to comment.