public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat•com>
To: Eric Dumazet <eric.dumazet@gmail•com>
Cc: Evgeniy Polyakov <zbr@ioremap•net>,
	Ben Greear <greearb@candelatech•com>,
	David Miller <davem@davemloft•net>,
	Gaspar Chilingarov <gasparch@gmail•com>,
	netdev <netdev@vger•kernel.org>
Subject: Re: PROBLEM: Linux kernel 2.6.31 IPv4 TCP fails to open huge amount of outgoing connections (unable to bind ... )
Date: Sun, 25 Apr 2010 19:35:43 +0300	[thread overview]
Message-ID: <20100425163543.GA11831@redhat.com> (raw)
In-Reply-To: <1272212460.2069.9.camel@edumazet-laptop>

On Sun, Apr 25, 2010 at 06:21:00PM +0200, Eric Dumazet wrote:
> Le dimanche 25 avril 2010 à 19:56 +0400, Evgeniy Polyakov a écrit :
> > On Sun, Apr 25, 2010 at 05:26:42PM +0300, Michael S. Tsirkin (mst@redhat•com) wrote:
> > 
> > > > diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
> > > > index 0c5e3c3..fb6959c 100644
> > > > --- a/net/ipv6/inet6_connection_sock.c
> > > > +++ b/net/ipv6/inet6_connection_sock.c
> > > > @@ -42,11 +42,16 @@ int inet6_csk_bind_conflict(const struct sock *sk,
> > > >  		if (sk != sk2 &&
> > > >  		    (!sk->sk_bound_dev_if ||
> > > >  		     !sk2->sk_bound_dev_if ||
> > > > -		     sk->sk_bound_dev_if == sk2->sk_bound_dev_if) &&
> > > > -		    (!sk->sk_reuse || !sk2->sk_reuse ||
> > > > -		     sk2->sk_state == TCP_LISTEN) &&
> > > > -		     ipv6_rcv_saddr_equal(sk, sk2))
> > > > -			break;
> > > > +		     sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) {
> > > > +			if ((!sk->sk_reuse || !sk2->sk_reuse ||
> > > > +			     sk2->sk_state == TCP_LISTEN) &&
> > > > +			     ipv6_rcv_saddr_equal(sk, sk2))
> > > > +				break;
> > > > +			else if (sk->sk_reuse && sk2->sk_reuse &&
> > > > +				!ipv6_addr_any(inet6_rcv_saddr(sk2)) &&
> > 
> > I suppose above line is guilty when inet6_rcv_saddr() returns NULL?
> > 
> 
> Sorry, I cant test this at this moment (I am travelling)
> 
> Evgeniy, David could you double check ?
> 
> Michael, could you test this patch ?
> 
> Thanks !
> 
> [PATCH] ipv6: Fix inet6_csk_bind_conflict()
> 
> Commit fda48a0d7a84 (tcp: bind() fix when many ports are bound)
> introduced a bug on IPV6 part.
> We should not call ipv6_addr_any(inet6_rcv_saddr(sk2)) but
> ipv6_addr_any(inet6_rcv_saddr(sk)) because sk2 can be IPV4, while sk is
> IPV6.
> 
> Reported-by: Michael S. Tsirkin <mst@redhat•com>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail•com>
> ---
> diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
> index b4b7d40..3a4d92b 100644
> --- a/net/ipv6/inet6_connection_sock.c
> +++ b/net/ipv6/inet6_connection_sock.c
> @@ -48,7 +48,7 @@ int inet6_csk_bind_conflict(const struct sock *sk,
>  			     ipv6_rcv_saddr_equal(sk, sk2))
>  				break;
>  			else if (sk->sk_reuse && sk2->sk_reuse &&
> -				!ipv6_addr_any(inet6_rcv_saddr(sk2)) &&
> +				!ipv6_addr_any(inet6_rcv_saddr(sk)) &&
>  				ipv6_rcv_saddr_equal(sk, sk2))
>  				break;
>  		}
> 

works for me
Tested-by: Michael S. Tsirkin <mst@redhat•com>


  reply	other threads:[~2010-04-25 17:16 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-20 22:17 PROBLEM: Linux kernel 2.6.31 IPv4 TCP fails to open huge amount of outgoing connections (unable to bind ... ) Gaspar Chilingarov
2010-04-20 22:31 ` Eric Dumazet
2010-04-20 23:18   ` Gaspar Chilingarov
2010-04-20 23:42     ` Eric Dumazet
2010-04-21  0:14       ` Evgeniy Polyakov
2010-04-20 23:07 ` Ben Greear
2010-04-20 23:20   ` Gaspar Chilingarov
2010-04-20 23:20   ` Gaspar Chilingarov
2010-04-20 23:30     ` Ben Greear
2010-04-20 23:35       ` Gaspar Chilingarov
2010-04-20 23:49         ` Ben Greear
2010-04-20 23:57           ` Gaspar Chilingarov
2010-04-21  0:14             ` Eric Dumazet
2010-04-21  0:05           ` Eric Dumazet
2010-04-21  0:12             ` Gaspar Chilingarov
2010-04-21  0:14             ` David Miller
2010-04-21  0:30             ` Evgeniy Polyakov
2010-04-21  2:04               ` David Miller
2010-04-21  5:46               ` Eric Dumazet
2010-04-21  8:25                 ` Evgeniy Polyakov
2010-04-21  9:02                   ` Eric Dumazet
2010-04-21  9:58                     ` Evgeniy Polyakov
2010-04-21 10:21                       ` Eric Dumazet
2010-04-21 11:27                       ` Eric Dumazet
2010-04-21 16:52                         ` George B.
2010-04-21 18:27                         ` Evgeniy Polyakov
2010-04-21 18:43                           ` Eric Dumazet
2010-04-21 18:58                             ` Evgeniy Polyakov
2010-04-21 19:26                               ` Eric Dumazet
2010-04-21 20:08                                 ` Evgeniy Polyakov
2010-04-23  2:06                                   ` David Miller
2010-04-25 14:26                                 ` Michael S. Tsirkin
2010-04-25 15:56                                   ` Evgeniy Polyakov
2010-04-25 16:13                                     ` Eric Dumazet
2010-04-25 16:21                                     ` Eric Dumazet
2010-04-25 16:35                                       ` Michael S. Tsirkin [this message]
2010-04-25 22:08                                         ` David Miller
2010-04-21 19:03 ` Narendra Choyal

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=20100425163543.GA11831@redhat.com \
    --to=mst@redhat$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=eric.dumazet@gmail$(echo .)com \
    --cc=gasparch@gmail$(echo .)com \
    --cc=greearb@candelatech$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=zbr@ioremap$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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