Merge git://oss.sgi.com:8090/xfs/xfs-2.6
[linux-drm-fsl-dcu.git] / net / ipv4 / netfilter / ip_conntrack_standalone.c
index 7bd3c22003a20a84b9e92479db92a0c1b871edcf..5903588fddceec2090954b2fc5cdbcf1f424f38d 100644 (file)
 #include <net/ip.h>
 #include <net/route.h>
 
-#define ASSERT_READ_LOCK(x)
-#define ASSERT_WRITE_LOCK(x)
-
 #include <linux/netfilter_ipv4/ip_conntrack.h>
 #include <linux/netfilter_ipv4/ip_conntrack_protocol.h>
 #include <linux/netfilter_ipv4/ip_conntrack_core.h>
 #include <linux/netfilter_ipv4/ip_conntrack_helper.h>
-#include <linux/netfilter_ipv4/listhelp.h>
 
 #if 0
 #define DEBUGP printk
@@ -50,7 +46,7 @@ DECLARE_PER_CPU(struct ip_conntrack_stat, ip_conntrack_stat);
 
 static int kill_proto(struct ip_conntrack *i, void *data)
 {
-       return (i->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum == 
+       return (i->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum ==
                        *((u_int8_t *) data));
 }
 
@@ -128,19 +124,18 @@ static void *ct_seq_next(struct seq_file *s, void *v, loff_t *pos)
        (*pos)++;
        return ct_get_next(s, v);
 }
-  
+
 static void ct_seq_stop(struct seq_file *s, void *v)
 {
        read_unlock_bh(&ip_conntrack_lock);
 }
+
 static int ct_seq_show(struct seq_file *s, void *v)
 {
        const struct ip_conntrack_tuple_hash *hash = v;
        const struct ip_conntrack *conntrack = tuplehash_to_ctrack(hash);
        struct ip_conntrack_protocol *proto;
 
-       ASSERT_READ_LOCK(&ip_conntrack_lock);
        IP_NF_ASSERT(conntrack);
 
        /* we only want to print DIR_ORIGINAL */
@@ -160,12 +155,12 @@ static int ct_seq_show(struct seq_file *s, void *v)
 
        if (proto->print_conntrack(s, conntrack))
                return -ENOSPC;
-  
+
        if (print_tuple(s, &conntrack->tuplehash[IP_CT_DIR_ORIGINAL].tuple,
                        proto))
                return -ENOSPC;
 
-       if (seq_print_counters(s, &conntrack->counters[IP_CT_DIR_ORIGINAL]))
+       if (seq_print_counters(s, &conntrack->counters[IP_CT_DIR_ORIGINAL]))
                return -ENOSPC;
 
        if (!(test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status)))
@@ -176,7 +171,7 @@ static int ct_seq_show(struct seq_file *s, void *v)
                        proto))
                return -ENOSPC;
 
-       if (seq_print_counters(s, &conntrack->counters[IP_CT_DIR_REPLY]))
+       if (seq_print_counters(s, &conntrack->counters[IP_CT_DIR_REPLY]))
                return -ENOSPC;
 
        if (test_bit(IPS_ASSURED_BIT, &conntrack->status))
@@ -205,7 +200,7 @@ static struct seq_operations ct_seq_ops = {
        .stop  = ct_seq_stop,
        .show  = ct_seq_show
 };
-  
+
 static int ct_open(struct inode *inode, struct file *file)
 {
        struct seq_file *seq;
@@ -234,7 +229,7 @@ static struct file_operations ct_file_ops = {
        .llseek  = seq_lseek,
        .release = seq_release_private,
 };
-  
+
 /* expects */
 static void *exp_seq_start(struct seq_file *s, loff_t *pos)
 {
@@ -258,7 +253,7 @@ static void *exp_seq_start(struct seq_file *s, loff_t *pos)
 
 static void *exp_seq_next(struct seq_file *s, void *v, loff_t *pos)
 {
-       struct list_head *e = v;
+       struct list_head *e = v;
 
        ++*pos;
        e = e->next;
@@ -302,7 +297,7 @@ static int exp_open(struct inode *inode, struct file *file)
 {
        return seq_open(file, &exp_seq_ops);
 }
-  
+
 static struct file_operations exp_file_ops = {
        .owner   = THIS_MODULE,
        .open    = exp_open,
@@ -431,14 +426,14 @@ static unsigned int ip_conntrack_help(unsigned int hooknum,
 }
 
 static unsigned int ip_conntrack_defrag(unsigned int hooknum,
-                                       struct sk_buff **pskb,
-                                       const struct net_device *in,
-                                       const struct net_device *out,
-                                       int (*okfn)(struct sk_buff *))
+                                       struct sk_buff **pskb,
+                                       const struct net_device *in,
+                                       const struct net_device *out,
+                                       int (*okfn)(struct sk_buff *))
 {
 #if !defined(CONFIG_IP_NF_NAT) && !defined(CONFIG_IP_NF_NAT_MODULE)
        /* Previously seen (loopback)?  Ignore.  Do this before
-           fragment check. */
+          fragment check. */
        if ((*pskb)->nfct)
                return NF_ACCEPT;
 #endif
@@ -446,7 +441,7 @@ static unsigned int ip_conntrack_defrag(unsigned int hooknum,
        /* Gather fragments. */
        if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) {
                *pskb = ip_ct_gather_frags(*pskb,
-                                          hooknum == NF_IP_PRE_ROUTING ? 
+                                          hooknum == NF_IP_PRE_ROUTING ?
                                           IP_DEFRAG_CONNTRACK_IN :
                                           IP_DEFRAG_CONNTRACK_OUT);
                if (!*pskb)
@@ -534,6 +529,8 @@ static struct nf_hook_ops ip_conntrack_ops[] = {
 
 /* Sysctl support */
 
+int ip_conntrack_checksum __read_mostly = 1;
+
 #ifdef CONFIG_SYSCTL
 
 /* From ip_conntrack_core.c */
@@ -561,15 +558,13 @@ extern unsigned int ip_ct_udp_timeout_stream;
 /* From ip_conntrack_proto_icmp.c */
 extern unsigned int ip_ct_icmp_timeout;
 
-/* From ip_conntrack_proto_icmp.c */
+/* From ip_conntrack_proto_generic.c */
 extern unsigned int ip_ct_generic_timeout;
 
 /* Log invalid packets of a given protocol */
 static int log_invalid_proto_min = 0;
 static int log_invalid_proto_max = 255;
 
-int ip_conntrack_checksum = 1;
-
 static struct ctl_table_header *ip_ct_sysctl_header;
 
 static ctl_table ip_ct_sysctl_table[] = {
@@ -781,7 +776,7 @@ static ctl_table ip_ct_net_table[] = {
        {
                .ctl_name       = CTL_NET,
                .procname       = "net",
-               .mode           = 0555, 
+               .mode           = 0555,
                .child          = ip_ct_ipv4_table,
        },
        { .ctl_name = 0 }
@@ -927,7 +922,7 @@ EXPORT_SYMBOL(__ip_ct_refresh_acct);
 EXPORT_SYMBOL(ip_conntrack_expect_alloc);
 EXPORT_SYMBOL(ip_conntrack_expect_put);
 EXPORT_SYMBOL_GPL(__ip_conntrack_expect_find);
-EXPORT_SYMBOL_GPL(ip_conntrack_expect_find);
+EXPORT_SYMBOL_GPL(ip_conntrack_expect_find_get);
 EXPORT_SYMBOL(ip_conntrack_expect_related);
 EXPORT_SYMBOL(ip_conntrack_unexpect_related);
 EXPORT_SYMBOL_GPL(ip_conntrack_expect_list);