From ab2eb246380cef57dcf07c40febdc4becea5fba4 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 29 Sep 2012 12:40:11 +0000 Subject: [PATCH] iptables: Don't rely on /proc/net/ip(6)_tables_names. Those files only return which tables have been loaded into the kernel. So when compiled as modules, nothing will show up. --- functions.iptables | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/functions.iptables b/functions.iptables index 10514051..b8db7cba 100644 --- a/functions.iptables +++ b/functions.iptables @@ -123,23 +123,20 @@ function iptables_status() { # Returns which tables exist for the given protocol. function iptables_tables() { local proto=${1} - local file + assert isset proto case "${proto}" in ipv6) - file="/proc/net/ip6_tables_names" + print "filter mangle" ;; ipv4) - file="/proc/net/ip_tables_names" + print "filter mangle nat" ;; *) return ${EXIT_ERROR} ;; esac - assert [ -r "${file}" ] - - print "$(<${file})" return ${EXIT_OK} } -- 2.47.2