]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
fix for localhost queries in automatic interface mode.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 16 Jan 2008 12:47:44 +0000 (12:47 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 16 Jan 2008 12:47:44 +0000 (12:47 +0000)
git-svn-id: file:///svn/unbound/trunk@868 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
util/netevent.c

index fbcf5941b62f03d9dab3085dbe5f7a2620f055de..48159808c7656554362a118c9852b7600edcef11 100644 (file)
@@ -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.
index a349e4a6dd1a080678547e66009464e64abbe4d8..c1c9210f44f7476187d25562e97ed505d7ab83d8 100644 (file)
@@ -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);