/* ip_conntrack_standalone needs this */
atomic_t ip_conntrack_count = ATOMIC_INIT(0);
+EXPORT_SYMBOL(ip_conntrack_count);
void (*ip_conntrack_destroyed)(struct ip_conntrack *conntrack) = NULL;
LIST_HEAD(ip_conntrack_expect_list);
}
kmem_cache_free(ip_conntrack_expect_cachep, ct->master);
}
- CONNTRACK_STAT_INC(delete);
WRITE_UNLOCK(&ip_conntrack_lock);
if (master)
DEBUGP("destroy_conntrack: returning ct=%p to slab\n", ct);
kmem_cache_free(ip_conntrack_cachep, ct);
atomic_dec(&ip_conntrack_count);
+ CONNTRACK_STAT_INC(delete);
}
static void death_by_timeout(unsigned long ul_conntrack)
{
struct ip_conntrack *ct = (void *)ul_conntrack;
- WRITE_LOCK(&ip_conntrack_lock);
- /* Inside lock so preempt is disabled on module removal path.
- * Otherwise we can get spurious warnings. */
CONNTRACK_STAT_INC(delete_list);
+
+ WRITE_LOCK(&ip_conntrack_lock);
clean_from_lists(ct);
WRITE_UNLOCK(&ip_conntrack_lock);
ip_conntrack_put(ct);
{
struct ip_conntrack_tuple_hash *h;
unsigned int hash = hash_conntrack(tuple);
+ /* use per_cpu() to avoid multiple calls to smp_processor_id() */
+ unsigned int cpu = smp_processor_id();
MUST_BE_READ_LOCKED(&ip_conntrack_lock);
list_for_each_entry(h, &ip_conntrack_hash[hash], list) {
if (conntrack_tuple_cmp(h, tuple, ignored_conntrack)) {
- CONNTRACK_STAT_INC(found);
+ per_cpu(ip_conntrack_stat, cpu).found++;
return h;
}
- CONNTRACK_STAT_INC(searched);
+ per_cpu(ip_conntrack_stat, cpu).searched++;
}
return NULL;
add_timer(&ct->timeout);
atomic_inc(&ct->ct_general.use);
set_bit(IPS_CONFIRMED_BIT, &ct->status);
- CONNTRACK_STAT_INC(insert);
WRITE_UNLOCK(&ip_conntrack_lock);
+ CONNTRACK_STAT_INC(insert);
return NF_ACCEPT;
}
- CONNTRACK_STAT_INC(insert_failed);
WRITE_UNLOCK(&ip_conntrack_lock);
-
+ CONNTRACK_STAT_INC(insert_failed);
return NF_DROP;
}
conntrack->ct_general.destroy = destroy_conntrack;
conntrack->tuplehash[IP_CT_DIR_ORIGINAL].tuple = *tuple;
conntrack->tuplehash[IP_CT_DIR_ORIGINAL].ctrack = conntrack;
+ conntrack->xid[IP_CT_DIR_ORIGINAL] = -1;
conntrack->tuplehash[IP_CT_DIR_REPLY].tuple = repl_tuple;
conntrack->tuplehash[IP_CT_DIR_REPLY].ctrack = conntrack;
-#if defined(CONFIG_VNET) || defined(CONFIG_VNET_MODULE)
- conntrack->xid[IP_CT_DIR_ORIGINAL] = -1;
conntrack->xid[IP_CT_DIR_REPLY] = -1;
+
+#warning MEF removed initialization of conntrack->infos structure, as this structure no longer exists in 2.6.9-1.11_FC.
+#if 0
+ for (i=0; i < IP_CT_NUMBER; i++)
+ conntrack->infos[i].master = &conntrack->ct_general;
#endif
if (!protocol->new(conntrack, skb)) {
__set_bit(IPS_EXPECTED_BIT, &conntrack->status);
conntrack->master = expected;
expected->sibling = conntrack;
-#if CONFIG_IP_NF_CONNTRACK_MARK
- conntrack->mark = expected->expectant->mark;
-#endif
LIST_DELETE(&ip_conntrack_expect_list, expected);
expected->expectant->expecting--;
nf_conntrack_get(&master_ct(conntrack)->ct_general);