[erlang-questions] : Broken ipv6 behavior?

Raimo Niskanen raimo+erlang-questions@REDACTED
Wed Apr 9 11:04:11 CEST 2008


On Wed, Apr 09, 2008 at 12:52:40AM -0700, Matthew Dempsky wrote:
> On Wed, Apr 9, 2008 at 12:27 AM, Raimo Niskanen
> <raimo+erlang-questions@REDACTED> wrote:
> >  Give us the result of:
> >  $ uname -a
> >  $ cat /etc/resolv.conf
> >  $ erl
> >  1> inet_gethost_native:control({debug_level,4}).
> >  2> inet_gethost_native:gethostbyname("ipv6.google.com", inet6).
> >  3> ets:tab2list(inet_db).
> >  4> ets:tab2list(inet_hosts).
> 
> I'm away from the office right now so I can't test from my OS X
> laptop, but below is the output from an OpenBSD machine and a Linux
> machine there that both demonstrate the same misbehavior.  (If
> necessary, I'll rerun the test tomorrow on OS X.)
> 

That it does not work on new Linuxes is a known issue.
Linux took another path than Solaris and removed the
IPv6 resolver functions inet_gethost_native uses.
And that is something that has been on our todo
list for a long time now. But since no paying customer
needs it it remains a not high enough priority.

These functions seem to work on a MacOS X Leopard box
in our lab, there I get:
inet_gethost_native:gethostbyname("ipv6.google.com", inet6).
inet_gethost[63317] (DEBUG):Saved domainname .google.com.
inet_gethost[63317] (DEBUG):Created worker[63418] with fd 3
inet_gethost[63317] (DEBUG):Saved domainname .google.com.
inet_gethost[63418] (DEBUG):Worker got request, op = 1, proto = 2, data = ipv6.google.com.
{error,notfound}

Not strange since we do not have working IPv6 here at work.

So what is the problem with your MacOS X installation is
what puzzels me.


> 
> matthew@REDACTED:~$ uname -a
> OpenBSD golem.mochimedia.net 4.3 GENERIC.MP#1559 amd64
> 
> matthew@REDACTED:~$ cat /etc/resolv.conf
> search mochimedia.net
> nameserver 127.0.0.1
> 
> matthew@REDACTED:~$ ping6 -c 1 ipv6.google.com
> PING6(56=40+8+8 bytes) 2001:470:1f04:330::2 --> 2001:4860:0:1001::68
> 16 bytes from 2001:4860:0:1001::68, icmp_seq=0 hlim=57 time=174.165 ms
> 
> --- ipv6.l.google.com ping6 statistics ---
> 1 packets transmitted, 1 packets received, 0.0% packet loss
> round-trip min/avg/max/std-dev = 174.165/174.165/174.165/0.000 ms
> 
> matthew@REDACTED:~$ echo '{inet6, true}.' > inetrc
> 
> matthew@REDACTED:~$ erl -kernel inetrc '"./inetrc"'
> Erlang (BEAM) emulator version 5.6.1 [source] [64-bit]
> [async-threads:0] [kernel-poll:false]
> 
> Eshell V5.6.1  (abort with ^G)
> 1> inet_gethost_native:control({debug_level,4}).
> inet_gethost[29369] (DEBUG):debug_level = 4
> ok
> 2> inet_gethost_native:gethostbyname("ipv6.google.com", inet6).
> inet_gethost[29369] (DEBUG):Saved domainname .google.com.
> inet_gethost[29369] (DEBUG):Created worker[6118] with fd 3
> inet_gethost[29369] (DEBUG):Saved domainname .google.com.
> inet_gethost[6118] (DEBUG):Worker got request, op = 1, proto = 2, data
> = ipv6.google.com.
> {error,enotsup}
> 3> ets:tab2list(inet_db).
> [{socks5_noproxy,[]},
>  {res_recurse,1},
>  {res_id,0},
>  {hostname,"golem"},
>  {res_alt_ns,[]},
>  {cache_refresh_interval,3600000},
>  {res_inet6,true},
>  {socks5_port,1080},
>  {socks5_methods,[none]},
>  {res_timeout,2000},
>  {cache_size,100},
>  {res_domain,"mochimedia.net"},
>  {res_retry,3},
>  {res_ns,[]},
>  {res_lookup,[native]},
>  {sctp_module,inet_sctp},
>  {udp_module,inet_udp},
>  {tcp_module,inet_tcp},
>  {socks5_server,[]},
>  {res_search,["mochimedia.net"]},
>  {res_usevc,false}]
> 4> ets:tab2list(inet_hosts).
> []
> 
> 
> matthew@REDACTED:~$ uname -a
> Linux lol 2.6.20-16-generic #2 SMP Tue Feb 12 02:11:24 UTC 2008 x86_64 GNU/Linux
> 
> matthew@REDACTED:~$ cat /etc/resolv.conf
> search mochimedia.net
> nameserver 10.0.1.40
> 
> matthew@REDACTED:~$ ping6 -c 1 ipv6.google.com
> PING ipv6.google.com(2001:4860:0:1001::68) 56 data bytes
> 64 bytes from 2001:4860:0:1001::68: icmp_seq=1 ttl=56 time=174 ms
> 
> --- ipv6.google.com ping statistics ---
> 1 packets transmitted, 1 received, 0% packet loss, time 0ms
> rtt min/avg/max/mdev = 174.967/174.967/174.967/0.000 ms
> 
> matthew@REDACTED:~$ echo '{inet6, true}.' > inetrc
> 
> matthew@REDACTED:~$ erl -kernel inetrc '"./inetrc"'
> Erlang (BEAM) emulator version 5.6.1 [source] [64-bit] [smp:4]
> [async-threads:0] [hipe] [kernel-poll:false]
> 
> Eshell V5.6.1  (abort with ^G)
> 1> inet_gethost_native:control({debug_level,4}).
> inet_gethost[8266] (DEBUG):debug_level = 4
> ok
> 2> inet_gethost_native:gethostbyname("ipv6.google.com", inet6).
> inet_gethost[8266] (DEBUG):Saved domainname .google.com.
> inet_gethost[8266] (DEBUG):Created worker[8268] with fd 3
> inet_gethost[8266] (DEBUG):Saved domainname .google.com.
> inet_gethost[8268] (DEBUG):Worker got request, op = 1, proto = 2, data
> = ipv6.google.com.
> {error,enotsup}
> 3> ets:tab2list(inet_db).
> [{socks5_noproxy,[]},
>  {res_recurse,1},
>  {res_id,0},
>  {hostname,"lol"},
>  {res_alt_ns,[]},
>  {cache_refresh_interval,3600000},
>  {res_inet6,true},
>  {socks5_port,1080},
>  {socks5_methods,[none]},
>  {res_timeout,2000},
>  {cache_size,100},
>  {res_domain,"mochimedia.net"},
>  {res_retry,3},
>  {res_ns,[]},
>  {res_lookup,[native]},
>  {sctp_module,inet_sctp},
>  {udp_module,inet_udp},
>  {tcp_module,inet_tcp},
>  {socks5_server,[]},
>  {res_search,["mochimedia.net"]},
>  {res_usevc,false}]
> 4> ets:tab2list(inet_hosts).
> []
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list