From: Alexey Dobrovolsky Date: Sun, 30 Aug 2020 21:10:09 +0000 (+0300) Subject: fw3: zones: limit zone names to 11 bytes X-Git-Url: http://git.openwrt.org/feed/routing.git;lede-17.01?a=commitdiff_plain;h=8c2f9fad9ca644af911e0d4113a890c3c84aa738;p=project%2Ffirewall3.git 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 --- 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[];