comparison mod_audit/mod_audit.lua @ 5706:655f90b149a4

mod_audit: Pass IP address in string form Passing an util.ip object to :text_tag() would be an error.
author Kim Alvefur <zash@zash.se>
date Mon, 13 Nov 2023 12:02:54 +0100
parents 9bbf5b0673a2
children 9a5fca9f90a6
comparison
equal deleted inserted replaced
5705:9bbf5b0673a2 5706:655f90b149a4
86 if attach_ips and session.ip then 86 if attach_ips and session.ip then
87 local remote_ip, network = session.ip; 87 local remote_ip, network = session.ip;
88 if attach_ipv4_prefix or attach_ipv6_prefix then 88 if attach_ipv4_prefix or attach_ipv6_prefix then
89 network = get_ip_network(remote_ip); 89 network = get_ip_network(remote_ip);
90 end 90 end
91 stanza:text_tag("remote-ip", network or remote_ip); 91 stanza:text_tag("remote-ip", network or remote_ip.normal);
92 end 92 end
93 if attach_location and session.ip then 93 if attach_location and session.ip then
94 local remote_ip = ip.new_ip(session.ip); 94 local remote_ip = ip.new_ip(session.ip);
95 local geoip_country = ip.proto == "IPv6" and geoip6_country or geoip4_country; 95 local geoip_country = ip.proto == "IPv6" and geoip6_country or geoip4_country;
96 stanza:tag("location", { 96 stanza:tag("location", {