]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
cache nitpick: avoid verbose-logging of unitialized TTL
authorVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 7 Aug 2018 11:02:40 +0000 (13:02 +0200)
committerPetr Špaček <petr.spacek@nic.cz>
Tue, 7 Aug 2018 13:08:44 +0000 (15:08 +0200)
Replaced by a visually recognizable dummy value, for simplicity.
These were introduced in commits:
  cache: don't require cached NS for aggresive answers
  cache closest_NS(): factor out the inside of a loop

lib/cache/peek.c

index 16d8e66f5c7e4a4126a0cef50f9701f067bc3e7f..062bf64d43fa9274cf9805826ba2dfaef4054823 100644 (file)
@@ -216,7 +216,7 @@ int peek_nosync(kr_layer_t *ctx, knot_pkt_t *pkt)
        /* Try the NSEC* parameters in order, until success.
         * Let's not mix different parameters for NSEC* RRs in a single proof. */
        for (int i = 0; ;) {
-               int32_t log_new_ttl;
+               int32_t log_new_ttl = -123456789; /* visually recognizable value */
                ret = nsec_p_ttl(el[i], qry, &log_new_ttl);
                if (!ret || VERBOSE_STATUS) {
                        nsec_p_init(&ans.nsec_p, el[i], !ret);
@@ -645,7 +645,7 @@ static int check_NS_entry(const knot_db_val_t entry, const int i, const bool exa
        uint16_t type;
        if (i < ENTRY_APEX_NSECS_CNT) {
                type = KNOT_RRTYPE_NS;
-               int32_t log_new_ttl;
+               int32_t log_new_ttl = -123456789; /* visually recognizable value */
                const int err = nsec_p_ttl(entry, qry, &log_new_ttl);
                if (err) {
                        VERBOSE_MSG(qry,