From: Jo-Philipp Wich Date: Sun, 1 Jan 2012 15:31:25 +0000 (+0000) Subject: applications/luci-firewall: fix crash in rule formatting helper when a rule with... X-Git-Tag: 0.11.0~1197 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=0ce6a286f78108ed1b5ce52c8217f1494ceca257;p=project%2Fluci.git applications/luci-firewall: fix crash in rule formatting helper when a rule with an /128 ipv6 prefix is encountered --- diff --git a/applications/luci-firewall/luasrc/tools/firewall.lua b/applications/luci-firewall/luasrc/tools/firewall.lua index 52bce63218..a2dcbea8d8 100644 --- a/applications/luci-firewall/luasrc/tools/firewall.lua +++ b/applications/luci-firewall/luasrc/tools/firewall.lua @@ -86,7 +86,7 @@ function fmt_ip(x, d) a, m = v:match("(%S+)/(%d+%.%S+)") a = a or v a = a:match(":") and ip.IPv6(a, m) or ip.IPv4(a, m) - if a and (a:is6() or a:prefix() < 32) then + if a and (a:is6() and a:prefix() < 128 or a:prefix() < 32) then l[1] = translate("IP range") l[#l+1] = "%s%s" %{ a:minhost():string(),