diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-06-14 16:32:15 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-12-07 13:52:21 +0100 |
commit | d59c1a295834aa5cc63aceb6769c8413fa0639fe (patch) | |
tree | 96c090a994b71c039466114fe84da57a561f9159 /proto/rpki/packets.c | |
parent | 21f4f0f4b0785e30ce2af4741ffa6f2ebdd7d714 (diff) |
RPKI: Update to new timers
Diffstat (limited to 'proto/rpki/packets.c')
-rw-r--r-- | proto/rpki/packets.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/proto/rpki/packets.c b/proto/rpki/packets.c index 60ca3936..59a5efaf 100644 --- a/proto/rpki/packets.c +++ b/proto/rpki/packets.c @@ -554,9 +554,9 @@ rpki_check_receive_packet(struct rpki_cache *cache, const struct pdu_header *pdu * (https://tools.ietf.org/html/draft-ietf-sidr-rpki-rtr-rfc6810-bis-07#section-7) */ } - else if (cache->last_update == 0 - && pdu->ver <= RPKI_MAX_VERSION - && pdu->ver < cache->version) + else if (!cache->last_update && + (pdu->ver <= RPKI_MAX_VERSION) && + (pdu->ver < cache->version)) { CACHE_TRACE(D_EVENTS, cache, "Downgrade session to %s from %u to %u version", rpki_get_cache_ident(cache), cache->version, pdu->ver); cache->version = pdu->ver; @@ -652,7 +652,7 @@ rpki_handle_cache_response_pdu(struct rpki_cache *cache, const struct pdu_cache_ { if (cache->request_session_id) { - if (cache->last_update != 0) + if (cache->last_update) { /* * This isn't the first sync and we already received records. This point @@ -748,7 +748,7 @@ rpki_handle_prefix_pdu(struct rpki_cache *cache, const struct pdu_header *pdu) return RPKI_ERROR; } - cache->last_rx_prefix = now; + cache->last_rx_prefix = current_time(); /* A place for 'flags' is same for both data structures pdu_ipv4 or pdu_ipv6 */ struct pdu_ipv4 *pfx = (void *) pdu; @@ -814,7 +814,7 @@ rpki_handle_end_of_data_pdu(struct rpki_cache *cache, const struct pdu_end_of_da rt_refresh_end(cache->p->roa6_channel->table, cache->p->roa6_channel); } - cache->last_update = now; + cache->last_update = current_time(); cache->serial_num = pdu->serial_num; rpki_cache_change_state(cache, RPKI_CS_ESTABLISHED); } |