diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2013-03-27 13:28:26 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2013-03-27 13:28:26 +0000 |
commit | 4fa798dffe64ac271e7b128b8521ef4e9cea408f (patch) | |
tree | 128b51bbe37281452caee2fb7ef981413ef8ff6b /libs | |
parent | 7ab501f9cd6e80e3ca9d1e3dd37059ccfeb8d27a (diff) |
libs/sys: fix incomplete options table when parsing iptables rules
Diffstat (limited to 'libs')
-rw-r--r-- | libs/sys/luasrc/sys/iptparser.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/sys/luasrc/sys/iptparser.lua b/libs/sys/luasrc/sys/iptparser.lua index 60e485643..d82363309 100644 --- a/libs/sys/luasrc/sys/iptparser.lua +++ b/libs/sys/luasrc/sys/iptparser.lua @@ -332,8 +332,10 @@ function IptParser._parse_rules( self ) rule_details["destination"] = rule_parts[10] rule_details["options"] = { } - for i = 11, #rule_parts - 1 do - rule_details["options"][i-10] = rule_parts[i] + for i = 11, #rule_parts do + if #rule_parts[i] > 0 then + rule_details["options"][i-10] = rule_parts[i] + end end self._rules[#self._rules+1] = rule_details |