]> granicus.if.org Git - ipset/commitdiff
Use meaningful error messages in xt_set.c
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Wed, 26 Jan 2011 22:22:58 +0000 (23:22 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Wed, 26 Jan 2011 22:22:58 +0000 (23:22 +0100)
Old cryptic error messages are not useful (Patrick McHardy's review)

kernel/xt_set.c

index cc132f7eacfdd80eebda4a849ecff7cea343bb48..83239199a37afa4c85820a36bdd32dd186f7eceb 100644 (file)
@@ -113,7 +113,8 @@ set_match_v0_checkentry(const struct xt_mtchk_param *par)
                return CHECK_FAIL;      /* error */
        }
        if (info->match_set.u.flags[IPSET_DIM_MAX-1] != 0) {
-               pr_warning("That's nasty!\n");
+               pr_warning("Protocol error: set match dimension "
+                          "is over the limit!\n");
                return CHECK_FAIL;      /* error */
        }
 
@@ -167,7 +168,7 @@ set_target_v0_checkentry(const struct xt_tgchk_param *par)
        if (info->add_set.index != IPSET_INVALID_ID) {
                index = ip_set_nfnl_get_byindex(info->add_set.index);
                if (index == IPSET_INVALID_ID) {
-                       pr_warning("cannot find add_set index %u as target\n",
+                       pr_warning("Cannot find add_set index %u as target\n",
                                   info->add_set.index);
                        return CHECK_FAIL;      /* error */
                }
@@ -176,14 +177,15 @@ set_target_v0_checkentry(const struct xt_tgchk_param *par)
        if (info->del_set.index != IPSET_INVALID_ID) {
                index = ip_set_nfnl_get_byindex(info->del_set.index);
                if (index == IPSET_INVALID_ID) {
-                       pr_warning("cannot find del_set index %u as target\n",
+                       pr_warning("Cannot find del_set index %u as target\n",
                                   info->del_set.index);
                        return CHECK_FAIL;      /* error */
                }
        }
        if (info->add_set.u.flags[IPSET_DIM_MAX-1] != 0 ||
            info->del_set.u.flags[IPSET_DIM_MAX-1] != 0) {
-               pr_warning("That's nasty!\n");
+               pr_warning("Protocol error: SET target dimension "
+                          "is over the limit!\n");
                return CHECK_FAIL;      /* error */
        }
 
@@ -242,7 +244,8 @@ set_match_checkentry(const struct xt_mtchk_param *par)
                return CHECK_FAIL;      /* error */
        }
        if (info->match_set.dim > IPSET_DIM_MAX) {
-               pr_warning("That's nasty!\n");
+               pr_warning("Protocol error: set match dimension "
+                          "is over the limit!\n");
                return CHECK_FAIL;      /* error */
        }
 
@@ -295,7 +298,7 @@ set_target_checkentry(const struct xt_tgchk_param *par)
        if (info->add_set.index != IPSET_INVALID_ID) {
                index = ip_set_nfnl_get_byindex(info->add_set.index);
                if (index == IPSET_INVALID_ID) {
-                       pr_warning("cannot find add_set index %u as target\n",
+                       pr_warning("Cannot find add_set index %u as target\n",
                                   info->add_set.index);
                        return CHECK_FAIL;      /* error */
                }
@@ -304,14 +307,15 @@ set_target_checkentry(const struct xt_tgchk_param *par)
        if (info->del_set.index != IPSET_INVALID_ID) {
                index = ip_set_nfnl_get_byindex(info->del_set.index);
                if (index == IPSET_INVALID_ID) {
-                       pr_warning("cannot find del_set index %u as target\n",
+                       pr_warning("Cannot find del_set index %u as target\n",
                                   info->del_set.index);
                        return CHECK_FAIL;      /* error */
                }
        }
        if (info->add_set.dim > IPSET_DIM_MAX ||
            info->del_set.flags > IPSET_DIM_MAX) {
-               pr_warning("That's nasty!\n");
+               pr_warning("Protocol error: SET target dimension "
+                          "is over the limit!\n");
                return CHECK_FAIL;      /* error */
        }