From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4316 Path: news.gmane.org!not-for-mail From: Justin Cormack Newsgroups: gmane.linux.lib.musl.general Subject: Re: IPv4 and IPv6 addresses in resolv.conf Date: Sat, 30 Nov 2013 17:43:11 +0000 Message-ID: References: <20131129174410.GD24286@brightrain.aerifal.cx> <20131130003704.GL24286@brightrain.aerifal.cx> <20131130031744.GM24286@brightrain.aerifal.cx> <20131130035116.GO24286@brightrain.aerifal.cx> <20131130035912.GP24286@brightrain.aerifal.cx> <20131130170112.GR24286@brightrain.aerifal.cx> <20131130173026.GS24286@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1385833399 710 80.91.229.3 (30 Nov 2013 17:43:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 30 Nov 2013 17:43:19 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4320-gllmg-musl=m.gmane.org@lists.openwall.com Sat Nov 30 18:43:26 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1VmoZh-0008E7-4U for gllmg-musl@plane.gmane.org; Sat, 30 Nov 2013 18:43:25 +0100 Original-Received: (qmail 28606 invoked by uid 550); 30 Nov 2013 17:43:24 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 28595 invoked from network); 30 Nov 2013 17:43:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=specialbusservice.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=uTMMVbMVT6D5pvXksMn5RwK37HM3Txq86FTgmcnXimI=; b=WG9oeAhwiiC7Unbq19QCnRfXaXrJZVsHVvG6dJkprY/0T8NKHobi3yl9YWpcVLhKkg 3yk37gLjugwYPNK88DTBSj7hhXNOn8F5u2wCHof8f2YaUJWrsvdCmNKZYObCiDOHnOPK u9tHZ1+zgSVmxwtzO4bn3VWIS1p3Eufcwd5Yk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=uTMMVbMVT6D5pvXksMn5RwK37HM3Txq86FTgmcnXimI=; b=Fdq5EF0tVcBGp8U6FafAWr+zbH8QBvD7Gss58nfInELdZwDUTmErT+Phi2upEwdvPz W/ZZWKNo7jMQDc7k1T/jqfoTHYF3TBjFo92L6TFRAce7wVgqEbT3F/Pupri+2w8cSawd 8uCHoq60ck/b/5+o4j87b1uQKfblF0j/JUDEUvogT8nDJPti/ef4+Yj3aV7mfPh3BEPk 4hX3JZ5MtFxm2iFaWg9In6BgcxwRMXIolXcTOQgNGJdvMzMlNzrnb8l4cRl5HahvxYcz 7xSkJk3lgKOCwEptAuRFksdXiZv5W40B5GQRciHNad+c5yBpg2SRDu/XTeeMwlM2SSEV MAyg== X-Gm-Message-State: ALoCoQl+aV9kE1QiE6IA0qG0PCS6hOYpSvjkzXP6hgDs2Ko2R+LspDC2UTkaDxELeTANta01/epN X-Received: by 10.68.113.195 with SMTP id ja3mr2307202pbb.176.1385833392055; Sat, 30 Nov 2013 09:43:12 -0800 (PST) In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:4316 Archived-At: On Sat, Nov 30, 2013 at 5:33 PM, Rob wrote: > Rich Felker, Sat, 30 Nov 2013: > >>> >>> It is EAFNOSUPPORT if no kernel support at all. >>> >>> Actually I don't think there can be any cases where sending to the >>> v4-mapped address (ie ::ffff:1.2.3.4) can fail where an ipv4 socket >>> will succeed because those are basically ipv4 sockets with just ipv6 >>> notation, those addresses can't be routed by the ipv6 stack. So it >> >> >> One thing I'm confused about is the addresses on the actual packets. >> If we've already called bind for address :: and gotten assigned port >> N, does this also reserve port N on 0.0.0.0, which will be needed when >> sending from (and receiving back) IPv4 packets? Also, is there some >> kernel option we might need to worry about that prevents :: from >> receiving packets sent to IPv4 addresses, or does that only apply to >> TCP, not UDP? > > > I've been seeing this output consistently from mpd at startup: > > listen: bind to '0.0.0.0:6600' failed: Address already in use > (continuing anyway, because binding to '[::]:6600' succeeded) > > mpd is the only program on my machine that binds to 6600 so it would > appear that :: port bindings reserve the ipv4 port too. Could be a > kernel configuration option though... > Yes the default is that ipv6 binds to both ipv6 and ipv4. There is a sockopt IPV6_V6ONLY or /proc/sys/net/ipv6/bindv6only which defaults to 0. I guess scheme above is going to fail if /proc/sys/net/ipv6/bindv6only is set to 1, so the sockopt will have to be set manually as well to force binding on both. Justin