From 83df3eb6c7678a5988bc8c9942e9892a24ab6967 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 12 Feb 2019 07:57:35 +0100 Subject: luci-mod-status: iptables.js: fix parsing IP addresses in rules Rework the regexp pattern to allow both IP addresses without mask and IPv6 addresses with netmask instead of CIDR notation. Fixes: #2495, #2530 Fixes: f6bfac211 ("luci-mod-status: rework iptables status page") Signed-off-by: Jo-Philipp Wich --- .../htdocs/luci-static/resources/view/status/iptables.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/luci-mod-status/htdocs/luci-static/resources') diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/iptables.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/iptables.js index 39ddab397..a742243a0 100644 --- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/iptables.js +++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/iptables.js @@ -165,7 +165,7 @@ function parse_output(table, s) else if (m[1].match(/^num /)) { continue; } - else if ((m2 = m[1].match(/^(\d+) +(\d+) +(\d+) +(.*?) +(\S+) +(\S*) +(\S+) +(\S+) +([a-f0-9:.]+\/\d+) +([a-f0-9:.]+\/\d+) +(.+)$/)) !== null) { + else if ((m2 = m[1].match(/^(\d+) +(\d+) +(\d+) +(.*?) +(\S+) +(\S*) +(\S+) +(\S+) +([a-f0-9:.]+(?:\/[a-f0-9:.]+)?) +([a-f0-9:.]+(?:\/[a-f0-9:.]+)?) +(.+)$/)) !== null) { var num = +m2[1], pkts = +m2[2], bytes = +m2[3], -- cgit v1.2.3