Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/apache2/mDNSResponder/dist/mDNSPosix Add support fo...
details: https://anonhg.NetBSD.org/src/rev/50d9d91a1f19
branches: trunk
changeset: 341050:50d9d91a1f19
user: roy <roy%NetBSD.org@localhost>
date: Thu Oct 15 16:14:40 2015 +0000
description:
Add support for parsing IPv6 nameservers found in resolv.conf.
Fixes PR bin/42196.
diffstat:
external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diffs (33 lines):
diff -r b70ace0b8724 -r 50d9d91a1f19 external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c
--- a/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c Thu Oct 15 15:58:34 2015 +0000
+++ b/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c Thu Oct 15 16:14:40 2015 +0000
@@ -494,10 +494,11 @@
while (fgets(line,sizeof(line),fp))
{
struct in_addr ina;
+ struct in6_addr ina6;
line[255]='\0'; // just to be safe
if (sscanf(line,"%10s %15s", keyword, nameserver) != 2) continue; // it will skip whitespaces
if (strncasecmp(keyword,"nameserver",10)) continue;
- if (inet_aton(nameserver, (struct in_addr *)&ina) != 0)
+ if (inet_pton(AF_INET, nameserver, &ina) == 1)
{
mDNSAddr DNSAddr;
DNSAddr.type = mDNSAddrType_IPv4;
@@ -505,7 +506,15 @@
mDNS_AddDNSServer(m, NULL, mDNSInterface_Any, &DNSAddr, UnicastDNSPort, mDNSfalse, 0);
numOfServers++;
}
- }
+ else if (inet_pton(AF_INET6, nameserver, &ina6) == 1)
+ {
+ mDNSAddr DNSAddr;
+ DNSAddr.type = mDNSAddrType_IPv6;
+ DNSAddr.ip.v6 = *(mDNSv6Addr *)&ina6;
+ mDNS_AddDNSServer(m, NULL, mDNSInterface_Any, &DNSAddr, UnicastDNSPort, mDNSfalse, 0);
+ numOfServers++;
+ }
+ }
fclose(fp);
return (numOfServers > 0) ? 0 : -1;
}
Home |
Main Index |
Thread Index |
Old Index