summaryrefslogtreecommitdiffstats
path: root/xtoptions.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2011-02-27 17:38:34 +0100
committerJan Engelhardt <jengelh@medozas.de>2011-04-06 12:54:23 +0200
commitd78254d7f9d18ef76377a3013302430cce8ea702 (patch)
tree574827d62c95ade4b56e3a5cb2268b6983820705 /xtoptions.c
parent93112921153c43dc0521be499f6a792d2aaae5e9 (diff)
libxtables: min-max option support
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'xtoptions.c')
-rw-r--r--xtoptions.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/xtoptions.c b/xtoptions.c
index 843395be..6a119ec7 100644
--- a/xtoptions.c
+++ b/xtoptions.c
@@ -89,6 +89,11 @@ static void xtopt_parse_int(struct xt_option_call *cb)
unsigned int lmin = 0, lmax = UINT32_MAX;
unsigned int value;
+ if (cb->entry->min != 0)
+ lmin = cb->entry->min;
+ if (cb->entry->max != 0)
+ lmax = cb->entry->max;
+
if (!xtables_strtoui(cb->arg, NULL, &value, lmin, lmax))
xt_params->exit_err(PARAMETER_PROBLEM,
"%s: bad value for option \"--%s\", "