]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Get ready for the DNS flag day: remove EDNS lame procedure, do not re-query
authorRalph Dolmans <ralph@nlnetlabs.nl>
Wed, 16 Jan 2019 10:23:13 +0000 (10:23 +0000)
committerRalph Dolmans <ralph@nlnetlabs.nl>
Wed, 16 Jan 2019 10:23:13 +0000 (10:23 +0000)
  without EDNS after timeout.

git-svn-id: file:///svn/unbound/trunk@5037 be551aaa-1e26-0410-a405-d3ace91eadb9

13 files changed:
doc/Changelog
services/outside_network.c
services/outside_network.h
testdata/edns_cache.tdir/edns_cache.conf
testdata/edns_cache.tdir/edns_cache.stub1
testdata/edns_cache.tdir/edns_cache.stub2
testdata/edns_cache.tdir/edns_cache.test
testdata/edns_lame.tdir/edns_lame.conf [deleted file]
testdata/edns_lame.tdir/edns_lame.dsc [deleted file]
testdata/edns_lame.tdir/edns_lame.post [deleted file]
testdata/edns_lame.tdir/edns_lame.pre [deleted file]
testdata/edns_lame.tdir/edns_lame.test [deleted file]
testdata/edns_lame.tdir/edns_lame.testns [deleted file]

index 04cd0461eb30389791099ca60271741d671a7eba..faae871b2a7f63349604434b8d5ea30ae89d7781 100644 (file)
@@ -1,3 +1,7 @@
+16 January 2018: Ralph
+       - Get ready for the DNS flag day: remove EDNS lame procedure, do not
+         re-query without EDNS after timeout.
+
 15 January 2018: Wouter
        - In the out of order processing, reset byte count for (potential)
          partial read.
