From: Wouter Wijngaards Date: Wed, 16 Jan 2008 12:47:44 +0000 (+0000) Subject: fix for localhost queries in automatic interface mode. X-Git-Tag: release-0.9~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac74d176cc242b857c47f98786f895ce0f2116f0;p=thirdparty%2Funbound.git fix for localhost queries in automatic interface mode. git-svn-id: file:///svn/unbound/trunk@868 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index fbcf5941b..48159808c 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,5 +1,8 @@ 16 January 2008: Wouter - incoming queries to the server with TC bit on are replied FORMERR. + - interface-automatic replied the wrong source address on localhost + queries. Seems to be due to ifnum=0 in recvmsg PKTINFO. Trying + to use ifnum=-1 to mean 'no interface, use kernel route'. 15 January 2008: Wouter - interface-automatic feature. experimental. Nice for anycast. diff --git a/util/netevent.c b/util/netevent.c index a349e4a6d..c1c9210f4 100644 --- a/util/netevent.c +++ b/util/netevent.c @@ -330,7 +330,7 @@ comm_point_udp_callback(int fd, short event, void* arg) } ldns_buffer_skip(rep.c->buffer, recv); ldns_buffer_flip(rep.c->buffer); - rep.ifnum = 0; + rep.ifnum = -1; log_assert(fptr_whitelist_comm_point(rep.c->callback)); if((*rep.c->callback)(rep.c, rep.c->cb_arg, NETEVENT_NOERROR, &rep)) { /* send back immediate reply */ @@ -1004,7 +1004,7 @@ comm_point_send_reply(struct comm_reply *repinfo) { log_assert(repinfo && repinfo->c); if(repinfo->c->type == comm_udp) { - if(repinfo->ifnum) + if(repinfo->ifnum != -1) comm_point_send_udp_msg_if(repinfo->c, repinfo->c->buffer, (struct sockaddr*)&repinfo->addr, repinfo->addrlen, repinfo->ifnum);