diff mbox

[net-next,v2] IPv6: enable bind() to assign an anycast address

Message ID 1392212332-10463-1-git-send-email-fx.lebail@yahoo.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

FX Le Bail Feb. 12, 2014, 1:38 p.m. UTC
- Use ipv6_chk_acast_addr_src() in inet6_bind().

Signed-off-by: Francois-Xavier Le Bail <fx.lebail@yahoo.com>
---
v2: ipv6_chk_acast_addr_src() was previously added.

 net/ipv6/af_inet6.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Hannes Frederic Sowa Feb. 13, 2014, 12:16 a.m. UTC | #1
Hi!

[added Cc list from old thread]

On Wed, Feb 12, 2014 at 02:38:51PM +0100, Francois-Xavier Le Bail wrote:
> - Use ipv6_chk_acast_addr_src() in inet6_bind().
> 
> Signed-off-by: Francois-Xavier Le Bail <fx.lebail@yahoo.com>

I would agree with the change but would like to see some people from the old
thread about this change to agree with it, too.

> ---
> v2: ipv6_chk_acast_addr_src() was previously added.
> 
>  net/ipv6/af_inet6.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
> index c921d5d..68b81e9 100644
> --- a/net/ipv6/af_inet6.c
> +++ b/net/ipv6/af_inet6.c
> @@ -347,7 +347,9 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
>  			if (!(addr_type & IPV6_ADDR_MULTICAST))	{
>  				if (!(inet->freebind || inet->transparent) &&
>  				    !ipv6_chk_addr(net, &addr->sin6_addr,
> -						   dev, 0)) {
> +						   dev, 0) &&
> +				    !ipv6_chk_acast_addr_src(net, dev,
> +							     &addr->sin6_addr)) {
>  					err = -EADDRNOTAVAIL;
>  					goto out_unlock;
>  				}

Thanks,

  Hannes

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Feb. 17, 2014, 5:15 a.m. UTC | #2
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Thu, 13 Feb 2014 01:16:24 +0100

> [added Cc list from old thread]
> 
> On Wed, Feb 12, 2014 at 02:38:51PM +0100, Francois-Xavier Le Bail wrote:
>> - Use ipv6_chk_acast_addr_src() in inet6_bind().
>> 
>> Signed-off-by: Francois-Xavier Le Bail <fx.lebail@yahoo.com>
> 
> I would agree with the change but would like to see some people from the old
> thread about this change to agree with it, too.

I hear crickets... instead of other reviews :-)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Paasch Feb. 17, 2014, 9:32 a.m. UTC | #3
On 17/02/14 - 00:15:45, David Miller wrote:
> From: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Date: Thu, 13 Feb 2014 01:16:24 +0100
> 
> > [added Cc list from old thread]
> > 
> > On Wed, Feb 12, 2014 at 02:38:51PM +0100, Francois-Xavier Le Bail wrote:
> >> - Use ipv6_chk_acast_addr_src() in inet6_bind().
> >> 
> >> Signed-off-by: Francois-Xavier Le Bail <fx.lebail@yahoo.com>
> > 
> > I would agree with the change but would like to see some people from the old
> > thread about this change to agree with it, too.
> 
> I hear crickets... instead of other reviews :-)

I don't have strong opinions for or against this patch.

I was only involved in the original thread because F-X claimed that
draft-iab-anycast-arch-implications (now RFC 7094) allows the use of anycast
addresses for TCP, which is not what RFC 7094 is saying. There is no
recommendation concerning TCP in the RFC and the situation is rather unclear.


Cheers,
Christoph

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alexey Kuznetsov Feb. 17, 2014, 10:02 a.m. UTC | #4
Hello!

On Mon, Feb 17, 2014 at 1:32 PM, Christoph Paasch
<christoph.paasch@uclouvain.be> wrote:
> I don't have strong opinions for or against this patch.
>
> I was only involved in the original thread because F-X claimed that
> draft-iab-anycast-arch-implications (now RFC 7094) allows the use of anycast
> addresses for TCP, which is not what RFC 7094 is saying. There is no
> recommendation concerning TCP in the RFC and the situation is rather unclear.

The same is here.

Using anycast as source or bind address, why not?

Use of anycast with TCP? Logically impossible, ergo prohibited.
If someone wants to play with fire, the option can be left hidden behind
a sysctl disabled by default.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Feb. 17, 2014, 7:19 p.m. UTC | #5
From: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Date: Mon, 17 Feb 2014 14:02:02 +0400

> Hello!
> 
> On Mon, Feb 17, 2014 at 1:32 PM, Christoph Paasch
> <christoph.paasch@uclouvain.be> wrote:
>> I don't have strong opinions for or against this patch.
>>
>> I was only involved in the original thread because F-X claimed that
>> draft-iab-anycast-arch-implications (now RFC 7094) allows the use of anycast
>> addresses for TCP, which is not what RFC 7094 is saying. There is no
>> recommendation concerning TCP in the RFC and the situation is rather unclear.
> 
> The same is here.
> 
> Using anycast as source or bind address, why not?
> 
> Use of anycast with TCP? Logically impossible, ergo prohibited.
> If someone wants to play with fire, the option can be left hidden behind
> a sysctl disabled by default.

