[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20110805.035704.1083062407751815748.davem@davemloft.net>
Date: Fri, 05 Aug 2011 03:57:04 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: makc@...hat.com
Cc: netdev@...r.kernel.org, vladislav.yasevich@...com
Subject: Re: [PATCH] ipv6: check for IPv4 mapped addresses when connecting
IPv6 sockets
From: Max Matveev <makc@...hat.com>
Date: Thu, 4 Aug 2011 17:42:44 +1000
> When support for binding to 'mapped INADDR_ANY (::ffff.0.0.0.0)' was added
> in 0f8d3c7ac3693d7b6c731bf2159273a59bf70e12 the rest of the code
> wasn't told so now it's possible to bind IPv6 datagram socket to
> ::ffff.0.0.0.0, connect it to another IPv4 address and it will all
> work except for getsockhame() which does not return the local address
> as expected.
>
> To give getsockname() something to work with check for 'mapped INADDR_ANY'
> when connecting and update the in-core source addresses appropriately.
>
> Signed-off-by: Max Matveev <makc@...hat.com>
Applied, but I had to fixup some trailing whitespace:
> @@ -102,10 +107,12 @@ ipv4_connected:
>
> ipv6_addr_set_v4mapped(inet->inet_daddr, &np->daddr);
>
> - if (ipv6_addr_any(&np->saddr))
> + if (ipv6_addr_any(&np->saddr) ||
> + ipv6_mapped_addr_any(&np->saddr))
> ipv6_addr_set_v4mapped(inet->inet_saddr, &np->saddr);
>
> - if (ipv6_addr_any(&np->rcv_saddr)) {
> + if (ipv6_addr_any(&np->rcv_saddr) ||
^^
there.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists