diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-01-31 08:06:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-31 22:28:19 -0500 |
commit | c67499c0e772064b37ad75eb69b28fc218752636 (patch) | |
tree | 7d2873308f16080c0c3801d6024881360dd8e196 /net/ipv4/tcp_ipv4.c | |
parent | 941b1d22cc035ad58b3d9b44a1c74efac2d7e499 (diff) |
[NETNS]: Tcp-v4 sockets per-net lookup.
Add a net argument to inet_lookup and propagate it further
into lookup calls. Plus tune the __inet_check_established.
The dccp and inet_diag, which use that lookup functions
pass the init_net into them.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 9aea88b8d4fc..77c1939a2b0d 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -369,8 +369,8 @@ void tcp_v4_err(struct sk_buff *skb, u32 info) | |||
369 | return; | 369 | return; |
370 | } | 370 | } |
371 | 371 | ||
372 | sk = inet_lookup(&tcp_hashinfo, iph->daddr, th->dest, iph->saddr, | 372 | sk = inet_lookup(skb->dev->nd_net, &tcp_hashinfo, iph->daddr, th->dest, |
373 | th->source, inet_iif(skb)); | 373 | iph->saddr, th->source, inet_iif(skb)); |
374 | if (!sk) { | 374 | if (!sk) { |
375 | ICMP_INC_STATS_BH(ICMP_MIB_INERRORS); | 375 | ICMP_INC_STATS_BH(ICMP_MIB_INERRORS); |
376 | return; | 376 | return; |
@@ -1503,8 +1503,8 @@ static struct sock *tcp_v4_hnd_req(struct sock *sk, struct sk_buff *skb) | |||
1503 | if (req) | 1503 | if (req) |
1504 | return tcp_check_req(sk, skb, req, prev); | 1504 | return tcp_check_req(sk, skb, req, prev); |
1505 | 1505 | ||
1506 | nsk = inet_lookup_established(&tcp_hashinfo, iph->saddr, th->source, | 1506 | nsk = inet_lookup_established(sk->sk_net, &tcp_hashinfo, iph->saddr, |
1507 | iph->daddr, th->dest, inet_iif(skb)); | 1507 | th->source, iph->daddr, th->dest, inet_iif(skb)); |
1508 | 1508 | ||
1509 | if (nsk) { | 1509 | if (nsk) { |
1510 | if (nsk->sk_state != TCP_TIME_WAIT) { | 1510 | if (nsk->sk_state != TCP_TIME_WAIT) { |
@@ -1661,8 +1661,8 @@ int tcp_v4_rcv(struct sk_buff *skb) | |||
1661 | TCP_SKB_CB(skb)->flags = iph->tos; | 1661 | TCP_SKB_CB(skb)->flags = iph->tos; |
1662 | TCP_SKB_CB(skb)->sacked = 0; | 1662 | TCP_SKB_CB(skb)->sacked = 0; |
1663 | 1663 | ||
1664 | sk = __inet_lookup(&tcp_hashinfo, iph->saddr, th->source, | 1664 | sk = __inet_lookup(skb->dev->nd_net, &tcp_hashinfo, iph->saddr, |
1665 | iph->daddr, th->dest, inet_iif(skb)); | 1665 | th->source, iph->daddr, th->dest, inet_iif(skb)); |
1666 | if (!sk) | 1666 | if (!sk) |
1667 | goto no_tcp_socket; | 1667 | goto no_tcp_socket; |
1668 | 1668 | ||
@@ -1735,7 +1735,8 @@ do_time_wait: | |||
1735 | } | 1735 | } |
1736 | switch (tcp_timewait_state_process(inet_twsk(sk), skb, th)) { | 1736 | switch (tcp_timewait_state_process(inet_twsk(sk), skb, th)) { |
1737 | case TCP_TW_SYN: { | 1737 | case TCP_TW_SYN: { |
1738 | struct sock *sk2 = inet_lookup_listener(&tcp_hashinfo, | 1738 | struct sock *sk2 = inet_lookup_listener(skb->dev->nd_net, |
1739 | &tcp_hashinfo, | ||
1739 | iph->daddr, th->dest, | 1740 | iph->daddr, th->dest, |
1740 | inet_iif(skb)); | 1741 | inet_iif(skb)); |
1741 | if (sk2) { | 1742 | if (sk2) { |