[erlang-questions] Broken ipv6 behavior?

Matthew Dempsky <>
Wed Apr 9 09:52:40 CEST 2008


On Wed, Apr 9, 2008 at 12:27 AM, Raimo Niskanen
<> 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.)


:~$ uname -a
OpenBSD golem.mochimedia.net 4.3 GENERIC.MP#1559 amd64

:~$ cat /etc/resolv.conf
search mochimedia.net
nameserver 127.0.0.1

:~$ 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

:~$ echo '{inet6, true}.' > inetrc

:~$ 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).
[]


:~$ uname -a
Linux lol 2.6.20-16-generic #2 SMP Tue Feb 12 02:11:24 UTC 2008 x86_64 GNU/Linux

:~$ cat /etc/resolv.conf
search mochimedia.net
nameserver 10.0.1.40

:~$ 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

:~$ echo '{inet6, true}.' > inetrc

:~$ 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).
[]



More information about the erlang-questions mailing list