From: Felix von Leitner <felix-kernel@fefe.de>
To: Brian Haley <brian.haley@hp.com>
Cc: netdev@vger.kernel.org
Subject: Re: socket api problem: can't bind an ipv6 socket to ::ffff:0.0.0.0
Date: Tue, 17 Mar 2009 13:58:45 +0100 [thread overview]
Message-ID: <20090317125845.GB9754@codeblau.de> (raw)
In-Reply-To: <49BF0A5A.2040501@hp.com>
> I don't think this ever worked on Linux, from the very beginning of inet6_bind():
> /* Check if the address belongs to the host. */
> if (addr_type == IPV6_ADDR_MAPPED) {
> v4addr = addr->sin6_addr.s6_addr32[3];
> if (inet_addr_type(net, v4addr) != RTN_LOCAL) {
> err = -EADDRNOTAVAIL;
> goto out;
> }
> } else {
What is the harm in allowing this? That way an application ported to
IPv6 can still bind IPv4-only. Why would it be legal to bind to a
specific IPv4 address but not to all IPv4 addresses?
The specific case is a bittorrent tracker. The code was ported to IPv6,
but since there is so much overhead in storing IPv6 addresses you are
supposed to run two processes, one on the IPv6 address and one on the
IPv4 address (the IPv4 one then does not have overhead). The sane way
to do this is to bind the IPv6 socket to ::ffff:0.0.0.0 then. Otherwise
you would need some kind of giant abstraction layer in the application.
And we specifically added the ipv4 mapped addresses so applications
would not need to have a giant abstraction layer.
Did I mention *BSD and OSX allow this?
> So are you trying to get IPv4-only behavior out of this socket? Seems
> like the wrong way to go about it.
Why would you say that?
Felix
next prev parent reply other threads:[~2009-03-17 12:58 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-16 23:48 socket api problem: can't bind an ipv6 socket to ::ffff:0.0.0.0 Felix von Leitner
2009-03-17 0:00 ` Stephen Hemminger
2009-03-17 0:18 ` Felix von Leitner
2009-03-17 2:26 ` Brian Haley
2009-03-17 2:47 ` Eric Dumazet
2009-03-17 8:51 ` Bjørn Mork
2009-03-17 16:00 ` Brian Haley
2009-03-17 12:58 ` Felix von Leitner [this message]
2009-03-17 13:47 ` Vlad Yasevich
2009-03-17 14:14 ` Felix von Leitner
2009-03-17 14:57 ` Vlad Yasevich
2009-03-17 17:51 ` Felix von Leitner
2009-03-17 15:21 ` Eric Dumazet
2009-03-17 18:01 ` Felix von Leitner
2009-03-17 15:59 ` Brian Haley
[not found] ` <20090317180840.GC13270@codeblau.de>
2009-03-17 19:21 ` Brian Haley
2009-03-17 19:31 ` David Miller
2009-03-17 21:05 ` Vlad Yasevich
2009-03-17 21:05 ` [RFC PATCH 1/4] ipv6: Disallow binding to v4-mapped address on v6-only socket Vlad Yasevich
2009-03-17 21:06 ` [RFC PATCH 2/4] ipv6: Allow ipv4 wildcard binds after ipv6 address binds Vlad Yasevich
2009-03-17 21:06 ` [RFC PATCH 3/4] ipv6: Make v4-mapped bindings consitant with IPv4 Vlad Yasevich
2009-03-17 21:06 ` [RFC PATCH 4/4] ipv6: Fix conflict resolutions during ipv6 binding Vlad Yasevich
2009-03-18 9:13 ` socket api problem: can't bind an ipv6 socket to ::ffff:0.0.0.0 Jarek Poplawski
2009-03-18 21:36 ` David Miller
2009-03-18 21:53 ` Jarek Poplawski
2009-03-19 0:32 ` David Miller
2009-03-17 9:03 ` Bjørn Mork
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=20090317125845.GB9754@codeblau.de \
--to=felix-kernel@fefe.de \
--cc=brian.haley@hp.com \
--cc=netdev@vger.kernel.org \
/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 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).