From 67195a8c8a03d12994e91315e49e3d78c51a385a Mon Sep 17 00:00:00 2001 From: Luciano Coelho Date: Thu, 15 Jul 2010 17:12:56 +0200 Subject: extensions: libxt_IDLETIMER: use xtables_param_act when checking options This patch changes custom error messages for illegal options into the default iptables messages, by using xtables_param_act(). Signed-off-by: Luciano Coelho Signed-off-by: Patrick McHardy --- extensions/libxt_IDLETIMER.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'extensions/libxt_IDLETIMER.c') diff --git a/extensions/libxt_IDLETIMER.c b/extensions/libxt_IDLETIMER.c index 565f8e39..c931d0ee 100644 --- a/extensions/libxt_IDLETIMER.c +++ b/extensions/libxt_IDLETIMER.c @@ -60,23 +60,20 @@ static int idletimer_tg_parse(int c, char **argv, int invert, switch (c) { case 't': - if (*flags & IDLETIMER_TG_OPT_TIMEOUT) - xtables_error(PARAMETER_PROBLEM, - "Cannot specify timeout more than once"); + xtables_param_act(XTF_ONLY_ONCE, "IDLETIMER", "--timeout", + *flags & IDLETIMER_TG_OPT_TIMEOUT); info->timeout = atoi(optarg); *flags |= IDLETIMER_TG_OPT_TIMEOUT; break; case 'l': - if (*flags & IDLETIMER_TG_OPT_LABEL) - xtables_error(PARAMETER_PROBLEM, - "Cannot specify label more than once"); + xtables_param_act(XTF_ONLY_ONCE, "IDLETIMER", "--label", + *flags & IDLETIMER_TG_OPT_TIMEOUT); if (strlen(optarg) > MAX_IDLETIMER_LABEL_SIZE - 1) - xtables_error(PARAMETER_PROBLEM, - "Maximum label length is %u for --label", - MAX_IDLETIMER_LABEL_SIZE - 1); + xtables_param_act(XTF_BAD_VALUE, "IDLETIMER", "--label", + optarg); strcpy(info->label, optarg); *flags |= IDLETIMER_TG_OPT_LABEL; -- cgit v1.2.3