All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-2.6.26][SOCK]: Add some notes about per-bind-bucket sock lookup.
@ 2008-04-14  9:39 Pavel Emelyanov
  2008-04-14  9:42 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Emelyanov @ 2008-04-14  9:39 UTC (permalink / raw
  To: David Miller; +Cc: Linux Netdev List

I was asked about "why don't we perform a sk_net filtering in
bind_conflict calls, like we do in other sock lookup places"
for a couple of times.

Can we please add a comment about why we do not need one?

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---
 net/ipv4/inet_connection_sock.c  |    7 +++++++
 net/ipv6/inet6_connection_sock.c |    4 ++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 8d70cfb..828ea21 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -55,6 +55,13 @@ int inet_csk_bind_conflict(const struct sock *sk,
 	struct hlist_node *node;
 	int reuse = sk->sk_reuse;
 
+	/*
+	 * Unlike other sk lookup places we do not check
+	 * for sk_net here, since _all_ the socks listed
+	 * in tb->owners list belong to the same net - the
+	 * one this bucket belongs to.
+	 */
+
 	sk_for_each_bound(sk2, node, &tb->owners) {
 		if (sk != sk2 &&
 		    !inet_v6_ipv6only(sk2) &&
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index 78de42a..87801cc 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -33,6 +33,10 @@ int inet6_csk_bind_conflict(const struct sock *sk,
 	const struct hlist_node *node;
 
 	/* We must walk the whole port owner list in this case. -DaveM */
+	/*
+	 * See comment in inet_csk_bind_conflict about sock lookup
+	 * vs net namespaces issues.
+	 */
 	sk_for_each_bound(sk2, node, &tb->owners) {
 		if (sk != sk2 &&
 		    (!sk->sk_bound_dev_if ||
-- 
1.5.3.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-2.6.26][SOCK]: Add some notes about per-bind-bucket sock lookup.
  2008-04-14  9:39 [PATCH net-2.6.26][SOCK]: Add some notes about per-bind-bucket sock lookup Pavel Emelyanov
@ 2008-04-14  9:42 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-04-14  9:42 UTC (permalink / raw
  To: xemul; +Cc: netdev

From: Pavel Emelyanov <xemul@openvz.org>
Date: Mon, 14 Apr 2008 13:39:46 +0400

> I was asked about "why don't we perform a sk_net filtering in
> bind_conflict calls, like we do in other sock lookup places"
> for a couple of times.
> 
> Can we please add a comment about why we do not need one?
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Applied, thanks Pavel.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-04-14  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-14  9:39 [PATCH net-2.6.26][SOCK]: Add some notes about per-bind-bucket sock lookup Pavel Emelyanov
2008-04-14  9:42 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.