summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Sowden <jeremy@azazel.net>2023-08-21 20:42:31 +0100
committerFlorian Westphal <fw@strlen.de>2023-09-14 14:22:49 +0200
commit896e19eb8c48362e88fa0e348c7eb8ead65643ad (patch)
tree416d25851426e29059534127e0b8b627e4d82805
parentb5a4bc8ffc6e6a48c43d8f8f28092ea0d2b8f82a (diff)
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 <jeremy@azazel.net> Signed-off-by: Florian Westphal <fw@strlen.de>
-rw-r--r--filter/ulogd_filter_IP2HBIN.c9
1 files changed, 4 insertions, 5 deletions
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;
}
}