Merge branch 'master' of /repos/git/net-next-2.6
[cascardo/linux.git] / net / netfilter / xt_dccp.c
index 395af59..0d260ae 100644 (file)
@@ -124,13 +124,17 @@ dccp_mt(const struct sk_buff *skb, const struct xt_match_param *par)
                           XT_DCCP_OPTION, info->flags, info->invflags);
 }
 
-static bool dccp_mt_check(const struct xt_mtchk_param *par)
+static int dccp_mt_check(const struct xt_mtchk_param *par)
 {
        const struct xt_dccp_info *info = par->matchinfo;
 
-       return !(info->flags & ~XT_DCCP_VALID_FLAGS)
-               && !(info->invflags & ~XT_DCCP_VALID_FLAGS)
-               && !(info->invflags & ~info->flags);
+       if (info->flags & ~XT_DCCP_VALID_FLAGS)
+               return -EINVAL;
+       if (info->invflags & ~XT_DCCP_VALID_FLAGS)
+               return -EINVAL;
+       if (info->invflags & ~info->flags)
+               return -EINVAL;
+       return 0;
 }
 
 static struct xt_match dccp_mt_reg[] __read_mostly = {