netfilter: nf_ct_expect: Add nf_ct_remove_expect()
[linux-2.6-block.git] / net / netfilter / nf_conntrack_sip.c
index 24174c5202398fa28287db69b570a12db15c1771..91a9c97b7e9a5eef38db64c2fe4b4b50215cdc77 100644 (file)
@@ -829,10 +829,8 @@ static void flush_expectations(struct nf_conn *ct, bool media)
        hlist_for_each_entry_safe(exp, next, &help->expectations, lnode) {
                if ((exp->class != SIP_EXPECT_SIGNALLING) ^ media)
                        continue;
-               if (!del_timer(&exp->timeout))
+               if (!nf_ct_remove_expect(exp))
                        continue;
-               nf_ct_unlink_expect(exp);
-               nf_ct_expect_put(exp);
                if (!media)
                        break;
        }
@@ -1628,8 +1626,6 @@ static int __init nf_conntrack_sip_init(void)
                ports[ports_c++] = SIP_PORT;
 
        for (i = 0; i < ports_c; i++) {
-               memset(&sip[i], 0, sizeof(sip[i]));
-
                nf_ct_helper_init(&sip[4 * i], AF_INET, IPPROTO_UDP, "sip",
                                  SIP_PORT, ports[i], i, sip_exp_policy,
                                  SIP_EXPECT_MAX,