From: Hannu Nyman Date: Wed, 28 Oct 2015 11:07:47 +0000 (+0200) Subject: luci-app-firewall: limit zone name length to 11 characters X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a66c08849a95ad653635b9d8aefe5a8ecb2382f8;p=oweals%2Fluci.git luci-app-firewall: limit zone name length to 11 characters Change the maximum length of a firewall zone name from 14 to 11 characters. Longer names break iptables rule generation (max. 29 chars are allowed). XT_EXTENSION_MAXNAMELEN = 29 29 - sizeof("postrouting_") - sizeof("_rule") - sizeof("\0") = 11 References to: https://github.com/openwrt/luci/issues/507 https://dev.openwrt.org/ticket/20380 Signed-off-by: Hannu Nyman (cherry picked from commit 87b6bb0dafbbe46dc7669356ac3db24aa975c4b7) --- diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua index 6c90476f8..c8b8f22bd 100644 --- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua +++ b/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua @@ -60,7 +60,7 @@ s:tab("advanced", translate("Advanced Settings")) name = s:taboption("general", Value, "name", translate("Name")) name.optional = false name.forcewrite = true -name.datatype = "and(uciname,maxlength(14))" +name.datatype = "and(uciname,maxlength(11))" function name.write(self, section, value) if zone:name() ~= value then