comparison mod_firewall/mod_firewall.lua @ 6553:7f3ad8a5b2ab

mod_firewall: FROM COUNTRY: Fix incorrect variable use in generated code
author Matthew Wild <mwild1@gmail.com>
date Sun, 24 May 2026 19:30:31 +0100
parents 430584888704
children d81bb13c0e87
comparison
equal deleted inserted replaced
6552:d4da95d6d977 6553:7f3ad8a5b2ab
298 local ip = iplib.new_ip(ips); 298 local ip = iplib.new_ip(ips);
299 if not ip then 299 if not ip then
300 return "--"; 300 return "--";
301 end 301 end
302 if ip.proto == "IPv6" and geov6 then 302 if ip.proto == "IPv6" and geov6 then
303 local geoinfo = geoinfo:query_by_addr6(ip.addr); 303 local geoinfo = geov6:query_by_addr6(ip.addr);
304 if geoinfo then 304 if geoinfo then
305 return geoinfo[what or "code"]; 305 return geoinfo[what or "code"];
306 end 306 end
307 elseif ip.proto == "IPv4" and geov4 then 307 elseif ip.proto == "IPv4" and geov4 then
308 local geoinfo = geoinfo:query_by_addr(ip.addr); 308 local geoinfo = geov4:query_by_addr(ip.addr);
309 if geoinfo then 309 if geoinfo then
310 return geoinfo[what or "code"]; 310 return geoinfo[what or "code"];
311 end 311 end
312 end 312 end
313 return "--"; 313 return "--";