Having something like:
```
neighbor 192.168.1.222 ebgp-multihop 32
neighbor 192.168.1.222 update-source 192.168.1.5
neighbor 192.168.1.222 bfd
```
Won't work and the result is (empty):
```
$ show bfd peers
BFD Peers:
```
bgp_stop() is called in BGP FSM multiple times (even at startup) that
causes intermediate session interruption when update-source/ebgp-multihop
is triggered.
With this fix, the ordering does not matter and the BFD session's parameters
are updated correctly.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
peer->nsf_af_count = 0;
- /* deregister peer */
- if (peer->bfd_config
- && peer->last_reset == PEER_DOWN_UPDATE_SOURCE_CHANGE)
- bfd_sess_uninstall(peer->bfd_config->session);
-
if (peer_dynamic_neighbor_no_nsf(peer) &&
!(CHECK_FLAG(peer->flags, PEER_FLAG_DELETE))) {
if (bgp_debug_neighbor_events(peer))
if (peer_established(connection)) {
peer->dropped++;
+ if (peer->bfd_config && (peer->last_reset == PEER_DOWN_UPDATE_SOURCE_CHANGE ||
+ peer->last_reset == PEER_DOWN_MULTIHOP_CHANGE))
+ bfd_sess_uninstall(peer->bfd_config->session);
+
/* Notify BGP conditional advertisement process */
peer->advmap_table_change = true;