summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenis Vlasenko2008-11-17 15:36:36 +0000
committerDenis Vlasenko2008-11-17 15:36:36 +0000
commit249d948e3944eacf380e9ab8704535161d8a6603 (patch)
tree153f5aa85d8321047c72b465416532d0688b19ca /networking
parentde7a52fff2985955d20af266d1a555c6535c3487 (diff)
downloadbusybox-249d948e3944eacf380e9ab8704535161d8a6603.zip
busybox-249d948e3944eacf380e9ab8704535161d8a6603.tar.gz
nslookup: glibc + IPv6 address of DNS server don't mix (yet)
Diffstat (limited to 'networking')
-rw-r--r--networking/nslookup.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/networking/nslookup.c b/networking/nslookup.c
index 8a820ce..2628711 100644
--- a/networking/nslookup.c
+++ b/networking/nslookup.c
@@ -133,14 +133,19 @@ static void set_default_dns(const char *server)
_res.nsaddr_list[0] = lsa->u.sin;
}
#if ENABLE_FEATURE_IPV6
-// Hoping libc will handle an IPv4 address there too,
-// if it so happens that family is indeed AF_INET
-// if (lsa->u.sa.sa_family == AF_INET6) {
+ /* Hoped libc can cope with IPv4 address there too.
+ * No such luck, glibc 2.4 segfaults even with IPv6,
+ * maybe I misunderstand how to make glibc use IPv6 addr?
+ * (uclibc 0.9.31+ should work) */
+ if (lsa->u.sa.sa_family == AF_INET6) {
+ // glibc neither SEGVs nor sends any dgrams with this
+ // (strace shows no socket ops):
+ //_res.nscount = 0;
_res._u._ext.nscount = 1;
/* store a pointer to part of malloc'ed lsa */
_res._u._ext.nsaddrs[0] = &lsa->u.sin6;
/* must not free(lsa)! */
-// }
+ }
#endif
}