From 88c62fe2187ebf28937cb49f880dada09937b194 Mon Sep 17 00:00:00 2001 From: Alexander Georgievskiy Date: Tue, 5 Jul 2022 14:13:50 +0300 Subject: [PATCH] luci-mod-status: nftables.js: fix OOM on big nftables IP sets Signed-off-by: Alexander Georgievskiy --- .../htdocs/luci-static/resources/view/status/nftables.js | 2 +- .../root/usr/share/rpcd/acl.d/luci-mod-status.json | 2 +- 2 files 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 c5677c1ebb..3a11f1e830 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 @@ -133,7 +133,7 @@ var action_translations = { return view.extend({ load: function() { return Promise.all([ - L.resolveDefault(fs.exec_direct('/usr/sbin/nft', [ '--json', 'list', 'ruleset' ], 'json'), {}), + L.resolveDefault(fs.exec_direct('/usr/sbin/nft', [ '--terse', '--json', 'list', 'ruleset' ], 'json'), {}), L.resolveDefault(fs.exec_direct('/usr/sbin/iptables-save'), ''), L.resolveDefault(fs.exec_direct('/usr/sbin/ip6tables-save'), '') ]); diff --git a/modules/luci-mod-status/root/usr/share/rpcd/acl.d/luci-mod-status.json b/modules/luci-mod-status/root/usr/share/rpcd/acl.d/luci-mod-status.json index f0dab25af2..18d267e801 100644 --- a/modules/luci-mod-status/root/usr/share/rpcd/acl.d/luci-mod-status.json +++ b/modules/luci-mod-status/root/usr/share/rpcd/acl.d/luci-mod-status.json @@ -71,7 +71,7 @@ "read": { "cgi-io": [ "exec" ], "file": { - "/usr/sbin/nft --json list ruleset": [ "exec" ], + "/usr/sbin/nft --terse --json list ruleset": [ "exec" ], "/usr/sbin/iptables --line-numbers -w -nvxL -t *": [ "exec" ], "/usr/sbin/ip6tables --line-numbers -w -nvxL -t *": [ "exec" ], "/usr/sbin/ip6tables": [ "list" ], -- 2.30.2