diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 14:57:35 -0400 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 15:40:00 -0400 |
commit | 878628fbf2589eb24357e42027d5f54b1dafd3c8 (patch) | |
tree | 30c109d8f337b3910e3b5364877c3c521dd700b5 /net/ipv4/tcp_ipv4.c | |
parent | 57da52c1e62c6c13875e97de6c69d3156f8416da (diff) |
[NET] NETNS: Omit namespace comparision without CONFIG_NET_NS.
Introduce an inline net_eq() to compare two namespaces.
Without CONFIG_NET_NS, since no namespace other than &init_net
exists, it is always 1.
We do not need to convert 1) inline vs inline and
2) inline vs &init_net comparisons.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 46847e600a46..2a5881c81778 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1974,7 +1974,7 @@ static void *listening_get_next(struct seq_file *seq, void *cur) | |||
1974 | while (1) { | 1974 | while (1) { |
1975 | while (req) { | 1975 | while (req) { |
1976 | if (req->rsk_ops->family == st->family && | 1976 | if (req->rsk_ops->family == st->family && |
1977 | sock_net(req->sk) == net) { | 1977 | net_eq(sock_net(req->sk), net)) { |
1978 | cur = req; | 1978 | cur = req; |
1979 | goto out; | 1979 | goto out; |
1980 | } | 1980 | } |
@@ -1998,7 +1998,7 @@ get_req: | |||
1998 | } | 1998 | } |
1999 | get_sk: | 1999 | get_sk: |
2000 | sk_for_each_from(sk, node) { | 2000 | sk_for_each_from(sk, node) { |
2001 | if (sk->sk_family == st->family && sock_net(sk) == net) { | 2001 | if (sk->sk_family == st->family && net_eq(sock_net(sk), net)) { |
2002 | cur = sk; | 2002 | cur = sk; |
2003 | goto out; | 2003 | goto out; |
2004 | } | 2004 | } |
@@ -2049,7 +2049,7 @@ static void *established_get_first(struct seq_file *seq) | |||
2049 | read_lock_bh(lock); | 2049 | read_lock_bh(lock); |
2050 | sk_for_each(sk, node, &tcp_hashinfo.ehash[st->bucket].chain) { | 2050 | sk_for_each(sk, node, &tcp_hashinfo.ehash[st->bucket].chain) { |
2051 | if (sk->sk_family != st->family || | 2051 | if (sk->sk_family != st->family || |
2052 | sock_net(sk) != net) { | 2052 | !net_eq(sock_net(sk), net)) { |
2053 | continue; | 2053 | continue; |
2054 | } | 2054 | } |
2055 | rc = sk; | 2055 | rc = sk; |
@@ -2059,7 +2059,7 @@ static void *established_get_first(struct seq_file *seq) | |||
2059 | inet_twsk_for_each(tw, node, | 2059 | inet_twsk_for_each(tw, node, |
2060 | &tcp_hashinfo.ehash[st->bucket].twchain) { | 2060 | &tcp_hashinfo.ehash[st->bucket].twchain) { |
2061 | if (tw->tw_family != st->family || | 2061 | if (tw->tw_family != st->family || |
2062 | twsk_net(tw) != net) { | 2062 | !net_eq(twsk_net(tw), net)) { |
2063 | continue; | 2063 | continue; |
2064 | } | 2064 | } |
2065 | rc = tw; | 2065 | rc = tw; |
@@ -2086,7 +2086,7 @@ static void *established_get_next(struct seq_file *seq, void *cur) | |||
2086 | tw = cur; | 2086 | tw = cur; |
2087 | tw = tw_next(tw); | 2087 | tw = tw_next(tw); |
2088 | get_tw: | 2088 | get_tw: |
2089 | while (tw && (tw->tw_family != st->family || twsk_net(tw) != net)) { | 2089 | while (tw && (tw->tw_family != st->family || !net_eq(twsk_net(tw), net))) { |
2090 | tw = tw_next(tw); | 2090 | tw = tw_next(tw); |
2091 | } | 2091 | } |
2092 | if (tw) { | 2092 | if (tw) { |
@@ -2107,7 +2107,7 @@ get_tw: | |||
2107 | sk = sk_next(sk); | 2107 | sk = sk_next(sk); |
2108 | 2108 | ||
2109 | sk_for_each_from(sk, node) { | 2109 | sk_for_each_from(sk, node) { |
2110 | if (sk->sk_family == st->family && sock_net(sk) == net) | 2110 | if (sk->sk_family == st->family && net_eq(sock_net(sk), net)) |
2111 | goto found; | 2111 | goto found; |
2112 | } | 2112 | } |
2113 | 2113 | ||