aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv4/inet_connection_sock.c7
-rw-r--r--net/ipv6/inet6_connection_sock.c4
2 files changed, 11 insertions, 0 deletions
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 8d70cfbacb78..828ea211ff21 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,
55 struct hlist_node *node; 55 struct hlist_node *node;
56 int reuse = sk->sk_reuse; 56 int reuse = sk->sk_reuse;
57 57
58 /*
59 * Unlike other sk lookup places we do not check
60 * for sk_net here, since _all_ the socks listed
61 * in tb->owners list belong to the same net - the
62 * one this bucket belongs to.
63 */
64
58 sk_for_each_bound(sk2, node, &tb->owners) { 65 sk_for_each_bound(sk2, node, &tb->owners) {
59 if (sk != sk2 && 66 if (sk != sk2 &&
60 !inet_v6_ipv6only(sk2) && 67 !inet_v6_ipv6only(sk2) &&
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index 78de42ada844..87801cc1b2f8 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,
33 const struct hlist_node *node; 33 const struct hlist_node *node;
34 34
35 /* We must walk the whole port owner list in this case. -DaveM */ 35 /* We must walk the whole port owner list in this case. -DaveM */
36 /*
37 * See comment in inet_csk_bind_conflict about sock lookup
38 * vs net namespaces issues.
39 */
36 sk_for_each_bound(sk2, node, &tb->owners) { 40 sk_for_each_bound(sk2, node, &tb->owners) {
37 if (sk != sk2 && 41 if (sk != sk2 &&
38 (!sk->sk_bound_dev_if || 42 (!sk->sk_bound_dev_if ||