From edbdc02c00642988f030a626dcd3b64a97e794c2 Mon Sep 17 00:00:00 2001 From: Stefan Kleeschulte Date: Fri, 17 Jan 2025 13:42:34 +0100 Subject: [PATCH] luci-mod-status: consider family when rendering chains and rules There can be multiple tables with the same name but different family attribute (inet, ip, ip6, ...). The same goes for chains. So the family attribute needs to be considered when rendering chains and rules. Signed-off-by: Stefan Kleeschulte (cherry picked from commit e79e7022e50bd1782a528f8c8ddd16f340fbce35) --- .../htdocs/luci-static/resources/view/status/nftables.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js index 406f134327..0013a3a116 100644 --- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js +++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js @@ -607,7 +607,7 @@ return view.extend({ ])); for (var i = 0; i < data.length; i++) - if (typeof(data[i].rule) == 'object' && data[i].rule.table == spec.table && data[i].rule.chain == spec.name) + if (typeof(data[i].rule) == 'object' && data[i].rule.table == spec.table && data[i].rule.chain == spec.name && data[i].rule.family == spec.family) node.lastElementChild.appendChild(this.renderRule(data, data[i].rule)); if (node.lastElementChild.childNodes.length == 1) @@ -669,7 +669,7 @@ return view.extend({ ]); for (var i = 0; i < data.length; i++) - if (typeof(data[i].chain) == 'object' && data[i].chain.table == spec.name) + if (typeof(data[i].chain) == 'object' && data[i].chain.table == spec.name && data[i].chain.family == spec.family) node.lastElementChild.lastElementChild.appendChild(this.renderChain(data, data[i].chain)); return node; -- 2.30.2