summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-04-05 13:14:00 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2022-04-06 09:35:37 +0200
commit9ca44fc8ef2a7193626e3bac1af698f877f5aa33 (patch)
tree062bfcb6d89bb948313aeff01f4a2a45f7d92776 /bgpd
parentbgpd: Reuse is_running() function in RPKI code for rtr_is_running (diff)
downloadfrr-9ca44fc8ef2a7193626e3bac1af698f877f5aa33.tar.xz
frr-9ca44fc8ef2a7193626e3bac1af698f877f5aa33.zip
bgpd: Reuse is_stopping() in RPKI code same as with is_running()
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_rpki.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c
index f5caa9a83..45fcbc86b 100644
--- a/bgpd/bgp_rpki.c
+++ b/bgpd/bgp_rpki.c
@@ -123,6 +123,7 @@ static int add_tcp_cache(const char *host, const char *port,
static void print_record(const struct pfx_record *record, struct vty *vty);
static int is_synchronized(void);
static int is_running(void);
+static int is_stopping(void);
static void route_match_free(void *rule);
static enum route_map_cmd_result_t route_match(void *rule,
const struct prefix *prefix,
@@ -340,6 +341,11 @@ inline int is_running(void)
return rtr_is_running;
}
+inline int is_stopping(void)
+{
+ return rtr_is_stopping;
+}
+
static struct prefix *pfx_record_to_prefix(struct pfx_record *record)
{
struct prefix *prefix = prefix_new();
@@ -481,7 +487,7 @@ static void rpki_connection_status_cb(const struct rtr_mgr_group *group
struct pfx_record rec = {0};
int retval;
- if (rtr_is_stopping ||
+ if (is_stopping() ||
atomic_load_explicit(&rtr_update_overflow, memory_order_seq_cst))
return;
@@ -501,8 +507,8 @@ static void rpki_update_cb_sync_rtr(struct pfx_table *p __attribute__((unused)),
const struct pfx_record rec,
const bool added __attribute__((unused)))
{
- if (rtr_is_stopping
- || atomic_load_explicit(&rtr_update_overflow, memory_order_seq_cst))
+ if (is_stopping() ||
+ atomic_load_explicit(&rtr_update_overflow, memory_order_seq_cst))
return;
int retval =