diff options
-rw-r--r-- | networking/nslookup.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/networking/nslookup.c b/networking/nslookup.c index 8a820ce37..26287114c 100644 --- a/networking/nslookup.c +++ b/networking/nslookup.c | |||
@@ -133,14 +133,19 @@ static void set_default_dns(const char *server) | |||
133 | _res.nsaddr_list[0] = lsa->u.sin; | 133 | _res.nsaddr_list[0] = lsa->u.sin; |
134 | } | 134 | } |
135 | #if ENABLE_FEATURE_IPV6 | 135 | #if ENABLE_FEATURE_IPV6 |
136 | // Hoping libc will handle an IPv4 address there too, | 136 | /* Hoped libc can cope with IPv4 address there too. |
137 | // if it so happens that family is indeed AF_INET | 137 | * No such luck, glibc 2.4 segfaults even with IPv6, |
138 | // if (lsa->u.sa.sa_family == AF_INET6) { | 138 | * maybe I misunderstand how to make glibc use IPv6 addr? |
139 | * (uclibc 0.9.31+ should work) */ | ||
140 | if (lsa->u.sa.sa_family == AF_INET6) { | ||
141 | // glibc neither SEGVs nor sends any dgrams with this | ||
142 | // (strace shows no socket ops): | ||
143 | //_res.nscount = 0; | ||
139 | _res._u._ext.nscount = 1; | 144 | _res._u._ext.nscount = 1; |
140 | /* store a pointer to part of malloc'ed lsa */ | 145 | /* store a pointer to part of malloc'ed lsa */ |
141 | _res._u._ext.nsaddrs[0] = &lsa->u.sin6; | 146 | _res._u._ext.nsaddrs[0] = &lsa->u.sin6; |
142 | /* must not free(lsa)! */ | 147 | /* must not free(lsa)! */ |
143 | // } | 148 | } |
144 | #endif | 149 | #endif |
145 | } | 150 | } |
146 | 151 | ||