From 8c2f9fad9ca644af911e0d4113a890c3c84aa738 Mon Sep 17 00:00:00 2001 From: Alexey Dobrovolsky Date: Mon, 31 Aug 2020 00:10:09 +0300 Subject: [PATCH] fw3: zones: limit zone names to 11 bytes As defined in currently used iptables v1.8.4, chain name must be under 29 chars. Thus, user can only edit 11 chars. See also the bugreport [0]. [0] https://dev.archive.openwrt.org/ticket/20380 Signed-off-by: Alexey Dobrovolsky [improve commit description, move length calculation information to src] Signed-off-by: David Bauer --- zones.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zones.h b/zones.h index d786736..beb0e22 100644 --- a/zones.h +++ b/zones.h @@ -22,8 +22,12 @@ #include "options.h" #include "iptables.h" -/* 32 - sizeof("postrouting_") - sizeof("_rule") - sizeof("\0") */ -#define FW3_ZONE_MAXNAMELEN 14 +/* XT_EXTENSION_MAXNAMELEN (29) + * - sizeof("postrouting_") + * - sizeof("_rule") + * - sizeof("\0") + */ +#define FW3_ZONE_MAXNAMELEN 11 extern const struct fw3_option fw3_zone_opts[]; -- 2.30.2