From d78254d7f9d18ef76377a3013302430cce8ea702 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sun, 27 Feb 2011 17:38:34 +0100 Subject: libxtables: min-max option support Signed-off-by: Jan Engelhardt --- xtoptions.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'xtoptions.c') 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\", " -- cgit v1.2.3