[PATCH ulogd2 v3 06/11] ipfix: skip non-ipv4 addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 output/ipfix/ulogd_output_IPFIX.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/output/ipfix/ulogd_output_IPFIX.c b/output/ipfix/ulogd_output_IPFIX.c
index 4863d008562e..1c0f730b5b7c 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;
-- 
2.40.1




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux