applications/luci-firewall: fix crash in rule formatting helper when a rule with...
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 1 Jan 2012 15:31:25 +0000 (15:31 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 1 Jan 2012 15:31:25 +0000 (15:31 +0000)
applications/luci-firewall/luasrc/tools/firewall.lua

index 52bce63218593dfbf972a9f88069a0ef8992fb0f..a2dcbea8d8c846a16ffa27dbb5407fdf485ee759 100644 (file)
@@ -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] = "<var title='%s - %s'>%s%s</var>" %{
                                        a:minhost():string(),