|
|
147e83 |
Related upstream commit (this bug has been fixed upstream in a
|
|
|
147e83 |
different way):
|
|
|
147e83 |
|
|
|
147e83 |
commit 2212c1420c92a33b0e0bd9a34938c9814a56c0f7
|
|
|
147e83 |
Author: Andreas Schwab <schwab@suse.de>
|
|
|
147e83 |
Date: Thu Feb 19 15:52:08 2015 +0100
|
|
|
147e83 |
|
|
|
147e83 |
Simplify handling of nameserver configuration in resolver
|
|
|
147e83 |
|
|
|
147e83 |
Remove use of ext.nsmap member of struct __res_state and always use
|
|
|
147e83 |
an identity mapping betwen the nsaddr_list array and the ext.nsaddrs
|
|
|
147e83 |
array. The fact that a nameserver has an IPv6 address is signalled by
|
|
|
147e83 |
setting nsaddr_list[].sin_family to zero.
|
|
|
147e83 |
|
|
|
147e83 |
diff -rup glibc-2.17-c758a686/resolv/res_init.c glibc-2.17-c758a686/resolv/res_init.c
|
|
|
147e83 |
--- glibc-2.17-c758a686/resolv/res_init.c 2012-07-26 15:10:45.655638776 -0600
|
|
|
147e83 |
+++ glibc-2.17-c758a686/resolv/res_init.c 2012-07-26 15:11:27.731423002 -0600
|
|
|
147e83 |
@@ -314,9 +314,9 @@ __res_vinit(res_state statp, int preinit
|
|
|
147e83 |
cp++;
|
|
|
147e83 |
if ((*cp != '\0') && (*cp != '\n')
|
|
|
147e83 |
&& __inet_aton(cp, &a)) {
|
|
|
147e83 |
- statp->nsaddr_list[nservall].sin_addr = a;
|
|
|
147e83 |
- statp->nsaddr_list[nservall].sin_family = AF_INET;
|
|
|
147e83 |
- statp->nsaddr_list[nservall].sin_port =
|
|
|
147e83 |
+ statp->nsaddr_list[nserv].sin_addr = a;
|
|
|
147e83 |
+ statp->nsaddr_list[nserv].sin_family = AF_INET;
|
|
|
147e83 |
+ statp->nsaddr_list[nserv].sin_port =
|
|
|
147e83 |
htons(NAMESERVER_PORT);
|
|
|
147e83 |
nserv++;
|
|
|
147e83 |
#ifdef _LIBC
|
|
|
147e83 |
diff -rup glibc-2.17-c758a686/resolv/res_send.c glibc-2.17-c758a686/resolv/res_send.c
|
|
|
147e83 |
--- glibc-2.17-c758a686/resolv/res_send.c 2010-05-04 05:27:23.000000000 -0600
|
|
|
147e83 |
+++ glibc-2.17-c758a686/resolv/res_send.c 2012-07-26 15:34:58.398261659 -0600
|
|
|
147e83 |
@@ -421,10 +421,10 @@ __libc_res_nsend(res_state statp, const
|
|
|
147e83 |
EXT(statp).nsmap[n] = MAXNS;
|
|
|
147e83 |
}
|
|
|
147e83 |
}
|
|
|
147e83 |
- n = statp->nscount;
|
|
|
147e83 |
- if (statp->nscount > EXT(statp).nscount)
|
|
|
147e83 |
+ n = statp->nscount - EXT(statp).nscount6;
|
|
|
147e83 |
+ if (n > EXT(statp).nscount)
|
|
|
147e83 |
for (n = EXT(statp).nscount, ns = 0;
|
|
|
147e83 |
- n < statp->nscount; n++) {
|
|
|
147e83 |
+ n < statp->nscount - EXT(statp).nscount6; n++) {
|
|
|
147e83 |
while (ns < MAXNS
|
|
|
147e83 |
&& EXT(statp).nsmap[ns] != MAXNS)
|
|
|
147e83 |
ns++;
|
|
|
147e83 |
@@ -441,7 +441,7 @@ __libc_res_nsend(res_state statp, const
|
|
|
147e83 |
malloc(sizeof (struct sockaddr_in6));
|
|
|
147e83 |
if (EXT(statp).nsaddrs[n] != NULL) {
|
|
|
147e83 |
memset (mempcpy(EXT(statp).nsaddrs[n],
|
|
|
147e83 |
- &statp->nsaddr_list[n],
|
|
|
147e83 |
+ &statp->nsaddr_list[ns],
|
|
|
147e83 |
sizeof (struct sockaddr_in)),
|
|
|
147e83 |
'\0',
|
|
|
147e83 |
sizeof (struct sockaddr_in6)
|