From 55670a1e5517e9587171e9f41dc8f3e40b6fcfef Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Nov 2012 07:47:58 +1100 Subject: [PATCH] 3416. [bug] Named could die on shutdown if running with 128 UDP dispatches per interface. [RT #31743] Squashed commit of the following: commit 1a97c755f8496f65024af0f634c1acf59a0a4252 Author: Mark Andrews Date: Wed Nov 7 07:14:36 2012 +1100 add regression test for RT31743 commit 7b16b5f77fad39478168aac25742823f2fcd825b Author: Mark Andrews Date: Fri Nov 2 23:57:24 2012 +1100 array bounds error when shutting down interface --- CHANGES | 3 +++ bin/named/interfacemgr.c | 2 +- bin/tests/system/resolver/ns7/named.args | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 7a0dc97785..ce8ebbcaff 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +3416. [bug] Named could die on shutdown if running with 128 UDP + dispatches per interface. [RT #31743] + 3415. [bug] named could die with a REQUIRE failure if a valdation was canceled. [RT #31804] diff --git a/bin/named/interfacemgr.c b/bin/named/interfacemgr.c index d632ae92e7..f8f8c4dd9e 100644 --- a/bin/named/interfacemgr.c +++ b/bin/named/interfacemgr.c @@ -426,7 +426,7 @@ ns_interface_destroy(ns_interface_t *ifp) { ns_interface_shutdown(ifp); - for (disp = ifp->nudpdispatch; disp >= 0; disp--) + for (disp = 0; disp < ifp->nudpdispatch; disp++) if (ifp->udpdispatch[disp] != NULL) { dns_dispatch_changeattributes(ifp->udpdispatch[disp], 0, DNS_DISPATCHATTR_NOLISTEN); diff --git a/bin/tests/system/resolver/ns7/named.args b/bin/tests/system/resolver/ns7/named.args index e4eeccb54c..62217db511 100644 --- a/bin/tests/system/resolver/ns7/named.args +++ b/bin/tests/system/resolver/ns7/named.args @@ -1,2 +1,3 @@ # this server runs named with the "-T clienttest" option omitted --m record,size,mctx -c named.conf -d 99 -g +# this server runs named with "-n 128 -U 128" as a regression test for RT31743 +-m record,size,mctx -c named.conf -d 99 -g -n 128 -U 128