summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_statistic.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2009-02-09 18:58:45 +0100
committerPatrick McHardy <kaber@trash.net>2009-02-09 18:58:45 +0100
commit300e2909ba4714abc6093cba0ed860708282bd3e (patch)
tree545c79c9fcbe036db503e50a3643acb3d5ff088d /extensions/libxt_statistic.c
parent9cfc59f71f83ee97c4513fd340acf1e45073562b (diff)
parent1eb619f3a0508d62847c311e69a09f4a8534c4df (diff)
Merge branch 'master' of git://dev.medozas.de/iptables
Diffstat (limited to 'extensions/libxt_statistic.c')
-rw-r--r--extensions/libxt_statistic.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/extensions/libxt_statistic.c b/extensions/libxt_statistic.c
index d85aacbd..574f8f7d 100644
--- a/extensions/libxt_statistic.c
+++ b/extensions/libxt_statistic.c
@@ -40,6 +40,7 @@ statistic_parse(int c, char **argv, int invert, unsigned int *flags,
const void *entry, struct xt_entry_match **match)
{
struct xt_statistic_info *info = (void *)(*match)->data;
+ unsigned int val;
double prob;
if (invert)
@@ -70,10 +71,10 @@ statistic_parse(int c, char **argv, int invert, unsigned int *flags,
case '3':
if (*flags & 0x4)
exit_error(PARAMETER_PROBLEM, "double --every");
- if (string_to_number(optarg, 0, 0xFFFFFFFF,
- &info->u.nth.every) == -1)
+ if (!xtables_strtoui(optarg, NULL, &val, 0, UINT32_MAX))
exit_error(PARAMETER_PROBLEM,
"cannot parse --every `%s'", optarg);
+ info->u.nth.every = val;
if (info->u.nth.every == 0)
exit_error(PARAMETER_PROBLEM, "--every cannot be 0");
info->u.nth.every--;
@@ -82,10 +83,10 @@ statistic_parse(int c, char **argv, int invert, unsigned int *flags,
case '4':
if (*flags & 0x8)
exit_error(PARAMETER_PROBLEM, "double --packet");
- if (string_to_number(optarg, 0, 0xFFFFFFFF,
- &info->u.nth.packet) == -1)
+ if (!xtables_strtoui(optarg, NULL, &val, 0, UINT32_MAX))
exit_error(PARAMETER_PROBLEM,
"cannot parse --packet `%s'", optarg);
+ info->u.nth.packet = val;
*flags |= 0x8;
break;
default: