aboutsummaryrefslogtreecommitdiff
path: root/net/xfrm/xfrm_state.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-02-17 13:41:40 -0800
committerDavid S. Miller <davem@davemloft.net>2010-02-17 13:41:40 -0800
commit069c474e88bb7753183f1eadbd7786c27888c8e3 (patch)
tree09b0385d34a2d0b302b1f61a2783bfcdc510732f /net/xfrm/xfrm_state.c
parent08326dbe7b5825295ec3711eec53b093549749e5 (diff)
xfrm: Revert false event eliding commits.
As reported by Alexey Dobriyan: -------------------- setkey now takes several seconds to run this simple script and it spits "recv: Resource temporarily unavailable" messages. #!/usr/sbin/setkey -f flush; spdflush; add A B ipcomp 44 -m tunnel -C deflate; add B A ipcomp 45 -m tunnel -C deflate; spdadd A B any -P in ipsec ipcomp/tunnel/192.168.1.2-192.168.1.3/use; spdadd B A any -P out ipsec ipcomp/tunnel/192.168.1.3-192.168.1.2/use; -------------------- Obviously applications want the events even when the table is empty. So we cannot make this behavioral change. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm/xfrm_state.c')
-rw-r--r--net/xfrm/xfrm_state.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 9fa3322b2a7..c9d6a5f1348 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -603,14 +603,13 @@ xfrm_state_flush_secctx_check(struct net *net, u8 proto, struct xfrm_audit *audi
int xfrm_state_flush(struct net *net, u8 proto, struct xfrm_audit *audit_info)
{
- int i, err = 0, cnt = 0;
+ int i, err = 0;
spin_lock_bh(&xfrm_state_lock);
err = xfrm_state_flush_secctx_check(net, proto, audit_info);
if (err)
goto out;
- err = -ESRCH;
for (i = 0; i <= net->xfrm.state_hmask; i++) {
struct hlist_node *entry;
struct xfrm_state *x;
@@ -627,16 +626,13 @@ restart:
audit_info->sessionid,
audit_info->secid);
xfrm_state_put(x);
- if (!err)
- cnt++;
spin_lock_bh(&xfrm_state_lock);
goto restart;
}
}
}
- if (cnt)
- err = 0;
+ err = 0;
out:
spin_unlock_bh(&xfrm_state_lock);