mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Laurent Bercot <ska-dietlibc@skarnet.org>
To: musl@lists.openwall.com
Subject: Re: IPv4 and IPv6 addresses in resolv.conf
Date: Sat, 30 Nov 2013 09:13:32 +0000	[thread overview]
Message-ID: <5299AC3C.8020405@skarnet.org> (raw)
In-Reply-To: <20131130035116.GO24286@brightrain.aerifal.cx>


> OK, so how do we detect if the system "has IPv6"? I don't think it's
> an easy question to answer, but it's not just a rhetorical question
> either since we need to know for the AI_ADDRCONFIG flag that's not yet
> working, so this may very well be the right way to go.

  Is there any problem with a build-time test that opens an IPv6 socket ?
This is what skalibs does and it's been working so far. Of course, any
build-time test makes cross-compilation difficult, but this is why we
have configure options, to manually bypass auto-detection when it cannot
be relied on.


> One other option that's of course the safest is just opening two
> sockets, one for IPv4 and one for IPv6, if both are needed, but that
> of course complicates, bloats, and slows down the code and adds
> failure cases so I'd rather avoid it.

  s6-dns opens a different UDP socket, with the appropriate address family,
every time the client changes servers: so the underlying transport matches
exactly what /etc/resolv.conf specifies. You may call it bloated, but I
believe it does just the right thing (and I'm not one to go for
unnecessary features at the expense of simplicity). Speed is not an issue
here, because we're performing network calls: opening sockets is totally
negligible compared to waiting for the network anyway.

-- 
  Laurent



  parent reply	other threads:[~2013-11-30  9:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-29 10:09 orc
2013-11-29 17:44 ` Rich Felker
2013-11-30  0:37   ` Rich Felker
2013-11-30  1:18     ` Strake
2013-11-30  3:17       ` Rich Felker
2013-11-30  3:45         ` Strake
2013-11-30  3:51           ` Rich Felker
2013-11-30  3:59             ` Rich Felker
2013-11-30  9:16               ` Justin Cormack
2013-11-30 17:01                 ` Rich Felker
2013-11-30 17:23                   ` Justin Cormack
2013-11-30 17:30                     ` Rich Felker
2013-11-30 17:33                       ` Rob
2013-11-30 17:42                         ` Rich Felker
2013-11-30 17:43                         ` Justin Cormack
2013-11-30 18:52                           ` Rich Felker
2013-11-30  9:13             ` Laurent Bercot [this message]
2013-11-30 10:18               ` John Spencer
2013-11-30 16:53               ` Rich Felker
2013-11-30 15:27     ` orc
2013-12-03  2:11       ` Rich Felker

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=5299AC3C.8020405@skarnet.org \
    --to=ska-dietlibc@skarnet.org \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).