aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_policy.c
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2013-08-27 07:43:30 -0400
committerSteffen Klassert <steffen.klassert@secunet.com>2013-12-06 01:24:31 -0500
commit5b8ef3415a21f173ab115e90ec92c071a03f22d7 (patch)
treebb78d47430f22c24030375aeb2b358d8e38ddd18 /net/xfrm/xfrm_policy.c
parent283bc9f35bbbcb0e9ab4e6d2427da7f9f710d52d (diff)
xfrm: Remove ancient sleeping when the SA is in acquire state
We now queue packets to the policy if the states are not yet resolved, this replaces the ancient sleeping code. Also the sleeping can cause indefinite task hangs if the needed state does not get resolved. Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm/xfrm_policy.c')
-rw-r--r--net/xfrm/xfrm_policy.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 73b04d3df44e..a7487f34e813 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1901,8 +1901,7 @@ static struct xfrm_dst *xfrm_create_dummy_bundle(struct net *net,
1901 if (IS_ERR(xdst)) 1901 if (IS_ERR(xdst))
1902 return xdst; 1902 return xdst;
1903 1903
1904 if (net->xfrm.sysctl_larval_drop || num_xfrms <= 0 || 1904 if (net->xfrm.sysctl_larval_drop || num_xfrms <= 0)
1905 (fl->flowi_flags & FLOWI_FLAG_CAN_SLEEP))
1906 return xdst; 1905 return xdst;
1907 1906
1908 dst1 = &xdst->u.dst; 1907 dst1 = &xdst->u.dst;
@@ -2077,7 +2076,6 @@ struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig,
2077 u8 dir = policy_to_flow_dir(XFRM_POLICY_OUT); 2076 u8 dir = policy_to_flow_dir(XFRM_POLICY_OUT);
2078 int i, err, num_pols, num_xfrms = 0, drop_pols = 0; 2077 int i, err, num_pols, num_xfrms = 0, drop_pols = 0;
2079 2078
2080restart:
2081 dst = NULL; 2079 dst = NULL;
2082 xdst = NULL; 2080 xdst = NULL;
2083 route = NULL; 2081 route = NULL;
@@ -2157,23 +2155,8 @@ restart:
2157 2155
2158 return make_blackhole(net, family, dst_orig); 2156 return make_blackhole(net, family, dst_orig);
2159 } 2157 }
2160 if (fl->flowi_flags & FLOWI_FLAG_CAN_SLEEP) {
2161 DECLARE_WAITQUEUE(wait, current);
2162 2158
2163 add_wait_queue(&net->xfrm.km_waitq, &wait); 2159 err = -EAGAIN;
2164 set_current_state(TASK_INTERRUPTIBLE);
2165 schedule();
2166 set_current_state(TASK_RUNNING);
2167 remove_wait_queue(&net->xfrm.km_waitq, &wait);
2168
2169 if (!signal_pending(current)) {
2170 dst_release(dst);
2171 goto restart;
2172 }
2173
2174 err = -ERESTART;
2175 } else
2176 err = -EAGAIN;
2177 2160
2178 XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTNOSTATES); 2161 XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTNOSTATES);
2179 goto error; 2162 goto error;