Agreed.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hannes Frederic Sowa Feb. 17, 2014, 7:25 p.m. UTC | #6
On Mon, Feb 17, 2014 at 02:19:49PM -0500, David Miller wrote:
> From: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
> Date: Mon, 17 Feb 2014 14:02:02 +0400
> 
> > Hello!
> > 
> > On Mon, Feb 17, 2014 at 1:32 PM, Christoph Paasch
> > <christoph.paasch@uclouvain.be> wrote:
> >> I don't have strong opinions for or against this patch.
> >>
> >> I was only involved in the original thread because F-X claimed that
> >> draft-iab-anycast-arch-implications (now RFC 7094) allows the use of anycast
> >> addresses for TCP, which is not what RFC 7094 is saying. There is no
> >> recommendation concerning TCP in the RFC and the situation is rather unclear.
> > 
> > The same is here.
> > 
> > Using anycast as source or bind address, why not?
> > 
> > Use of anycast with TCP? Logically impossible, ergo prohibited.
> > If someone wants to play with fire, the option can be left hidden behind
> > a sysctl disabled by default.
> 
> Agreed.

If a knob seems necessary I would vote for per address flags on those
anycast addresses (via setsockopt and netlink) so an application can
decide itself if it wants to do so.

Greetings,

  Hannes

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
FX Le Bail Feb. 17, 2014, 7:42 p.m. UTC | #7
> From: David Miller <davem@davemloft.net>

> From: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
>>  On Mon, Feb 17, 2014 at 1:32 PM, Christoph Paasch
>>  <christoph.paasch@uclouvain.be> wrote:
>>>  I don't have strong opinions for or against this patch.
>>> 
>>>  I was only involved in the original thread because F-X claimed that
>>>  draft-iab-anycast-arch-implications (now RFC 7094) allows the use of 
> anycast
>>>  addresses for TCP, which is not what RFC 7094 is saying. There is no
>>>  recommendation concerning TCP in the RFC and the situation is rather 
> unclear.
>> 
>>  The same is here.
>> 
>>  Using anycast as source or bind address, why not?
>> 
>>  Use of anycast with TCP? Logically impossible, ergo prohibited.
>>  If someone wants to play with fire, the option can be left hidden behind
>>  a sysctl disabled by default.
> 
> Agreed.

If I understand well the reviews, no change was ask for this patch.
The sysctl was asked in case of patch for TCP.
So, why the status is now "Changes Requested" ? 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Feb. 17, 2014, 7:48 p.m. UTC | #8
From: François-Xavier Le Bail <fx.lebail@yahoo.com>
Date: Mon, 17 Feb 2014 11:42:45 -0800 (PST)

> If I understand well the reviews, no change was ask for this patch.
> The sysctl was asked in case of patch for TCP.
> So, why the status is now "Changes Requested" ? 

This change is in generic bind() code, therefore it allows binding TCP
sockets with anycast, therefore you need to make a change.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
FX Le Bail Feb. 17, 2014, 7:52 p.m. UTC | #9
----- Original Message -----
> From: David Miller <davem@davemloft.net>
> To: fx.lebail@yahoo.com
> Cc: kuznet@ms2.inr.ac.ru; christoph.paasch@uclouvain.be; hannes@stressinduktion.org; netdev@vger.kernel.org; eric.dumazet@gmail.com
> Sent: Monday, February 17, 2014 8:48 PM
> Subject: Re: [PATCH net-next v2] IPv6: enable bind() to assign an anycast address
> 
> From: François-Xavier Le Bail <fx.lebail@yahoo.com>
> 
> Date: Mon, 17 Feb 2014 11:42:45 -0800 (PST)
> 
>>  If I understand well the reviews, no change was ask for this patch.
>>  The sysctl was asked in case of patch for TCP.
>>  So, why the status is now "Changes Requested" ? 
> 
> This change is in generic bind() code, therefore it allows binding TCP
> sockets with anycast, therefore you need to make a change.

Understood, thanks.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index c921d5d..68b81e9 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -347,7 +347,9 @@  int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 			if (!(addr_type & IPV6_ADDR_MULTICAST))	{
 				if (!(inet->freebind || inet->transparent) &&
 				    !ipv6_chk_addr(net, &addr->sin6_addr,
-						   dev, 0)) {
+						   dev, 0) &&
+				    !ipv6_chk_acast_addr_src(net, dev,
+							     &addr->sin6_addr)) {
 					err = -EADDRNOTAVAIL;
 					goto out_unlock;
 				}