Ernillew / wl500g

Automatically exported from code.google.com/p/wl500g
0 stars 0 forks source link

nslookup returning IPv6 addresses first #309

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. upgrade firmware to r4051 on RT-N16
2. IPv6 is disabled on the router
3. type nslookup
4. 

What is the expected output? What do you see instead?

$ nslookup wl500g-repo.googlecode.com

Server:    xx.xx.xx.xx
Address 1: xx.xx.xx.xx

Name:      wl500g-repo.googlecode.com
Address 1: 2a00:1450:400c:c01::52 bru01m01-in-x52.1e100.net
Address 2: 173.194.67.82 wi-in-f82.1e100.net

What version of the product are you using?

Please provide any additional information below.

wget (and others) will complain about this, as for instance:

$wget http://wl500g-repo.googlecode.com/svn/ipkg/openwrt/Packages

Resolving wl500g-repo.googlecode.com... 2a00:1450:400c:c01::52, 173.194.67.82
Connecting to wl500g-repo.googlecode.com|2a00:1450:400c:c01::52|:80... failed: 
Network is unreachable.
Connecting to wl500g-repo.googlecode.com|173.194.67.82|:80... connected.
--- snip ----

Thus, some apps (as the new ipkg) will not install.

Original issue reported on code.google.com by bmur...@gmail.com on 22 Apr 2012 at 9:32

GoogleCodeExporter commented 9 years ago
Unfortunately, there is no way to change behavior of uClibc resolver at now. 
i.e. there is no glibc's gai.conf equivalence for uClibc.

When uClibc maintainers(or someone else) implement such feature, we will add it 
to our firmware ASAP.

Which nameserver you are using? Public google 8.8.8.8?

Original comment by lly.dev on 22 Apr 2012 at 7:27

GoogleCodeExporter commented 9 years ago
I was using the ISP's DNS server.
Your question gave me an idea and I changed the DNS to Google's 8.8.8.8. After 
that the nslookup was returning only IPv4 addresses and I was able to install 
the opkg system.

Nevertheless, the problems started with r4051 on my RT-N16 and caused quite a 
few apps (transmission) & commands (ping) to suddenly stop working.

With the IPv6 disabled the system should in my opinion discard any IPv6 
addresses returned from DNS.

Original comment by bmur...@gmail.com on 24 Apr 2012 at 4:40

GoogleCodeExporter commented 9 years ago
Nothing should be changed in case you rollback to r3702 or older build.

Domain names resolving service provided by uClibc, and there is no control "on 
the fly" at this moment if IPv6 was turned on at compile time.

Original comment by lly.dev on 24 Apr 2012 at 6:22

GoogleCodeExporter commented 9 years ago
Unfortunately, default IPv6, IPv4 sequence hard-coded in uClibc's gaih_inet() 
function.

We or uClibc maintainers(best of all) has to implement gai.conf feature, 
probably simplified.

Original comment by lly.dev on 24 Jun 2012 at 6:04

GoogleCodeExporter commented 9 years ago
I'm decide to implement simplest solution - if /etc/gai.conf contains line

 precedence ipv4

getaddrinfo() perform IPv4 query before IPv6 one.
For code size reasons neither full precedence ordering, nor on-line reread of 
modified gai.conf will not be implemented.

Original comment by lly.dev on 26 Jun 2012 at 6:11

GoogleCodeExporter commented 9 years ago
uClibc tiny gai.conf implementation ready in r4427

firmware set getaddrinfo IPv4 first in case of IPv6 disabled("ipv6_proto" 
empty) since r4435

Original comment by lly.dev on 30 Jun 2012 at 9:45