From mboxrd@z Thu Jan 1 00:00:00 1970 From: JessePeng Subject: according to 2.4 destroy_conntrack's optimization Date: Thu, 13 Nov 2003 19:46:24 +0800 Sender: netfilter-devel-admin@lists.netfilter.org Message-ID: <3FB36F10.2030004@deansoft.com.tw> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------000803080500060309020207" Return-path: To: netfilter-devel@lists.netfilter.org Errors-To: netfilter-devel-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: List-Id: netfilter-devel.vger.kernel.org --------------000803080500060309020207 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit shoud we add one line to the remove_expectations() as the following: 1.the one line as: ip_conntrack_put(ct); 2.the new remove_expectations() as: static void remove_expectations(struct ip_conntrack *ct) { struct list_head *exp_entry, *next; struct ip_conntrack_expect *exp; DEBUGP("remove_expectations(%p)\n", ct); for (exp_entry = ct->sibling_list.next; exp_entry != &ct->sibling_list; exp_entry = next) { next = exp_entry->next; exp = list_entry(exp_entry, struct ip_conntrack_expect, expected_list); /* we skip established expectations, as we want to delete * the un-established ones only */ if (exp->sibling) { DEBUGP("remove_expectations: skipping established %p of %p\n", exp->sibling, ct); /* Indicate that this expectations parent is dead */ exp->expectant = NULL; /* here we let the use -1,otherwise some day the child connection die, he'll fail to put his parent's ct use, * so I'm afraid that this ct cache will hang forever!!!*/ ip_conntrack_put(ct); ;-) continue; } IP_NF_ASSERT(list_inlist(&ip_conntrack_expect_list, exp)); IP_NF_ASSERT(exp->expectant == ct); /* delete expectation from global and private lists */ unexpect_related(exp); } } --------------000803080500060309020207 Content-Type: multipart/related; boundary="------------070809090804010001080405" --------------070809090804010001080405 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit shoud we add one line to the remove_expectations() as the following:
1.the one line as:
       ip_conntrack_put(ct);

2.the new remove_expectations() as:
static void remove_expectations(struct ip_conntrack *ct)
{
    struct list_head *exp_entry, *next;
    struct ip_conntrack_expect *exp;

    DEBUGP("remove_expectations(%p)\n", ct);

    for (exp_entry = ct->sibling_list.next;
         exp_entry != &ct->sibling_list; exp_entry = next) {
        next = exp_entry->next;
        exp = list_entry(exp_entry, struct ip_conntrack_expect,
                 expected_list);

        /* we skip established expectations, as we want to delete
         * the un-established ones only */
        if (exp->sibling) {
            DEBUGP("remove_expectations: skipping established %p of %p\n", exp->sibling, ct);
            /* Indicate that this expectations parent is dead */
            exp->expectant = NULL;

        /* here we let the use -1,otherwise some day the child connection die, he'll fail to put his parent's ct use,
         * so I'm afraid that this ct cache will hang forever!!!*/
            ip_conntrack_put(ct); ;-)

            continue;
        }

        IP_NF_ASSERT(list_inlist(&ip_conntrack_expect_list, exp));
        IP_NF_ASSERT(exp->expectant == ct);

        /* delete expectation from global and private lists */
        unexpect_related(exp);
    }
}   --------------070809090804010001080405-- --------------000803080500060309020207--