diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-11-25 20:35:18 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-25 20:35:18 -0500 |
commit | 52479b623d3d41df84c499325b6a8c7915413032 (patch) | |
tree | 196f303f296b53dc89a05954d9c03226a9b4158b /net/ipv6/tcp_ipv6.c | |
parent | cdcbca7c1f1946758cfacb69bc1c7eeaccb11e2d (diff) |
netns xfrm: lookup in netns
Pass netns to xfrm_lookup()/__xfrm_lookup(). For that pass netns
to flow_cache_lookup() and resolver callback.
Take it from socket or netdevice. Stub DECnet to init_net.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index a5d750acd793..f259c9671f3e 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -260,7 +260,8 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, | |||
260 | if (final_p) | 260 | if (final_p) |
261 | ipv6_addr_copy(&fl.fl6_dst, final_p); | 261 | ipv6_addr_copy(&fl.fl6_dst, final_p); |
262 | 262 | ||
263 | if ((err = __xfrm_lookup(&dst, &fl, sk, XFRM_LOOKUP_WAIT)) < 0) { | 263 | err = __xfrm_lookup(sock_net(sk), &dst, &fl, sk, XFRM_LOOKUP_WAIT); |
264 | if (err < 0) { | ||
264 | if (err == -EREMOTE) | 265 | if (err == -EREMOTE) |
265 | err = ip6_dst_blackhole(sk, &dst, &fl); | 266 | err = ip6_dst_blackhole(sk, &dst, &fl); |
266 | if (err < 0) | 267 | if (err < 0) |
@@ -390,7 +391,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
390 | goto out; | 391 | goto out; |
391 | } | 392 | } |
392 | 393 | ||
393 | if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) { | 394 | if ((err = xfrm_lookup(net, &dst, &fl, sk, 0)) < 0) { |
394 | sk->sk_err_soft = -err; | 395 | sk->sk_err_soft = -err; |
395 | goto out; | 396 | goto out; |
396 | } | 397 | } |
@@ -492,7 +493,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req) | |||
492 | goto done; | 493 | goto done; |
493 | if (final_p) | 494 | if (final_p) |
494 | ipv6_addr_copy(&fl.fl6_dst, final_p); | 495 | ipv6_addr_copy(&fl.fl6_dst, final_p); |
495 | if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) | 496 | if ((err = xfrm_lookup(sock_net(sk), &dst, &fl, sk, 0)) < 0) |
496 | goto done; | 497 | goto done; |
497 | 498 | ||
498 | skb = tcp_make_synack(sk, dst, req); | 499 | skb = tcp_make_synack(sk, dst, req); |
@@ -1018,7 +1019,7 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win, | |||
1018 | * namespace | 1019 | * namespace |
1019 | */ | 1020 | */ |
1020 | if (!ip6_dst_lookup(ctl_sk, &buff->dst, &fl)) { | 1021 | if (!ip6_dst_lookup(ctl_sk, &buff->dst, &fl)) { |
1021 | if (xfrm_lookup(&buff->dst, &fl, NULL, 0) >= 0) { | 1022 | if (xfrm_lookup(net, &buff->dst, &fl, NULL, 0) >= 0) { |
1022 | ip6_xmit(ctl_sk, buff, &fl, NULL, 0); | 1023 | ip6_xmit(ctl_sk, buff, &fl, NULL, 0); |
1023 | TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS); | 1024 | TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS); |
1024 | if (rst) | 1025 | if (rst) |
@@ -1316,7 +1317,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
1316 | if (final_p) | 1317 | if (final_p) |
1317 | ipv6_addr_copy(&fl.fl6_dst, final_p); | 1318 | ipv6_addr_copy(&fl.fl6_dst, final_p); |
1318 | 1319 | ||
1319 | if ((xfrm_lookup(&dst, &fl, sk, 0)) < 0) | 1320 | if ((xfrm_lookup(sock_net(sk), &dst, &fl, sk, 0)) < 0) |
1320 | goto out; | 1321 | goto out; |
1321 | } | 1322 | } |
1322 | 1323 | ||