netfilter: xtables: change matches to return error code
[pandora-kernel.git] / net / ipv6 / netfilter / ip6t_ah.c
index ac0b7c6..1580693 100644 (file)
@@ -6,7 +6,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 #include <linux/module.h>
 #include <linux/skbuff.h>
 #include <linux/ip.h>
@@ -29,7 +29,7 @@ spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert)
 {
        bool r;
 
-       pr_debug("ah spi_match:%c 0x%x <= 0x%x <= 0x%x",
+       pr_debug("spi_match:%c 0x%x <= 0x%x <= 0x%x\n",
                 invert ? '!' : ' ', min, spi, max);
        r = (spi >= min && spi <= max) ^ invert;
        pr_debug(" result %s\n", r ? "PASS" : "FAILED");
@@ -87,15 +87,15 @@ static bool ah_mt6(const struct sk_buff *skb, const struct xt_match_param *par)
                !(ahinfo->hdrres && ah->reserved);
 }
 
-static bool ah_mt6_check(const struct xt_mtchk_param *par)
+static int ah_mt6_check(const struct xt_mtchk_param *par)
 {
        const struct ip6t_ah *ahinfo = par->matchinfo;
 
        if (ahinfo->invflags & ~IP6T_AH_INV_MASK) {
-               pr_debug("ip6t_ah: unknown flags %X\n", ahinfo->invflags);
-               return false;
+               pr_debug("unknown flags %X\n", ahinfo->invflags);
+               return -EINVAL;
        }
-       return true;
+       return 0;
 }
 
 static struct xt_match ah_mt6_reg __read_mostly = {