Changeset 4776

Show
Ignore:
Timestamp:
06/07/09 13:48:28 (4 years ago)
Author:
jow
Message:

libs/sys: properly parse iptables rules with not target set

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/libs/sys/luasrc/sys/iptparser.lua

    r4229 r4776  
    2020luci.ip     = require "luci.ip" 
    2121 
    22 local tonumber, ipairs = tonumber, ipairs 
     22local tonumber, ipairs, table = tonumber, ipairs, table 
    2323 
    2424--- LuCI iptables parser and query library 
     
    280280                    local rule_details = { } 
    281281 
     282                    -- cope with rules that have no target assigned 
     283                    if rule:match("^%d+%s+%d+%s+%d+%s%s") then 
     284                        table.insert(rule_parts, 4, nil) 
     285                    end 
     286 
    282287                    rule_details["table"]       = tbl 
    283288                    rule_details["chain"]       = self._chain