]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
ttl not greedy.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 30 Oct 2007 21:40:16 +0000 (21:40 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 30 Oct 2007 21:40:16 +0000 (21:40 +0000)
git-svn-id: file:///svn/unbound/trunk@720 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
doc/TODO
services/cache/rrset.c
testcode/fake_event.c
testdata/rrset_rettl.rpl

index f2d7dbe296d42818588bdabf09f92ed224330327..39277b291ff7d886abcec0a68ccffc2d2ecc2682 100644 (file)
@@ -3,6 +3,7 @@
          smaller than uncompressed names. A packet from comrite.com was seen
          to be compressed to a larger size. Added it as unit test.
        - quieter logging at low verbosity level for common tcp messages.
+       - no greedy TTL update.
 
 23 October 2007: Wouter
        - fixup (grand-)parent problem for dnssec-lameness detection.
index 7f6fcf8b74ce909228c598b0682f589d8ec9fece..58d75cafe7a3a98de49612ba2b4326c2edfb09c3 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -52,3 +52,6 @@ o make timeout backoffs randomized (a couple percent random) to spread traffic.
 o inspect date on executable, then warn user in log if its more than 1 year.
 o proactively prime root, stubs and trust anchors, feature.
   early failure, faster on first query, but more traffic.
+o look into whether in incoming message should have RRsets replaced with
+  rrsets from the cache, if the one from the cache is more trusted, or has
+  lower TTL.
index 523d12bc02f884170f91ad1574dc78b2b8a5b3fc..f0cb341d4ecbb86c29fb6abb403fdc83654810e6 100644 (file)
@@ -134,21 +134,6 @@ need_to_update_rrset(void* nd, void* cd, uint32_t timenow, int equal)
         /*      o same trust, but different in data - insert it */
         if( newd->trust == cached->trust && !equal )
                 return 1;
-        /*      o see if TTL is better than TTL in cache. */
-        /*        if so, see if rrset+rdata is the same */
-        /*        if so, update TTL in cache, even if trust is worse. */
-        if( newd->ttl > cached->ttl && equal ) {
-               /* if the cached rrset is bogus, and this one equal,
-                * do not update the TTL - let it expire. */
-               if(cached->security == sec_status_bogus)
-                       return 0;
-               /* since all else is the same, use the best trust value */
-               if(newd->trust < cached->trust) {
-                       newd->trust = cached->trust;
-                       newd->security = cached->security;
-               }
-                return 1;
-       }
         return 0;
 }
 
index 971a027270faa6113c73ba7f4ee160337788721e..ee6d0b86a974e5966c498725ba530d1750de745e 100644 (file)
@@ -396,7 +396,8 @@ fake_pending_callback(struct replay_runtime* runtime,
        repinfo.c = &c;
        repinfo.addrlen = p->addrlen;
        memcpy(&repinfo.addr, &p->addr, p->addrlen);
-       pending_list_delete(runtime, p);
+       if(!p->serviced)
+               pending_list_delete(runtime, p);
        if((*cb)(&c, cb_arg, error, &repinfo)) {
                fatal_exit("unexpected: pending callback returned 1");
        }
index ea9ef0e65c494bece256af0cb8f3bf0603f28e1f..b7e05eb8549943e7f5fe873ab2d9b1fc6889f9ed 100644 (file)
@@ -3,7 +3,7 @@
 forward-zone: name: "." forward-addr: 216.0.0.1
 CONFIG_END
 
-SCENARIO_BEGIN RRset TTL is updated from message.
+SCENARIO_BEGIN RRset TTL is not greedily updated from message.
 
 STEP 1 QUERY
 ENTRY_BEGIN
@@ -90,7 +90,6 @@ ENTRY_BEGIN
        ns.example.com. IN A 10.20.30.50
 ENTRY_END
 
-
 ; original www.example.com query 
 STEP 10 QUERY
 ENTRY_BEGIN
@@ -98,9 +97,10 @@ ENTRY_BEGIN
        SECTION QUESTION
        www.example.com. IN A
 ENTRY_END
+
 ; immediate answer without an OUT_QUERY happening (checked on exit)
 ; also, the answer does not have AA set
-; NS rrset has been updated.
+; NS rrset has not been updated. No greedy TTL has happened.
 STEP 11 CHECK_ANSWER
 ENTRY_BEGIN
        MATCH all ttl
@@ -110,7 +110,7 @@ ENTRY_BEGIN
        SECTION ANSWER
        www.example.com. IN A 10.20.30.40
        SECTION AUTHORITY
-       example.com. 200 IN NS ns.example.com.
+       example.com. 100 IN NS ns.example.com.
        SECTION ADDITIONAL
        ns.example.com. IN A 10.20.30.50
 ENTRY_END