From: Jeremy Sowden Date: Mon, 21 Aug 2023 19:42:31 +0000 (+0100) Subject: ip2hbin: store ipv6 address as integer X-Git-Tag: ulogd-2.0.9~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=896e19eb8c48362e88fa0e348c7eb8ead65643ad;p=thirdparty%2Fulogd2.git ip2hbin: store ipv6 address as integer By using `okey_set_u128` we keep track of the address size and downstream plug-ins can distinguish the address family. Signed-off-by: Jeremy Sowden Signed-off-by: Florian Westphal --- diff --git a/filter/ulogd_filter_IP2HBIN.c b/filter/ulogd_filter_IP2HBIN.c index 2711f9c..081616e 100644 --- a/filter/ulogd_filter_IP2HBIN.c +++ b/filter/ulogd_filter_IP2HBIN.c @@ -157,15 +157,14 @@ static int interp_ip2hbin(struct ulogd_pluginstance *pi) if (pp_is_valid(inp, i)) { switch (convfamily) { case AF_INET: - okey_set_u32(&ret[i-START_KEY], - ntohl(ikey_get_u32(&inp[i]))); + okey_set_u32(&ret[i - START_KEY], + ntohl(ikey_get_u32(&inp[i]))); break; case AF_INET6: - okey_set_ptr(&ret[i-START_KEY], - (struct in6_addr *)ikey_get_u128(&inp[i])); + okey_set_u128(&ret[i - START_KEY], + ikey_get_u128(&inp[i])); break; default: - ; break; } }