summaryrefslogtreecommitdiff
path: root/proto/bgp/bgp.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2023-04-21 04:47:55 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2023-04-21 04:47:55 +0200
commit52450bc96dcedbc30cbb2e282c6706ad9e5e5774 (patch)
treee12244a788d6a26c52b3e5785c677b8d82b6a1c9 /proto/bgp/bgp.c
parentd61505b039bf0aa6697e28b2a4e07907c89ba1fb (diff)
parentf3b599afe5bde0c7f232421743041b305bb8afa7 (diff)
Merge branch 'bmp'
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r--proto/bgp/bgp.c14
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;