Changeset

5734:c782f220b3ee

mod_audit: Fix storing IP prefixes Was essentially calling new_ip(new_ip())
author Kim Alvefur <zash@zash.se>
date Mon, 13 Nov 2023 16:55:12 +0100
parents 5733:15c1801e8901
children 5735:b357ff3d0c8a
files mod_audit/mod_audit.lua
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mod_audit/mod_audit.lua	Mon Nov 13 12:37:21 2023 +0100
+++ b/mod_audit/mod_audit.lua	Mon Nov 13 16:55:12 2023 +0100
@@ -61,13 +61,12 @@
 end
 
 local function get_ip_network(ip_addr)
-	local _ip = ip.new_ip(ip_addr);
-	local proto = _ip.proto;
+	local proto = ip_addr.proto;
 	local network;
 	if proto == "IPv4" and attach_ipv4_prefix then
-		network = ip.truncate(_ip, attach_ipv4_prefix).normal.."/"..attach_ipv4_prefix;
+		network = ip.truncate(ip_addr, attach_ipv4_prefix).normal.."/"..attach_ipv4_prefix;
 	elseif proto == "IPv6" and attach_ipv6_prefix then
-		network = ip.truncate(_ip, attach_ipv6_prefix).normal.."/"..attach_ipv6_prefix;
+		network = ip.truncate(ip_addr, attach_ipv6_prefix).normal.."/"..attach_ipv6_prefix;
 	end
 	return network;
 end