]> git.ipfire.org Git - network.git/commitdiff
iptables: Don't rely on /proc/net/ip(6)_tables_names.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 29 Sep 2012 12:40:11 +0000 (12:40 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 29 Sep 2012 12:40:11 +0000 (12:40 +0000)
Those files only return which tables have been loaded
into the kernel. So when compiled as modules, nothing
will show up.

functions.iptables

index 105140513bdd09f6e7253e8747ad6c82dece7abc..b8db7cba0a1583350791d4c2eab0b66fe502f337 100644 (file)
@@ -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}
 }