fix for localhost queries in automatic interface mode.

git-svn-id: file:///svn/unbound/trunk@868 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2008-01-16 12:47:44 +00:00
parent 8343901c0f
commit ac74d176cc
2 changed files with 5 additions and 2 deletions

View 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.

View 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);