summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Dobrovolsky <dobrovolskiy.alexey@gmail.com>2020-08-31 00:10:09 +0300
committerDavid Bauer <mail@david-bauer.net>2020-09-05 12:52:05 +0200
commit8c2f9fad9ca644af911e0d4113a890c3c84aa738 (patch)
tree1a742daaac19931490dc0d08f4f939fa1f1aae7c
parent78d52a28c66ad0fd2af250038fdcf4239ad37bf2 (diff)
downloadfirewall3-8c2f9fad9ca644af911e0d4113a890c3c84aa738.tar.gz
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 <dobrovolskiy.alexey@gmail.com> [improve commit description, move length calculation information to src] Signed-off-by: David Bauer <mail@david-bauer.net>
-rw-r--r--zones.h8
1 files 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[];