diff options
author | David S. Miller <davem@davemloft.net> | 2010-02-17 16:41:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-17 16:41:40 -0500 |
commit | 069c474e88bb7753183f1eadbd7786c27888c8e3 (patch) | |
tree | 09b0385d34a2d0b302b1f61a2783bfcdc510732f /net/xfrm/xfrm_state.c | |
parent | 08326dbe7b5825295ec3711eec53b093549749e5 (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.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 9fa3322b2a7d..c9d6a5f1348d 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 | |||
603 | 603 | ||
604 | int xfrm_state_flush(struct net *net, u8 proto, struct xfrm_audit *audit_info) | 604 | int xfrm_state_flush(struct net *net, u8 proto, struct xfrm_audit *audit_info) |
605 | { | 605 | { |
606 | int i, err = 0, cnt = 0; | 606 | int i, err = 0; |
607 | 607 | ||
608 | spin_lock_bh(&xfrm_state_lock); | 608 | spin_lock_bh(&xfrm_state_lock); |
609 | err = xfrm_state_flush_secctx_check(net, proto, audit_info); | 609 | err = xfrm_state_flush_secctx_check(net, proto, audit_info); |
610 | if (err) | 610 | if (err) |
611 | goto out; | 611 | goto out; |
612 | 612 | ||
613 | err = -ESRCH; | ||
614 | for (i = 0; i <= net->xfrm.state_hmask; i++) { | 613 | for (i = 0; i <= net->xfrm.state_hmask; i++) { |
615 | struct hlist_node *entry; | 614 | struct hlist_node *entry; |
616 | struct xfrm_state *x; | 615 | struct xfrm_state *x; |
@@ -627,16 +626,13 @@ restart: | |||
627 | audit_info->sessionid, | 626 | audit_info->sessionid, |
628 | audit_info->secid); | 627 | audit_info->secid); |
629 | xfrm_state_put(x); | 628 | xfrm_state_put(x); |
630 | if (!err) | ||
631 | cnt++; | ||
632 | 629 | ||
633 | spin_lock_bh(&xfrm_state_lock); | 630 | spin_lock_bh(&xfrm_state_lock); |
634 | goto restart; | 631 | goto restart; |
635 | } | 632 | } |
636 | } | 633 | } |
637 | } | 634 | } |
638 | if (cnt) | 635 | err = 0; |
639 | err = 0; | ||
640 | 636 | ||
641 | out: | 637 | out: |
642 | spin_unlock_bh(&xfrm_state_lock); | 638 | spin_unlock_bh(&xfrm_state_lock); |