Add support for showing ipv6 NAT table in Luci
[project/luci.git] / modules / luci-mod-admin-full / luasrc / view / admin_status / iptables.htm
index f49469a..3f4b83b 100644 (file)
@@ -9,6 +9,7 @@
        require "luci.sys.iptparser"
        local wba = require "luci.tools.webadmin"
        local fs = require "nixio.fs"
+       local io = require "io"
 
        local has_ip6tables = fs.access("/usr/sbin/ip6tables")
        local mode = 4
        local tables = { "Filter", "NAT", "Mangle", "Raw" }
        if mode == 6 then
                tables = { "Filter", "Mangle", "Raw" }
+               local ok, lines = pcall(io.lines, "/proc/net/ip6_tables_names")
+               if ok and lines then
+                       local line
+                       for line in lines do
+                               if line == "nat" then
+                                       tables = { "Filter", "NAT", "Mangle", "Raw" }
+                               end
+                       end
+               end
        end
 -%>