summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_rateest.c
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/libxt_rateest.c')
-rw-r--r--extensions/libxt_rateest.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/extensions/libxt_rateest.c b/extensions/libxt_rateest.c
index 333239d9..285b7ba3 100644
--- a/extensions/libxt_rateest.c
+++ b/extensions/libxt_rateest.c
@@ -112,6 +112,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
const void *entry, struct xt_entry_match **match)
{
struct xt_rateest_match_info *info = (void *)(*match)->data;
+ unsigned int val;
rateest_info = info;
@@ -186,10 +187,11 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
if (!argv[optind] || *argv[optind] == '-' || *argv[optind] == '!')
break;
- if (string_to_number(argv[optind], 0, 0, &info->pps1) < 0)
+ if (!xtables_strtoui(argv[optind], NULL, &val, 0, UINT32_MAX))
exit_error(PARAMETER_PROBLEM,
"rateest: could not parse pps `%s'",
argv[optind]);
+ info->pps1 = val;
optind++;
break;
@@ -234,10 +236,11 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
if (!argv[optind] || *argv[optind] == '-' || *argv[optind] == '!')
break;
- if (string_to_number(argv[optind], 0, 0, &info->pps2) < 0)
+ if (!xtables_strtoui(argv[optind], NULL, &val, 0, UINT32_MAX))
exit_error(PARAMETER_PROBLEM,
"rateest: could not parse pps `%s'",
argv[optind]);
+ info->pps2 = val;
optind++;
break;