]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/netfilter/nf_conntrack_standalone.c
Use WARN() in fs/
[linux-2.6-omap-h63xx.git] / net / netfilter / nf_conntrack_standalone.c
index 46ea542d0df999d8fdaaecabac5eaf7340ee8342..869ef9349d0f1c748e3ec7a4619827c9759ccef7 100644 (file)
@@ -25,6 +25,7 @@
 #include <net/netfilter/nf_conntrack_l4proto.h>
 #include <net/netfilter/nf_conntrack_expect.h>
 #include <net/netfilter/nf_conntrack_helper.h>
+#include <net/netfilter/nf_conntrack_acct.h>
 
 MODULE_LICENSE("GPL");
 
@@ -38,19 +39,6 @@ print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple,
 }
 EXPORT_SYMBOL_GPL(print_tuple);
 
-#ifdef CONFIG_NF_CT_ACCT
-static unsigned int
-seq_print_counters(struct seq_file *s,
-                  const struct ip_conntrack_counter *counter)
-{
-       return seq_printf(s, "packets=%llu bytes=%llu ",
-                         (unsigned long long)counter->packets,
-                         (unsigned long long)counter->bytes);
-}
-#else
-#define seq_print_counters(x, y)       0
-#endif
-
 struct ct_iter_state {
        unsigned int bucket;
 };
@@ -146,7 +134,7 @@ static int ct_seq_show(struct seq_file *s, void *v)
                        l3proto, l4proto))
                return -ENOSPC;
 
-       if (seq_print_counters(s, &ct->counters[IP_CT_DIR_ORIGINAL]))
+       if (seq_print_acct(s, ct, IP_CT_DIR_ORIGINAL))
                return -ENOSPC;
 
        if (!(test_bit(IPS_SEEN_REPLY_BIT, &ct->status)))
@@ -157,7 +145,7 @@ static int ct_seq_show(struct seq_file *s, void *v)
                        l3proto, l4proto))
                return -ENOSPC;
 
-       if (seq_print_counters(s, &ct->counters[IP_CT_DIR_REPLY]))
+       if (seq_print_acct(s, ct, IP_CT_DIR_REPLY))
                return -ENOSPC;
 
        if (test_bit(IPS_ASSURED_BIT, &ct->status))