diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2026-05-22 14:08:07 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2026-05-22 14:08:07 +0000 |
| commit | 4dd0a17edce60370304a45f2c40251e09e193bd6 (patch) | |
| tree | f0cb0f27a9e83b56f8383265413d035ab01926c6 /util/data/msgparse.c | |
| parent | ec5b94f552d7cb2a9d456c67e9941bcf5e3698bf (diff) | |
Diffstat (limited to 'util/data/msgparse.c')
| -rw-r--r-- | util/data/msgparse.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/util/data/msgparse.c b/util/data/msgparse.c index 6963d850171e..afbcbca5bc9d 100644 --- a/util/data/msgparse.c +++ b/util/data/msgparse.c @@ -1361,3 +1361,15 @@ msgparse_rrset_remove_rr(const char* str, sldns_buffer* pkt, struct rrset_parse* * the rr->next works fine to continue. */ return rrset->rr_count == 0; } + +#ifdef UNBOUND_DEBUG +time_t debug_expired_reply_ttl_calc(time_t ttl, time_t ttl_add) { + /* Check that we are serving expired when this is called */ + /* ttl (absolute) should be later than ttl_add */ + /* It is also called during the grace period for type DNAME, + * and then the 'SERVE_EXPIRED' boolean may not be on. */ + log_assert(ttl_add <= ttl); + return (SERVE_EXPIRED_REPLY_TTL < (ttl) - (ttl_add) ? + SERVE_EXPIRED_REPLY_TTL : (ttl) - (ttl_add)); +} +#endif |
