Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: RPKI cache sync #17536

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions bgpd/bgp_rpki.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,10 +781,16 @@ static void rpki_update_cb_sync_rtr(struct pfx_table *p __attribute__((unused)),
goto err;
}

if (is_stopping(rpki_vrf) ||
atomic_load_explicit(&rpki_vrf->rtr_update_overflow,
memory_order_seq_cst))
if (is_stopping(rpki_vrf) || !is_synchronized(rpki_vrf) ||
atomic_load_explicit(&rpki_vrf->rtr_update_overflow, memory_order_seq_cst)) {
RPKI_DEBUG("rtr_mgr is stopping or not synchronized, ignore validating prefixes");
return;
}

if (rtr->state == RTR_SYNC) {
RPKI_DEBUG("rtr_mgr socket is in sync, ignore validating prefixes");
return;
}

int retval = write(rpki_vrf->rpki_sync_socket_rtr, &rec,
sizeof(struct pfx_record));
Expand Down Expand Up @@ -932,7 +938,6 @@ static int start(struct rpki_vrf *rpki_vrf)
rpki_vrf->rtr_is_synced = false;
rpki_vrf->rtr_update_overflow = 0;
cache_list = rpki_vrf->cache_list;
rpki_vrf->rtr_update_overflow = 0;

if (!cache_list || list_isempty(cache_list)) {
RPKI_DEBUG(
Expand All @@ -954,10 +959,9 @@ static int start(struct rpki_vrf *rpki_vrf)
struct rtr_mgr_group *groups = get_groups(rpki_vrf->cache_list);

RPKI_DEBUG("Polling period: %d", rpki_vrf->polling_period);
ret = rtr_mgr_init(&rpki_vrf->rtr_config, groups, groups_len,
rpki_vrf->polling_period, rpki_vrf->expire_interval,
rpki_vrf->retry_interval, rpki_update_cb_sync_rtr,
NULL, NULL, NULL);
ret = rtr_mgr_init(&rpki_vrf->rtr_config, groups, groups_len, rpki_vrf->polling_period,
rpki_vrf->expire_interval, rpki_vrf->retry_interval,
rpki_update_cb_sync_rtr, NULL, NULL, NULL);
if (ret == RTR_ERROR) {
RPKI_DEBUG("Init rtr_mgr failed (%s).", vrf->name);
return ERROR;
Expand Down
Loading