# HG changeset patch # User Emmanuel Gil Peyrot # Date 1504964723 -3600 # Node ID 67ecff7be011b9bbf1629568adf0260edb1a5ca4 # Parent 2f8523bf7ff2ada7b16555ebce5b814359bdfc3f mod_s2s: Add a counter for IPv6. diff -r 2f8523bf7ff2 -r 67ecff7be011 plugins/mod_s2s/mod_s2s.lua --- a/plugins/mod_s2s/mod_s2s.lua Sun Apr 29 21:43:39 2018 +0100 +++ b/plugins/mod_s2s/mod_s2s.lua Sat Sep 09 14:45:23 2017 +0100 @@ -39,6 +39,7 @@ local require_encryption = module:get_option_boolean("s2s_require_encryption", false); local measure_connections = module:measure("connections", "amount"); +local measure_ipv6 = module:measure("ipv6", "amount"); local sessions = module:shared("sessions"); @@ -48,10 +49,15 @@ module:hook("stats-update", function () local count = 0; - for _ in pairs(sessions) do + local ipv6 = 0; + for _, session in pairs(sessions) do count = count + 1; + if session.ip and session.ip:match(":") then + ipv6 = ipv6 + 1; + end end measure_connections(count); + measure_ipv6(ipv6); end); --- Handle stanzas to remote domains