0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2025-03-21 22:07:03 +00:00

RPKI: Do nothing when protocol is stopping

This commit is contained in:
Maria Matejka 2021-10-30 15:50:16 +00:00 committed by Maria Matejka
parent 13ebe77176
commit 46739f007a
2 changed files with 17 additions and 0 deletions

View File

@ -956,6 +956,8 @@ rpki_err_hook(struct birdsock *sk, int error_num)
CACHE_TRACE(D_EVENTS, cache, "The other side closed a connection"); CACHE_TRACE(D_EVENTS, cache, "The other side closed a connection");
} }
if (cache->p->cache != cache)
return;
rpki_cache_change_state(cache, RPKI_CS_ERROR_TRANSPORT); rpki_cache_change_state(cache, RPKI_CS_ERROR_TRANSPORT);
} }
@ -975,6 +977,9 @@ rpki_tx_hook(sock *sk)
{ {
struct rpki_cache *cache = sk->data; struct rpki_cache *cache = sk->data;
if (cache->p->cache != cache)
return;
while (rpki_fire_tx(cache) > 0) while (rpki_fire_tx(cache) > 0)
; ;
} }
@ -984,6 +989,9 @@ rpki_connected_hook(sock *sk)
{ {
struct rpki_cache *cache = sk->data; struct rpki_cache *cache = sk->data;
if (cache->p->cache != cache)
return;
CACHE_TRACE(D_EVENTS, cache, "Connected"); CACHE_TRACE(D_EVENTS, cache, "Connected");
proto_notify_state(&cache->p->p, PS_UP); proto_notify_state(&cache->p->p, PS_UP);

View File

@ -384,6 +384,9 @@ rpki_refresh_hook(timer *tm)
{ {
struct rpki_cache *cache = tm->data; struct rpki_cache *cache = tm->data;
if (cache->p->cache != cache)
return;
CACHE_DBG(cache, "%s", rpki_cache_state_to_str(cache->state)); CACHE_DBG(cache, "%s", rpki_cache_state_to_str(cache->state));
switch (cache->state) switch (cache->state)
@ -430,6 +433,9 @@ rpki_retry_hook(timer *tm)
{ {
struct rpki_cache *cache = tm->data; struct rpki_cache *cache = tm->data;
if (cache->p->cache != cache)
return;
CACHE_DBG(cache, "%s", rpki_cache_state_to_str(cache->state)); CACHE_DBG(cache, "%s", rpki_cache_state_to_str(cache->state));
switch (cache->state) switch (cache->state)
@ -475,6 +481,9 @@ rpki_expire_hook(timer *tm)
{ {
struct rpki_cache *cache = tm->data; struct rpki_cache *cache = tm->data;
if (cache->p->cache != cache)
return;
if (!cache->last_update) if (!cache->last_update)
return; return;