summaryrefslogtreecommitdiffhomepage
path: root/libs/sys/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-01-29 22:47:40 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-01-29 22:47:40 +0000
commitc3c22f792b4e2576713c9609f804c42975e09dbc (patch)
tree3f5ea122bfcb88d246a4d52e4da93035185d0257 /libs/sys/luasrc
parentb477dae3079294c592f156e67e89579bea742800 (diff)
libs/sys: fix ip6tables parsing issue
Diffstat (limited to 'libs/sys/luasrc')
-rw-r--r--libs/sys/luasrc/sys/iptparser.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/sys/luasrc/sys/iptparser.lua b/libs/sys/luasrc/sys/iptparser.lua
index 389701451..60e485643 100644
--- a/libs/sys/luasrc/sys/iptparser.lua
+++ b/libs/sys/luasrc/sys/iptparser.lua
@@ -215,6 +215,13 @@ function IptParser.resync( self )
end
+--- Find the names of all tables.
+-- @return Table of table names.
+function IptParser.tables( self )
+ return self._tables
+end
+
+
--- Find the names of all chains within the given table name.
-- @param table String containing the table name
-- @return Table of chain names in the order they occur.
@@ -306,6 +313,11 @@ function IptParser._parse_rules( self )
table.insert(rule_parts, 4, nil)
end
+ -- ip6tables opt column is usually zero-width
+ if self._family == 6 then
+ table.insert(rule_parts, 6, "--")
+ end
+
rule_details["table"] = tbl
rule_details["chain"] = self._chain
rule_details["index"] = tonumber(rule_parts[1])