]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
ipfix: skip non-ipv4 addresses
authorJeremy Sowden <jeremy@azazel.net>
Mon, 21 Aug 2023 19:42:32 +0000 (20:42 +0100)
committerFlorian Westphal <fw@strlen.de>
Thu, 14 Sep 2023 12:22:49 +0000 (14:22 +0200)
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>
output/ipfix/ulogd_output_IPFIX.c

index 4863d008562e4da7572ed7516b5eee1daf219a0b..1c0f730b5b7c670dcc64adf0b3329e40ec674f95 100644 (file)
@@ -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;