diff options
author | Maria Matejka <mq@ucw.cz> | 2022-10-03 17:09:02 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-10-03 17:09:02 +0200 |
commit | 605ff0a0ebdd32b1a98316737c3e65acb528a156 (patch) | |
tree | 58bf90a680e2aa1ae679dd1a4f667a956c1e83b2 /proto | |
parent | 0f2be469f897b6d9f925563bbf522438c83522ea (diff) |
RPKI: wait for retry_time if we get error immediately after connected
Diffstat (limited to 'proto')
-rw-r--r-- | proto/rpki/rpki.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/proto/rpki/rpki.c b/proto/rpki/rpki.c index 4fca9e54..3c27aa1a 100644 --- a/proto/rpki/rpki.c +++ b/proto/rpki/rpki.c @@ -278,12 +278,13 @@ rpki_cache_change_state(struct rpki_cache *cache, const enum rpki_cache_state ne case RPKI_CS_NO_INCR_UPDATE_AVAIL: /* Server was unable to answer the last Serial Query and sent Cache Reset. */ - rpki_cache_change_state(cache, RPKI_CS_RESET); - break; - case RPKI_CS_ERROR_NO_DATA_AVAIL: /* No validation records are available on the cache server. */ - rpki_cache_change_state(cache, RPKI_CS_RESET); + + if (old_state == RPKI_CS_ESTABLISHED) + rpki_cache_change_state(cache, RPKI_CS_RESET); + else + rpki_schedule_next_retry(cache); break; case RPKI_CS_ERROR_FATAL: @@ -453,6 +454,11 @@ rpki_retry_hook(timer *tm) } break; + case RPKI_CS_NO_INCR_UPDATE_AVAIL: + case RPKI_CS_ERROR_NO_DATA_AVAIL: + rpki_cache_change_state(cache, RPKI_CS_RESET); + break; + default: rpki_cache_change_state(cache, RPKI_CS_CONNECTING); break; |