summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Sowden <jeremy@azazel.net>2023-08-21 20:42:32 +0100
committerFlorian Westphal <fw@strlen.de>2023-09-14 14:22:49 +0200
commit8084bed5f7f20cb81d588855a72906932538160a (patch)
tree09d0285b17e663b6d08e2f6cba4633f0451b18d2
parent896e19eb8c48362e88fa0e348c7eb8ead65643ad (diff)
ipfix: skip non-ipv4 addresses
This plug-in expects ipv4 addresses. Check the length of the key value in order to filter out ipv6 addresses. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Florian Westphal <fw@strlen.de>
-rw-r--r--output/ipfix/ulogd_output_IPFIX.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/output/ipfix/ulogd_output_IPFIX.c b/output/ipfix/ulogd_output_IPFIX.c
index 4863d00..1c0f730 100644
--- a/output/ipfix/ulogd_output_IPFIX.c
+++ b/output/ipfix/ulogd_output_IPFIX.c
@@ -426,6 +426,9 @@ static int ipfix_interp(struct ulogd_pluginstance *pi)
if (!(GET_FLAGS(pi->input.keys, InIpSaddr) & ULOGD_RETF_VALID))
return ULOGD_IRET_OK;
+ if (GET_LENGTH(pi->input.keys, InIpSaddr) != sizeof(data->saddr))
+ return ULOGD_IRET_OK;
+
oid = oid_ce(pi->config_kset).u.value;
mtu = mtu_ce(pi->config_kset).u.value;
send_template = send_template_ce(pi->config_kset).u.string;