From: Wouter Wijngaards Date: Wed, 13 Jun 2007 14:47:01 +0000 (+0000) Subject: addr fixup. X-Git-Tag: release-0.4~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=526496a860ec55373d55ee519b5a928cb8cb8965;p=thirdparty%2Funbound.git addr fixup. git-svn-id: file:///svn/unbound/trunk@387 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 273a2cdf2..21bf25977 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -3,6 +3,8 @@ ldns and libevent are linked statically. Default is off. - make install and make uninstall. Works with static-exe and without. installation of unbound binary and manual pages. + - alignement problem fix on solaris 64. + - fixup address in case of TCP error. 12 June 2007: Wouter - num target queries was set to 0 at a bad time. Default it to 0 and diff --git a/services/outside_network.c b/services/outside_network.c index c0f2c1e74..cd2170246 100644 --- a/services/outside_network.c +++ b/services/outside_network.c @@ -1006,6 +1006,7 @@ serviced_tcp_callback(struct comm_point* c, void* arg, int error, struct comm_reply* rep) { struct serviced_query* sq = (struct serviced_query*)arg; + struct comm_reply r2; sq->pending = NULL; /* removed after this callback */ if(error==NETEVENT_NOERROR && LDNS_RCODE_WIRE(ldns_buffer_begin( c->buffer)) == LDNS_RCODE_FORMERR && @@ -1018,6 +1019,11 @@ serviced_tcp_callback(struct comm_point* c, void* arg, int error, return 0; } /* insert address into reply info */ + if(!rep) { + /* create one if there isn't (on errors) */ + rep = &r2; + r2.c = c; + } memcpy(&rep->addr, &sq->addr, sq->addrlen); rep->addrlen = sq->addrlen; (void)rbtree_delete(sq->outnet->serviced, sq);