Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
[powerpc.git] / net / netfilter / nf_conntrack_core.c
index 2b0cc7a..e132c8a 100644 (file)
@@ -9,24 +9,6 @@
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
- *
- * 23 Apr 2001: Harald Welte <laforge@gnumonks.org>
- *     - new API and handling of conntrack/nat helpers
- *     - now capable of multiple expectations for one master
- * 16 Jul 2002: Harald Welte <laforge@gnumonks.org>
- *     - add usage/reference counts to ip_conntrack_expect
- *     - export ip_conntrack[_expect]_{find_get,put} functions
- * 16 Dec 2003: Yasuyuki Kozakai @USAGI <yasuyuki.kozakai@toshiba.co.jp>
- *     - generalize L3 protocol denendent part.
- * 23 Mar 2004: Yasuyuki Kozakai @USAGI <yasuyuki.kozakai@toshiba.co.jp>
- *     - add support various size of conntrack structures.
- * 26 Jan 2006: Harald Welte <laforge@netfilter.org>
- *     - restructure nf_conn (introduce nf_conn_help)
- *     - redesign 'features' how they were originally intended
- * 26 Feb 2006: Pablo Neira Ayuso <pablo@eurodev.net>
- *     - add support for L3 protocol module load on demand.
- *
- * Derived from net/ipv4/netfilter/ip_conntrack_core.c
  */
 
 #include <linux/types.h>
@@ -634,13 +616,11 @@ __nf_conntrack_alloc(const struct nf_conntrack_tuple *orig,
        memset(conntrack, 0, nf_ct_cache[features].size);
        conntrack->features = features;
        atomic_set(&conntrack->ct_general.use, 1);
-       conntrack->ct_general.destroy = destroy_conntrack;
        conntrack->tuplehash[IP_CT_DIR_ORIGINAL].tuple = *orig;
        conntrack->tuplehash[IP_CT_DIR_REPLY].tuple = *repl;
        /* Don't set timer yet: wait for confirmation */
-       init_timer(&conntrack->timeout);
-       conntrack->timeout.data = (unsigned long)conntrack;
-       conntrack->timeout.function = death_by_timeout;
+       setup_timer(&conntrack->timeout, death_by_timeout,
+                   (unsigned long)conntrack);
        read_unlock_bh(&nf_ct_cache_lock);
 
        return conntrack;
@@ -1141,6 +1121,8 @@ void nf_conntrack_cleanup(void)
        while (atomic_read(&nf_conntrack_untracked.ct_general.use) > 1)
                schedule();
 
+       rcu_assign_pointer(nf_ct_destroy, NULL);
+
        for (i = 0; i < NF_CT_F_NUM; i++) {
                if (nf_ct_cache[i].use == 0)
                        continue;
@@ -1278,6 +1260,7 @@ int __init nf_conntrack_init(void)
 
        /* For use by REJECT target */
        rcu_assign_pointer(ip_ct_attach, __nf_conntrack_attach);
+       rcu_assign_pointer(nf_ct_destroy, destroy_conntrack);
 
        /* Set up fake conntrack:
            - to never be deleted, not in any hashes */