Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4e1d4e6c5a448bd114e0cef6311c974cb7c7385e
Commit:     4e1d4e6c5a448bd114e0cef6311c974cb7c7385e
Parent:     d4156e8cd93f5772483928aaf4960120caebd789
Author:     Patrick McHardy <[EMAIL PROTECTED]>
AuthorDate: Sat Jul 7 22:32:03 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Tue Jul 10 22:17:56 2007 -0700

    [NETFILTER]: nf_conntrack_expect: avoid useless list walking
    
    Don't walk the list when unexpecting an expectation, we already
    have a reference and the timer check is enough to guarantee
    that it still is on the list.
    
    This comment suggests that it was copied there by mistake from
    expectation eviction:
    
    /* choose the oldest expectation to evict */
    
    Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/netfilter/nf_conntrack_expect.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/net/netfilter/nf_conntrack_expect.c 
b/net/netfilter/nf_conntrack_expect.c
index 83b5ad8..5c8cb0f 100644
--- a/net/netfilter/nf_conntrack_expect.c
+++ b/net/netfilter/nf_conntrack_expect.c
@@ -165,17 +165,10 @@ static inline int expect_matches(const struct 
nf_conntrack_expect *a,
 /* Generally a bad idea to call this: could have matched already. */
 void nf_ct_unexpect_related(struct nf_conntrack_expect *exp)
 {
-       struct nf_conntrack_expect *i;
-
        write_lock_bh(&nf_conntrack_lock);
-       /* choose the oldest expectation to evict */
-       list_for_each_entry_reverse(i, &nf_ct_expect_list, list) {
-               if (expect_matches(i, exp) && del_timer(&i->timeout)) {
-                       nf_ct_unlink_expect(i);
-                       write_unlock_bh(&nf_conntrack_lock);
-                       nf_ct_expect_put(i);
-                       return;
-               }
+       if (del_timer(&exp->timeout)) {
+               nf_ct_unlink_expect(exp);
+               nf_ct_expect_put(exp);
        }
        write_unlock_bh(&nf_conntrack_lock);
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to