From 0cb675b8f18c4b074d4c69461638820708e98100 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 7 Jun 2010 11:50:25 +0200 Subject: xtables: another try at chain name length checking Since XT_EXTENSION_MAXNAMELEN is now available, make use of it and clear the confusion. Signed-off-by: Jan Engelhardt --- iptables-restore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'iptables-restore.c') diff --git a/iptables-restore.c b/iptables-restore.c index 4a74485c..8c6648e9 100644 --- a/iptables-restore.c +++ b/iptables-restore.c @@ -259,11 +259,11 @@ main(int argc, char *argv[]) exit(1); } - if (strlen(chain) > XT_FUNCTION_MAXNAMELEN - 1) + if (strlen(chain) >= XT_EXTENSION_MAXNAMELEN) xtables_error(PARAMETER_PROBLEM, "Invalid chain name `%s' " "(%u chars max)", - chain, XT_FUNCTION_MAXNAMELEN - 1); + chain, XT_EXTENSION_MAXNAMELEN - 1); if (iptc_builtin(chain, handle) <= 0) { if (noflush && iptc_is_chain(chain, handle)) { -- cgit v1.2.3