From 326d9f4a7a1685d04d1f6b5fb3402bca2d23d4df Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Mon, 19 May 2025 13:09:24 -0700 Subject: Partially modernize iptables/nftables/5.10 procfs situation --- sbin/iptables-rrdtool | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sbin') diff --git a/sbin/iptables-rrdtool b/sbin/iptables-rrdtool index 97dada3..95aaebc 100755 --- a/sbin/iptables-rrdtool +++ b/sbin/iptables-rrdtool @@ -42,7 +42,9 @@ update () { fi } -for table in $(cat /proc/net/ip_tables_names); do +# ~5.10 this procfs interface got removed. +#for table in $(cat /proc/net/ip_tables_names); do +for table in $( /usr/sbin/nft list tables | grep ' ip ' | cut -f 3 -d ' ' ); do for rule in $(/sbin/iptables-save -c -t ${table}); do # iptables-save has inconsistent output for no sane reason; we grab rematch # strings both before and after the counters, then hamfistedly combine them -- cgit v1.2.3