Skip to content

Commit

Permalink
Merge pull request traviscross#41 from aquerubin/master
Browse files Browse the repository at this point in the history
Restore the resolver query order to their relative position in resolv.conf
  • Loading branch information
rewolff committed Jan 29, 2014
2 parents 99dbe3f + a3924d4 commit b46c559
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
Mike Simons <[email protected]>
Aaron Scarisbrick
Craig Milo Rogers <[email protected]>
Antonio Querubin <tony@aloha.net>
Antonio Querubin <tony@lavanauts.org>
Russell Nelson <[email protected]>
Davin Milun
Josh Martin <[email protected]>
Expand Down
14 changes: 5 additions & 9 deletions dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@

#ifdef ENABLE_IPV6
#ifdef __GLIBC__
#define NSCOUNT6 myres._u._ext.nscount6
#define NSSOCKADDR6(i) (myres._u._ext.nsaddrs[i])
#else
#define NSCOUNT6 myres.nscount
#define NSSOCKADDR6(i) (&(myres._u._ext.ext->nsaddrs[i].sin6))
#endif
#endif
Expand Down Expand Up @@ -937,21 +935,19 @@ void dorequest(char *s,int type,word id)
}
hp = (packetheader *)buf;
hp->id = id; /* htons() deliberately left out (redundant) */
for (i = 0;i < myres.nscount;i++)
if (myres.nsaddr_list[i].sin_family == AF_INET)
(void)sendto(resfd,buf,r,0,(struct sockaddr *)&myres.nsaddr_list[i],
sizeof(struct sockaddr));
#ifdef ENABLE_IPV6
if (resfd6 > 0) {
for (i = 0;i < myres.nscount;i++) {
else if (resfd6 > 0) {
if (!NSSOCKADDR6(i))
continue;
if (NSSOCKADDR6(i)->sin6_family == AF_INET6)
(void)sendto(resfd6,buf,r,0,(struct sockaddr *) NSSOCKADDR6(i),
sizeof(struct sockaddr_in6));
}
}
#endif
for (i = 0;i < myres.nscount;i++)
if (myres.nsaddr_list[i].sin_family == AF_INET)
(void)sendto(resfd,buf,r,0,(struct sockaddr *)&myres.nsaddr_list[i],
sizeof(struct sockaddr));
}

void resendrequest(struct resolve *rp,int type)
Expand Down

0 comments on commit b46c559

Please sign in to comment.