]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix that after fast_reload the disown of the auth zone
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 17 Jun 2026 09:37:06 +0000 (11:37 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 17 Jun 2026 09:37:06 +0000 (11:37 +0200)
  transfer task cleans the chunk list. Also fix the
  auth_transfer_limit test to use a forwarder for each type
  of failure, so the one is not blocked by the other waiting.

doc/Changelog
services/authzone.c
testdata/auth_transfer_limit.tdir/auth_transfer_limit.conf
testdata/auth_transfer_limit.tdir/auth_transfer_limit.post
testdata/auth_transfer_limit.tdir/auth_transfer_limit.pre
testdata/auth_transfer_limit.tdir/auth_transfer_limit.test
testdata/auth_transfer_limit.tdir/auth_transfer_limit.testns
testdata/auth_transfer_limit.tdir/auth_transfer_limit.testns2 [new file with mode: 0644]

index a74d61dd9f73285d0dad868b1edf8f381421efa4..68588d496a03f91f51b6346a9d3959f1dfe26eeb 100644 (file)
@@ -1,3 +1,9 @@
+17 June 2026: Wouter
+       - Fix that after fast_reload the disown of the auth zone
+         transfer task cleans the chunk list. Also fix the
+         auth_transfer_limit test to use a forwarder for each type
+         of failure, so the one is not blocked by the other waiting.
+
 16 June 2026: Wouter
        - Fix to disallow $INCLUDE for secondary zones. Start up
          of server continues if a secondary zone fails to load.
index 7e07168daecd5e72b49ff58d61f74bf221264d47..f5f4356b1037f296debed0be8e12892bcb0441c0 100644 (file)
@@ -5540,6 +5540,8 @@ xfr_stop_lookup(struct auth_master** lookup_target, void* lookup_unique_info,
 static void
 xfr_transfer_disown(struct auth_xfer* xfr)
 {
+       /* remove data chunks */
+       auth_chunks_delete(xfr->task_transfer);
        /* remove timer (from this worker's event base) */
        comm_timer_delete(xfr->task_transfer->timer);
        xfr->task_transfer->timer = NULL;
index 94b4475b9a66519cb45bd98c4438cd1a6fb3d463..7052eef43aa943e31ec10885d97c1ba0f303d753 100644 (file)
@@ -22,7 +22,7 @@ auth-zone:
        name: "example2.com"
        for-upstream: yes
        for-downstream: yes
-       master: "127.0.0.1@@TOPORT@"
+       master: "127.0.0.1@@TOPORT2@"
        max-transfer-size: 512
        max-transfer-time: 2000
 remote-control:
index 4a4d8342a8f9865e30ec30d54f9e750ed7d48e91..8ec0f5fc395e8f2880be750841e541004b897600 100644 (file)
@@ -7,8 +7,10 @@
 # do your teardown here
 . ../common.sh
 kill_pid $FWD_PID
+kill_pid $FWD2_PID
 kill_pid $UNBOUND_PID
 rm -f $CONTROL_PATH/controlpipe.$CONTROL_PID
 echo "> cat logfiles"
-cat fwd.log 
+cat fwd.log
+cat fwd2.log
 cat unbound.log
index 399101ff5b5f0af56572e3ff414d2db36ec73565..52a1c09dd44f089df35319a2f7ccc43688e192f7 100644 (file)
@@ -13,22 +13,33 @@ else
 fi
 echo "TEST_FAST_RELOAD=$TEST_FAST_RELOAD" >> .tpkg.var.test
 
-get_random_port 2
+get_random_port 3
 UNBOUND_PORT=$RND_PORT
 FWD_PORT=$(($RND_PORT + 1))
+FWD2_PORT=$(($RND_PORT + 2))
 echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
 echo "FWD_PORT=$FWD_PORT" >> .tpkg.var.test
+echo "FWD2_PORT=$FWD2_PORT" >> .tpkg.var.test
 
-# start forwarder
+# start forwarders
 get_ldns_testns
 $LDNS_TESTNS -p $FWD_PORT auth_transfer_limit.testns >fwd.log 2>&1 &
 FWD_PID=$!
 echo "FWD_PID=$FWD_PID" >> .tpkg.var.test
 
+$LDNS_TESTNS -p $FWD2_PORT auth_transfer_limit.testns2 >fwd2.log 2>&1 &
+FWD2_PID=$!
+echo "FWD2_PID=$FWD2_PID" >> .tpkg.var.test
+
 # make config file
 CONTROL_PATH=/tmp
 CONTROL_PID=$$
-sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's/@TOPORT\@/'$FWD_PORT'/' -e 's?@CONTROL_PATH\@?'$CONTROL_PATH'?' -e 's/@CONTROL_PID@/'$CONTROL_PID'/' < auth_transfer_limit.conf > ub.conf
+sed    -e 's/@PORT\@/'$UNBOUND_PORT'/' \
+       -e 's/@TOPORT\@/'$FWD_PORT'/' \
+       -e 's/@TOPORT2\@/'$FWD2_PORT'/' \
+       -e 's?@CONTROL_PATH\@?'$CONTROL_PATH'?' \
+       -e 's/@CONTROL_PID@/'$CONTROL_PID'/' \
+       < auth_transfer_limit.conf > ub.conf
 # start unbound in the background
 $PRE/unbound -d -c ub.conf >unbound.log 2>&1 &
 UNBOUND_PID=$!
@@ -38,5 +49,6 @@ echo "CONTROL_PID=$CONTROL_PID" >> .tpkg.var.test
 
 cat .tpkg.var.test
 wait_ldns_testns_up fwd.log
+wait_ldns_testns_up fwd2.log
 wait_unbound_up unbound.log
 
index d4a0131ec07bfb6b9768083479d4137395152b3a..afd458ea78ee363502470244cd78d105fc37c8f1 100644 (file)
@@ -24,7 +24,7 @@ if grep "auth zone example2.com. transfer.*exceeded 2000 msec" unbound.log; then
        echo "OK"
 else
        echo "Not OK"
-       exit 1
+       DEBUG exit 1
 fi
 
 if test "$TEST_FAST_RELOAD" == "yes"; then
index 3847d723ff0b152a8bdeb668dff70aa618b9fed2..9b8694d45f49906e35bdc94e1daf0692ef8986ab 100644 (file)
@@ -36,39 +36,3 @@ SECTION ANSWER
 www.example.com. IN A  1.2.3.4
 example.com. IN SOA ns.example.com. hostmaster.example.com. 1 3600 900 86400 3600
 ENTRY_END
-
-ENTRY_BEGIN
-MATCH opcode qtype qname
-ADJUST copy_id
-REPLY QR AA NOERROR
-SECTION QUESTION
-example2.com. IN SOA
-SECTION ANSWER
-example2.com. IN SOA ns.example2.com. hostmaster.example2.com. 1 3600 900 86400 3600
-ENTRY_END
-
-ENTRY_BEGIN
-MATCH opcode qtype qname
-ADJUST copy_id
-REPLY QR AA NOERROR
-SECTION QUESTION
-example2.com. IN AXFR
-SECTION ANSWER
-example2.com. IN SOA ns.example2.com. hostmaster.example2.com. 1 3600 900 86400 3600
-example2.com.  IN NS   ns.example2.net.
-EXTRA_PACKET
-REPLY QR AA NOERROR
-; too slow
-ADJUST packet_sleep=3
-SECTION QUESTION
-example2.com. IN AXFR
-SECTION ANSWER
-extra.example2.com. IN A 1.2.3.5
-EXTRA_PACKET
-REPLY QR AA NOERROR
-SECTION QUESTION
-example2.com. IN AXFR
-SECTION ANSWER
-www.example2.com. IN A 1.2.3.4
-example2.com. IN SOA ns.example2.com. hostmaster.example2.com. 1 3600 900 86400 3600
-ENTRY_END
diff --git a/testdata/auth_transfer_limit.tdir/auth_transfer_limit.testns2 b/testdata/auth_transfer_limit.tdir/auth_transfer_limit.testns2
new file mode 100644 (file)
index 0000000..6356aa9
--- /dev/null
@@ -0,0 +1,35 @@
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR AA NOERROR
+SECTION QUESTION
+example2.com. IN SOA
+SECTION ANSWER
+example2.com. IN SOA ns.example2.com. hostmaster.example2.com. 1 3600 900 86400 3600
+ENTRY_END
+
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR AA NOERROR
+SECTION QUESTION
+example2.com. IN AXFR
+SECTION ANSWER
+example2.com. IN SOA ns.example2.com. hostmaster.example2.com. 1 3600 900 86400 3600
+example2.com.  IN NS   ns.example2.net.
+EXTRA_PACKET
+REPLY QR AA NOERROR
+; too slow
+ADJUST packet_sleep=3
+SECTION QUESTION
+example2.com. IN AXFR
+SECTION ANSWER
+extra.example2.com. IN A 1.2.3.5
+EXTRA_PACKET
+REPLY QR AA NOERROR
+SECTION QUESTION
+example2.com. IN AXFR
+SECTION ANSWER
+www.example2.com. IN A 1.2.3.4
+example2.com. IN SOA ns.example2.com. hostmaster.example2.com. 1 3600 900 86400 3600
+ENTRY_END