]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
RPKI: Do nothing when protocol is stopping
authorMaria Matejka <mq@jmq.cz>
Sat, 30 Oct 2021 15:50:16 +0000 (15:50 +0000)
committerMaria Matejka <mq@ucw.cz>
Tue, 9 Nov 2021 18:20:41 +0000 (19:20 +0100)
proto/rpki/packets.c
proto/rpki/rpki.c

index 2c37df76ba143326a7b753a349ad680d3a20ea33..a711858cb8e599453c62779714845ef6bb138839 100644 (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");
   }
 
+  if (cache->p->cache != cache)
+    return;
 
   rpki_cache_change_state(cache, RPKI_CS_ERROR_TRANSPORT);
 }
@@ -975,6 +977,9 @@ rpki_tx_hook(sock *sk)
 {
   struct rpki_cache *cache = sk->data;
 
+  if (cache->p->cache != cache)
+    return;
+
   while (rpki_fire_tx(cache) > 0)
     ;
 }
@@ -984,6 +989,9 @@ rpki_connected_hook(sock *sk)
 {
   struct rpki_cache *cache = sk->data;
 
+  if (cache->p->cache != cache)
+    return;
+
   CACHE_TRACE(D_EVENTS, cache, "Connected");
   proto_notify_state(&cache->p->p, PS_UP);
 
index 72fbc967f8eefdf922c65d13680ddba4e5fbf504..950664990d6bdd0c1e09fc9c72b98682bde19d3d 100644 (file)
@@ -384,6 +384,9 @@ rpki_refresh_hook(timer *tm)
 {
   struct rpki_cache *cache = tm->data;
 
+  if (cache->p->cache != cache)
+    return;
+
   CACHE_DBG(cache, "%s", rpki_cache_state_to_str(cache->state));
 
   switch (cache->state)
@@ -430,6 +433,9 @@ rpki_retry_hook(timer *tm)
 {
   struct rpki_cache *cache = tm->data;
 
+  if (cache->p->cache != cache)
+    return;
+
   CACHE_DBG(cache, "%s", rpki_cache_state_to_str(cache->state));
 
   switch (cache->state)
@@ -475,6 +481,9 @@ rpki_expire_hook(timer *tm)
 {
   struct rpki_cache *cache = tm->data;
 
+  if (cache->p->cache != cache)
+    return;
+
   if (!cache->last_update)
     return;