|
Message-ID: <5299AC3C.8020405@skarnet.org> Date: Sat, 30 Nov 2013 09:13:32 +0000 From: Laurent Bercot <ska-dietlibc@...rnet.org> To: musl@...ts.openwall.com Subject: Re: IPv4 and IPv6 addresses in resolv.conf > 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
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.