index 1badb5116637332a3b23a70a9d9f30a41aec6265..8ed5de375852406a9b7cae0f0334c1fba541e743 100644 (file)
@@ -1506,7 +1506,6 @@ serviced_delete(struct serviced_query* sq)
                /* clear up the pending query */
                if(sq->status == serviced_query_UDP_EDNS ||
                        sq->status == serviced_query_UDP ||
-                       sq->status == serviced_query_PROBE_EDNS ||
                        sq->status == serviced_query_UDP_EDNS_FRAG ||
                        sq->status == serviced_query_UDP_EDNS_fallback) {
                        struct pending* p = (struct pending*)sq->pending;
@@ -1633,15 +1632,7 @@ serviced_udp_send(struct serviced_query* sq, sldns_buffer* buff)
        sq->last_rtt = rtt;
        verbose(VERB_ALGO, "EDNS lookup known=%d vs=%d", edns_lame_known, vs);
        if(sq->status == serviced_initial) {
-               if(edns_lame_known == 0 && rtt > 5000 && rtt < 10001) {
-                       /* perform EDNS lame probe - check if server is
-                        * EDNS lame (EDNS queries to it are dropped) */
-                       verbose(VERB_ALGO, "serviced query: send probe to see "
-                               " if use of EDNS causes timeouts");
-                       /* even 700 msec may be too small */
-                       rtt = 1000;
-                       sq->status = serviced_query_PROBE_EDNS;
-               } else if(vs != -1) {
+               if(vs != -1) {
                        sq->status = serviced_query_UDP_EDNS;
                } else {        
                        sq->status = serviced_query_UDP; 
@@ -1978,12 +1969,6 @@ serviced_udp_callback(struct comm_point* c, void* arg, int error,
        sq->pending = NULL; /* removed after callback */
        if(error == NETEVENT_TIMEOUT) {
                int rto = 0;
-               if(sq->status == serviced_query_PROBE_EDNS) {
-                       /* non-EDNS probe failed; we do not know its status,
-                        * keep trying with EDNS, timeout may not be caused
-                        * by EDNS. */
-                       sq->status = serviced_query_UDP_EDNS;
-               }
                if(sq->status == serviced_query_UDP_EDNS && sq->last_rtt < 5000) {
                        /* fallback to 1480/1280 */
                        sq->status = serviced_query_UDP_EDNS_FRAG;
@@ -2047,18 +2032,6 @@ serviced_udp_callback(struct comm_point* c, void* arg, int error,
                        serviced_callbacks(sq, NETEVENT_CLOSED, c, rep);
                }
                return 0;
-           } else if(sq->status == serviced_query_PROBE_EDNS) {
-               /* probe without EDNS succeeds, so we conclude that this
-                * host likely has EDNS packets dropped */
-               log_addr(VERB_DETAIL, "timeouts, concluded that connection to "
-                       "host drops EDNS packets", &sq->addr, sq->addrlen);
-               /* only store noEDNS in cache if domain is noDNSSEC */
-               if(!sq->want_dnssec)
-                 if(!infra_edns_update(outnet->infra, &sq->addr, sq->addrlen,
-                       sq->zone, sq->zonelen, -1, (time_t)now.tv_sec)) {
-                       log_err("Out of memory caching no edns for host");
-                 }
-               sq->status = serviced_query_UDP;
            } else if(sq->status == serviced_query_UDP_EDNS && 
                !sq->edns_lame_known) {
                /* now we know that edns queries received answers store that */
@@ -2539,7 +2512,6 @@ serviced_get_mem(struct serviced_query* sq)
                s += sizeof(*sb);
        if(sq->status == serviced_query_UDP_EDNS ||
                sq->status == serviced_query_UDP ||
-               sq->status == serviced_query_PROBE_EDNS ||
                sq->status == serviced_query_UDP_EDNS_FRAG ||
                sq->status == serviced_query_UDP_EDNS_fallback) {
                s += sizeof(struct pending);
index 01a307417eace7ca703482af9dc41f903eb88e04..48ef03edba7cec2771248c544ca6485908038c47 100644 (file)
@@ -359,8 +359,6 @@ struct serviced_query {
                serviced_query_TCP_EDNS,
                /** TCP without EDNS sent */
                serviced_query_TCP,
-               /** probe to test EDNS lameness (EDNS is dropped) */
-               serviced_query_PROBE_EDNS,
                /** probe to test noEDNS0 (EDNS gives FORMERRorNOTIMP) */
                serviced_query_UDP_EDNS_fallback,
                /** probe to test TCP noEDNS0 (EDNS gives FORMERRorNOTIMP) */
index 101b9751ffc62fbe8a8520ce55463fb459ed19a6..baeee5f54f2ce801c9b95f839784ed0134d68040 100644 (file)
@@ -12,9 +12,6 @@ server:
 stub-zone:
        name: "example.net"
        stub-addr: "127.0.0.1@@STUB2_PORT@"
-stub-zone:
-       name: "example.com"
-       stub-addr: "127.0.0.1@@STUB2_PORT@"
 # a k a root hints
 stub-zone:
        name: "."
index 23653c3b3d5347170a45bd70597d6236c839a358..2cce1bd656ad3cc38a2d433b840b291956bf5125 100644 (file)
@@ -17,17 +17,6 @@ SECTION ADDITIONAL
 root.server.   IN      A       127.0.0.1
 ENTRY_END
 
-; referral to example.com
-ENTRY_BEGIN
-MATCH opcode subdomain
-REPLY QR NOERROR
-ADJUST copy_id copy_query
-SECTION QUESTION
-example.com.   IN      A
-SECTION AUTHORITY
-example.com.   IN      NS      netdns.example.net.
-ENTRY_END
-
 ; referral to example.net
 ENTRY_BEGIN
 MATCH opcode subdomain
index f70eb98e74565b24ef2358f7497658b8ea67f9a0..549560aa0f4c1cfe95f29277f1fbe1fc26349d67 100644 (file)
@@ -1,5 +1,5 @@
 ; nameserver test file
-$ORIGIN example.com.
+$ORIGIN example.net.
 $TTL 3600
 
 ENTRY_BEGIN
@@ -7,9 +7,9 @@ MATCH opcode qtype qname noedns
 REPLY QR AA NOERROR
 ADJUST copy_id
 SECTION QUESTION
-www.example.com.       IN      A
+www.example.net.       IN      A
 SECTION ANSWER
-www.example.com.       IN      A       10.20.30.40
+www.example.net.       IN      A       10.20.30.40
 ENTRY_END
 
 ENTRY_BEGIN
index 53931ded2eb70c75abad929a615673e2cc22e72c..d154d5277eac26d387584eb50a4c61e1db0d2645 100644 (file)
@@ -11,8 +11,8 @@ PRE="../.."
 # do the test
 echo "> dig netdns.example.net."
 dig @::1 -p $UNBOUND_PORT netdns.example.net. | tee outfile
-echo "> dig www.example.com."
-dig @::1 -p $UNBOUND_PORT www.example.com. | tee outfile
+echo "> dig www.example.net."
+dig @::1 -p $UNBOUND_PORT www.example.net. | tee outfile
 echo "> cat stub1.log"
 cat stub1.log 
 echo "> cat stub2.log"
diff --git a/testdata/edns_lame.tdir/edns_lame.conf b/testdata/edns_lame.tdir/edns_lame.conf
deleted file mode 100644 (file)
index 9cd19c0..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-server:
-       verbosity: 2
-       # num-threads: 1
-       interface: 127.0.0.1
-       port: @PORT@
-       use-syslog: no
-       directory: ""
-       pidfile: "unbound.pid"
-       chroot: ""
-       username: ""
-       do-not-query-localhost: no
-forward-zone:
-       name: "."
-       forward-addr: "127.0.0.1@@TOPORT@"
-
diff --git a/testdata/edns_lame.tdir/edns_lame.dsc b/testdata/edns_lame.tdir/edns_lame.dsc
deleted file mode 100644 (file)
index 83f9725..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-BaseName: edns_lame
-Version: 1.0
-Description: Forward UDP but EDNS packets time out
-CreationDate: Mon Sep 29 16:39:15 CEST 2008
-Maintainer: dr. W.C.A. Wijngaards
-Category: 
-Component:
-CmdDepends: 
-Depends: 
-Help:
-Pre: edns_lame.pre
-Post: edns_lame.post
-Test: edns_lame.test
-AuxFiles: 
-Passed:
-Failure:
diff --git a/testdata/edns_lame.tdir/edns_lame.post b/testdata/edns_lame.tdir/edns_lame.post
deleted file mode 100644 (file)
index f71e3c4..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-# #-- edns_lame.post --#
-# source the master var file when it's there
-[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
-# source the test var file when it's there
-[ -f .tpkg.var.test ] && source .tpkg.var.test
-#
-# do your teardown here
-. ../common.sh
-kill_pid $FWD_PID
-kill_pid $UNBOUND_PID
diff --git a/testdata/edns_lame.tdir/edns_lame.pre b/testdata/edns_lame.tdir/edns_lame.pre
deleted file mode 100644 (file)
index d8c2c07..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-# #-- edns_lame.pre--#
-# source the master var file when it's there
-[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
-# use .tpkg.var.test for in test variable passing
-[ -f .tpkg.var.test ] && source .tpkg.var.test
-
-. ../common.sh
-get_random_port 2
-UNBOUND_PORT=$RND_PORT
-FWD_PORT=$(($RND_PORT + 1))
-echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
-echo "FWD_PORT=$FWD_PORT" >> .tpkg.var.test
-
-# start forwarder
-get_ldns_testns
-$LDNS_TESTNS -p $FWD_PORT -v edns_lame.testns >fwd.log 2>&1 &
-FWD_PID=$!
-echo "FWD_PID=$FWD_PID" >> .tpkg.var.test
-
-# make config file
-sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's/@TOPORT\@/'$FWD_PORT'/' < edns_lame.conf > ub.conf
-# start unbound in the background
-PRE="../.."
-$PRE/unbound -d -vvvv -c ub.conf >unbound.log 2>&1 &
-UNBOUND_PID=$!
-echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test
-
-cat .tpkg.var.test
-wait_ldns_testns_up fwd.log
-wait_unbound_up unbound.log
diff --git a/testdata/edns_lame.tdir/edns_lame.test b/testdata/edns_lame.tdir/edns_lame.test
deleted file mode 100644 (file)
index 92d6692..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-# #-- edns_lame.test --#
-# source the master var file when it's there
-[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
-# use .tpkg.var.test for in test variable passing
-[ -f .tpkg.var.test ] && source .tpkg.var.test
-
-PRE="../.."
-# do the test
-echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
-echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
-echo "> cat logfiles"
-cat fwd.log 
-cat unbound.log
-echo "> check answer"
-if grep "10.20.30.40" outfile; then
-       echo "OK"
-else
-       echo "Not OK"
-       exit 1
-fi
-
-exit 0
diff --git a/testdata/edns_lame.tdir/edns_lame.testns b/testdata/edns_lame.tdir/edns_lame.testns
deleted file mode 100644 (file)
index cd248c3..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-; nameserver test file
-$ORIGIN example.com.
-$TTL 3600
-
-ENTRY_BEGIN
-MATCH opcode qtype qname noedns
-REPLY QR AA NOERROR
-ADJUST copy_id
-SECTION QUESTION
-www    IN      A
-SECTION ANSWER
-www    IN      A       10.20.30.40
-ENTRY_END
-