Comparison

mod_firewall/mod_firewall.lua @ 980:aeb11522a44f

mod_firewall: Fix variable name
author Kim Alvefur <zash@zash.se>
date Mon, 08 Apr 2013 22:26:52 +0200
parent 971:53e158e44a44
child 996:37af655ca575
comparison
equal deleted inserted replaced
979:cec42f884475 980:aeb11522a44f
174 :format(line_no); 174 :format(line_no);
175 end 175 end
176 state = nil; 176 state = nil;
177 elseif not(state) and line:match("^::") then 177 elseif not(state) and line:match("^::") then
178 chain = line:gsub("^::%s*", ""); 178 chain = line:gsub("^::%s*", "");
179 local chain_info = chains[chain_name]; 179 local chain_info = chains[chain];
180 if not chain_info then 180 if not chain_info then
181 return nil, errmsg("Unknown chain: "..chain_name); 181 return nil, errmsg("Unknown chain: "..chain);
182 elseif chain_info.type ~= "event" then 182 elseif chain_info.type ~= "event" then
183 return nil, errmsg("Only event chains supported at the moment"); 183 return nil, errmsg("Only event chains supported at the moment");
184 end 184 end
185 ruleset[chain] = ruleset[chain] or {}; 185 ruleset[chain] = ruleset[chain] or {};
186 elseif not(state) and line:match("^ZONE ") then 186 elseif not(state) and line:match("^ZONE ") then
332 local chain_definition = chains[chain]; 332 local chain_definition = chains[chain];
333 if chain_definition and chain_definition.type == "event" then 333 if chain_definition and chain_definition.type == "event" then
334 for _, event_name in ipairs(chain_definition) do 334 for _, event_name in ipairs(chain_definition) do
335 module:hook(event_name, handler, chain_definition.priority); 335 module:hook(event_name, handler, chain_definition.priority);
336 end 336 end
337 elseif not chain_name:match("^user/") then 337 elseif not chain:match("^user/") then
338 module:log("warn", "Unknown chain %q", chain); 338 module:log("warn", "Unknown chain %q", chain);
339 end 339 end
340 module:hook("firewall/chains/"..chain, handler); 340 module:hook("firewall/chains/"..chain, handler);
341 end 341 end
342 end 342 end