diff options
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r-- | proto/bgp/bgp.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index 9408715e..c806765a 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -125,6 +125,7 @@ #include "lib/string.h" #include "bgp.h" +#include "proto/bmp/bmp.h" static list STATIC_LIST_INIT(bgp_sockets); /* Global list of listening sockets */ @@ -866,7 +867,10 @@ bgp_graceful_restart_timeout(timer *t) } } else + { bgp_stop(p, 0, NULL, 0); + bmp_peer_down(p, BE_NONE, NULL, 0); + } } static void @@ -990,7 +994,10 @@ bgp_sock_err(sock *sk, int err) if (err) BGP_TRACE(D_EVENTS, "Connection lost (%M)", err); else + { BGP_TRACE(D_EVENTS, "Connection closed"); + bmp_peer_down(p, BE_SOCKET, NULL, 0); + } if ((conn->state == BS_ESTABLISHED) && p->gr_ready) bgp_handle_graceful_restart(p); @@ -1315,6 +1322,7 @@ bgp_neigh_notify(neighbor *n) bgp_store_error(p, NULL, BE_MISC, BEM_NEIGHBOR_LOST); /* Perhaps also run bgp_update_startup_delay(p)? */ bgp_stop(p, 0, NULL, 0); + bmp_peer_down(p, BE_MISC, NULL, 0); } } else if (p->cf->check_link && !(n->iface->flags & IF_LINK_UP)) @@ -1326,6 +1334,7 @@ bgp_neigh_notify(neighbor *n) if (ps == PS_UP) bgp_update_startup_delay(p); bgp_stop(p, 0, NULL, 0); + bmp_peer_down(p, BE_MISC, NULL, 0); } } else @@ -1367,6 +1376,7 @@ bgp_bfd_notify(struct bfd_request *req) if (ps == PS_UP) bgp_update_startup_delay(p); bgp_stop(p, 0, NULL, 0); + bmp_peer_down(p, BE_MISC, NULL, 0); } } } @@ -1695,6 +1705,10 @@ bgp_init(struct proto_config *CF) P->rte_modify = bgp_rte_modify_stale; P->rte_igp_metric = bgp_rte_igp_metric; +#ifdef CONFIG_BMP + P->rte_update_in_notify = bgp_rte_update_in_notify; +#endif + p->cf = cf; p->is_internal = (cf->local_as == cf->remote_as); p->is_interior = p->is_internal || cf->confederation_member; |