From: Eric Dumazet <eric.dumazet@gmail.com>
To: Nagendra Tomar <tomer_iisc@yahoo.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
Evgeniy Polyakov <zbr@ioremap.net>
Subject: Re: [PATCH] net-next: Fix __inet_inherit_port() to correctly increment bsockets and num_owners
Date: Sat, 27 Nov 2010 10:02:03 +0100 [thread overview]
Message-ID: <1290848523.2794.7.camel@edumazet-laptop> (raw)
In-Reply-To: <844781.48196.qm@web53701.mail.re2.yahoo.com>
Le vendredi 26 novembre 2010 à 16:26 -0800, Nagendra Tomar a écrit :
> inet sockets corresponding to passive connections are added to the bind hash
> using ___inet_inherit_port(). These sockets are later removed from the bind
> hash using __inet_put_port(). These two functions are not exactly symmetrical.
> __inet_put_port() decrements hashinfo->bsockets and tb->num_owners, whereas
> ___inet_inherit_port() does not increment them. This results in both of these
> going to -ve values.
>
> This patch fixes this by calling inet_bind_hash() from ___inet_inherit_port(),
> which does the right thing.
>
> 'bsockets' and 'num_owners' were introduced by commit a9d8f9110d7e953c
> (inet: Allowing more than 64k connections and heavily optimize bind(0))
>
> Signed-off-by: Nagendra Singh Tomar <tomer_iisc@yahoo.com>
>
> ---
> --- linux-2.6.37-rc3/net/ipv4/inet_hashtables.c.orig 2010-11-26 13:28:51.034811940 -0500
> +++ linux-2.6.37-rc3/net/ipv4/inet_hashtables.c 2010-11-26 14:41:41.006268035 -0500
> @@ -133,8 +133,7 @@ int __inet_inherit_port(struct sock *sk,
> }
> }
> }
> - sk_add_bind_node(child, &tb->owners);
> - inet_csk(child)->icsk_bind_hash = tb;
> + inet_bind_hash(child, tb, port);
> spin_unlock(&head->lock);
>
> return 0;
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Thanks !
next prev parent reply other threads:[~2010-11-27 9:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-27 0:26 [PATCH] net-next: Fix __inet_inherit_port() to correctly increment bsockets and num_owners Nagendra Tomar
2010-11-27 9:02 ` Eric Dumazet [this message]
2010-11-28 23:00 ` Evgeniy Polyakov
2010-11-29 2:20 ` David Miller
2010-11-29 12:39 ` Jarek Poplawski
2010-11-29 12:49 ` Eric Dumazet
2010-11-29 12:51 ` Evgeniy Polyakov
2010-11-29 13:12 ` Jarek Poplawski
2010-11-29 13:17 ` Eric Dumazet
2010-11-29 13:33 ` Jarek Poplawski
-- strict thread matches above, loose matches on Subject: below --
2010-11-26 10:47 [PATCH] net: " Eric Dumazet
2010-11-27 0:01 ` [PATCH] net-next: " Nagendra Tomar
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=1290848523.2794.7.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=tomer_iisc@yahoo.com \
--cc=zbr@ioremap.net \
/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