]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/netfilter/xt_connbytes.c
netfilter: xtables: shorten up return clause
[net-next-2.6.git] / net / netfilter / xt_connbytes.c
index 955e6598a7f0a9fc02d4ed2f52425178a1706cb2..ff738a5f963a72e4591468cfe5c9e9d5fc7844c1 100644 (file)
@@ -1,6 +1,7 @@
 /* Kernel module to match connection tracking byte counter.
  * GPL (C) 2002 Martin Devera (devik@cdi.cz).
  */
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 #include <linux/module.h>
 #include <linux/bitops.h>
 #include <linux/skbuff.h>
@@ -92,27 +93,26 @@ connbytes_mt(const struct sk_buff *skb, const struct xt_match_param *par)
                return what >= sinfo->count.from;
 }
 
-static bool connbytes_mt_check(const struct xt_mtchk_param *par)
+static int connbytes_mt_check(const struct xt_mtchk_param *par)
 {
        const struct xt_connbytes_info *sinfo = par->matchinfo;
+       int ret;
 
        if (sinfo->what != XT_CONNBYTES_PKTS &&
            sinfo->what != XT_CONNBYTES_BYTES &&
            sinfo->what != XT_CONNBYTES_AVGPKT)
-               return false;
+               return -EINVAL;
 
        if (sinfo->direction != XT_CONNBYTES_DIR_ORIGINAL &&
            sinfo->direction != XT_CONNBYTES_DIR_REPLY &&
            sinfo->direction != XT_CONNBYTES_DIR_BOTH)
-               return false;
-
-       if (nf_ct_l3proto_try_module_get(par->family) < 0) {
-               printk(KERN_WARNING "can't load conntrack support for "
-                                   "proto=%u\n", par->family);
-               return false;
-       }
+               return -EINVAL;
 
-       return true;
+       ret = nf_ct_l3proto_try_module_get(par->family);
+       if (ret < 0)
+               pr_info("cannot load conntrack support for proto=%u\n",
+                       par->family);
+       return ret;
 }
 
 static void connbytes_mt_destroy(const struct xt_mtdtor_param *par)