Comparison

plugins/mod_s2s/s2sout.lib.lua @ 9871:744e08ac5596

mod_s2s: Set warning status if not listening on any ports
author Matthew Wild <mwild1@gmail.com>
date Tue, 19 Mar 2019 09:08:33 +0000
parent 9414:a48579a7b709
comparison
equal deleted inserted replaced
9870:8f4880576835 9871:744e08ac5596
316 module:hook_global("service-added", function (event) 316 module:hook_global("service-added", function (event)
317 if event.name ~= "s2s" then return end 317 if event.name ~= "s2s" then return end
318 318
319 local s2s_sources = portmanager.get_active_services():get("s2s"); 319 local s2s_sources = portmanager.get_active_services():get("s2s");
320 if not s2s_sources then 320 if not s2s_sources then
321 module:log("warn", "s2s not listening on any ports, outgoing connections may fail"); 321 module:log_status("warn", "s2s not listening on any ports, outgoing connections may fail");
322 return; 322 return;
323 end 323 end
324 for source, _ in pairs(s2s_sources) do 324 for source, _ in pairs(s2s_sources) do
325 if source == "*" or source == "0.0.0.0" then 325 if source == "*" or source == "0.0.0.0" then
326 for _, addr in ipairs(local_addresses("ipv4", true)) do 326 for _, addr in ipairs(local_addresses("ipv4", true)) do