From: Wouter Wijngaards Date: Mon, 4 Aug 2008 12:43:00 +0000 (+0000) Subject: fix bug #201 from trunk , and iana port update. X-Git-Tag: release-1.0.2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e31c9620b162ecbc40be8d5ac8ee2c0e1997a819;p=thirdparty%2Funbound.git fix bug #201 from trunk , and iana port update. git-svn-id: file:///svn/unbound/branches/support-1.0@1174 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 16dbf0feb..eaa2ead21 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +4 August 2008: Wouter + - Bug #201 fixup from trunk; fixes segfault on exit cleanup + - iana port nrs updated. + 30 July 2008: Wouter - fixup DS qtype validation bug. (fix taken from trunk). diff --git a/services/outside_network.c b/services/outside_network.c index 9b1cf8159..a7244e8e6 100644 --- a/services/outside_network.c +++ b/services/outside_network.c @@ -668,6 +668,23 @@ pending_delete(struct outside_network* outnet, struct pending* p) { if(!p) return; + if(outnet && outnet->udp_wait_first && + (p->next_waiting || p == outnet->udp_wait_last) ) { + /* delete from waiting list, if it is in the waiting list */ + struct pending* prev = NULL, *x = outnet->udp_wait_first; + while(x && x != p) { + prev = x; + x = x->next_waiting; + } + if(x) { + log_assert(x == p); + if(prev) + prev->next_waiting = p->next_waiting; + else outnet->udp_wait_first = p->next_waiting; + if(outnet->udp_wait_last == p) + outnet->udp_wait_last = prev; + } + } if(outnet) { (void)rbtree_delete(outnet->pending, p->node.key); } @@ -1067,7 +1084,8 @@ serviced_delete(struct serviced_query* sq) if(sq->status == serviced_query_UDP_EDNS || sq->status == serviced_query_UDP) { struct pending* p = (struct pending*)sq->pending; - portcomm_loweruse(sq->outnet, p->pc); + if(p->pc) + portcomm_loweruse(sq->outnet, p->pc); pending_delete(sq->outnet, p); outnet_send_wait_udp(sq->outnet); } else { diff --git a/util/iana_ports.inc b/util/iana_ports.inc index ae9c8a967..3c41790f8 100644 --- a/util/iana_ports.inc +++ b/util/iana_ports.inc @@ -5044,6 +5044,7 @@ 24249, 24321, 24386, +24465, 24554, 24677, 24678,