Commit ca2cdba6 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

ignore unknown tables when flushing iptables configuration

parent 9d65835b
......@@ -154,8 +154,14 @@ function M.flush()
local success, lines = pcall(io.lines, params.procfile)
if success then
for tbl in lines do
for i, chain in ipairs(M.builtin[tbl]) do
empty.config[family][tbl][chain] = {}
if M.builtin[tbl] then
for i, chain in ipairs(M.builtin[tbl]) do
empty.config[family][tbl][chain] = {}
end
else
io.stderr:write(
'Warning: not flushing unknown table: '..tbl..'\n'
)
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment