according to 2.4 destroy_conntrack's optimization
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); }
}