All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla at busybox.net <bugzilla@busybox.net>
To: buildroot@busybox.net
Subject: [Buildroot] [Bug 8736] IPV6 forced on in busybox
Date: Thu, 03 Mar 2016 21:43:14 +0000	[thread overview]
Message-ID: <bug-8736-163-VBMcPD5M3h@https.bugs.busybox.net/> (raw)
In-Reply-To: <bug-8736-163@https.bugs.busybox.net/>

https://bugs.busybox.net/show_bug.cgi?id=8736

--- Comment #6 from Peter Korsgaard <jacmet@uclibc.org> ---
(In reply to Kenric Smith from comment #4)

So I tried again, this time with IPv6 support disabled in the kernel but
enabled in the toolchain (external codesourcery/glibc):

buildroot login: root
# ifconfig 
eth0      Link encap:Ethernet  HWaddr 52:54:00:12:34:56  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1152 (1.1 KiB)  TX bytes:684 (684.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

# date
Thu Jan  1 00:00:13 UTC 1970

# ntpd -w -p ntp.vt.edu
ntpd: reply from 198.82.247.51: offset:+1457040206.437536 delay:0.123510
status:0x24 strat:2 refid:0xa4f752c6 rootdelay:0.000351 reach:0x01
ntpd: reply from 198.82.247.51: offset:+1457040206.437670 delay:0.109456
status:0x24 strat:2 refid:0xa4f752c6 rootdelay:0.000351 reach:0x03
ntpd: reply from 198.82.247.51: offset:+1457040206.438839 delay:0.109959
status:0x24 strat:2 refid:0xa4f752c6 rootdelay:0.000351 reach:0x07
ntpd: reply from 198.82.247.51: offset:+1457040206.437485 delay:0.107279
status:0x24 strat:2 refid:0xa4f752c6 rootdelay:0.000351 reach:0x0f
random: nonblocking pool is initialized

So that works. If I instead try ntp-1.ipv6.vt.edu (which only has an AAAA
record) it indeed fails:

# ntpd -w -p ntp-1.ipv6.vt.edu
ntpd: socket: Address family not supported by protocol

Which makes sense as it cannot create an IPv6 socket:
socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = -1 EAFNOSUPPORT (Address family not
supported by protocol)
write(2, "ntpd: socket: Address family not"..., 55ntpd: socket: Address family
not supported by protocol
) = 55

Looking at the ntpd code, it ends up calling xhost2sockaddr() on the peer name,
which ends up doing a getnameinfo() with AF_UNSPEC, and using the first result
without checking that it can create a socket - So if your C library prefers
IPv6 over IPv4 this explains it.

The function does contain a workaround though: If you enable
ENABLE_FEATURE_PREFER_IPV4_ADDRESS then it will use the first AF_INET result if
available.

What C library do you use?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2016-03-03 21:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03 17:07 [Buildroot] [Bug 8736] New: IPV6 forced on in busybox bugzilla at busybox.net
2016-03-03 20:59 ` [Buildroot] [Bug 8736] " bugzilla at busybox.net
2016-03-03 21:08   ` Grant Edwards
2016-03-03 21:12     ` Peter Korsgaard
2016-03-03 21:15     ` Peter Korsgaard
2016-03-03 21:35       ` Grant Edwards
2016-03-03 21:05 ` bugzilla at busybox.net
2016-03-03 21:09 ` bugzilla at busybox.net
2016-03-03 21:13 ` bugzilla at busybox.net
2016-03-03 21:17 ` bugzilla at busybox.net
2016-03-03 21:43 ` bugzilla at busybox.net [this message]
2016-03-03 21:47 ` bugzilla at busybox.net
2016-03-03 22:33 ` bugzilla at busybox.net
2016-03-03 22:40 ` bugzilla at busybox.net
2016-03-04 16:10 ` bugzilla at busybox.net

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-8736-163-VBMcPD5M3h@https.bugs.busybox.net/ \
    --to=bugzilla@busybox.net \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.