]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/netfilter/xt_rateest.c
netfilter: xtables: slightly better error reporting
[net-next-2.6.git] / net / netfilter / xt_rateest.c
index 4fc6a917f6de5b30d55de8dba82531be03e67826..23805f8a444bc005662c80d9bb5e34c4baf60f2c 100644 (file)
@@ -74,10 +74,11 @@ xt_rateest_mt(const struct sk_buff *skb, const struct xt_match_param *par)
        return ret;
 }
 
-static bool xt_rateest_mt_checkentry(const struct xt_mtchk_param *par)
+static int xt_rateest_mt_checkentry(const struct xt_mtchk_param *par)
 {
        struct xt_rateest_match_info *info = par->matchinfo;
        struct xt_rateest *est1, *est2;
+       int ret = false;
 
        if (hweight32(info->flags & (XT_RATEEST_MATCH_ABS |
                                     XT_RATEEST_MATCH_REL)) != 1)
@@ -95,6 +96,7 @@ static bool xt_rateest_mt_checkentry(const struct xt_mtchk_param *par)
                goto err1;
        }
 
+       ret  = -ENOENT;
        est1 = xt_rateest_lookup(info->name1);
        if (!est1)
                goto err1;
@@ -109,12 +111,12 @@ static bool xt_rateest_mt_checkentry(const struct xt_mtchk_param *par)
 
        info->est1 = est1;
        info->est2 = est2;
-       return true;
+       return 0;
 
 err2:
        xt_rateest_put(est1);
 err1:
-       return false;
+       return -EINVAL;
 }
 
 static void xt_rateest_mt_destroy(const struct xt_mtdtor_param *par)