diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-17 15:36:36 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-17 15:36:36 +0000 |
commit | 249d948e3944eacf380e9ab8704535161d8a6603 (patch) | |
tree | 153f5aa85d8321047c72b465416532d0688b19ca | |
parent | de7a52fff2985955d20af266d1a555c6535c3487 (diff) | |
download | busybox-w32-249d948e3944eacf380e9ab8704535161d8a6603.tar.gz busybox-w32-249d948e3944eacf380e9ab8704535161d8a6603.tar.bz2 busybox-w32-249d948e3944eacf380e9ab8704535161d8a6603.zip |
nslookup: glibc + IPv6 address of DNS server don't mix (yet)
-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 | ||