From 2dca180db989ea7afacdf4e70cc85e4408557382 Mon Sep 17 00:00:00 2001 From: Elias Rudberg Date: Wed, 27 May 2020 01:03:46 +0200 Subject: misc: ipfix-export unformat u16 collector_port fix Use %U and unformat_udp_port instead of %u for unformat() call for u16 collector_port number in set_ipfix_exporter_command_fn() to avoid corruption of other variables which can happen if unformat() with %u is used with a 16-bit variable. This avoids crash due to corrupted fib_index value. Type: fix Signed-off-by: Elias Rudberg Change-Id: Id54273fcc458a7f9c5aa4025aa91711f160c1c1a --- src/vnet/ipfix-export/flow_report.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/vnet/ipfix-export') diff --git a/src/vnet/ipfix-export/flow_report.c b/src/vnet/ipfix-export/flow_report.c index 1976ffc0796..56a2d16b8d5 100644 --- a/src/vnet/ipfix-export/flow_report.c +++ b/src/vnet/ipfix-export/flow_report.c @@ -500,7 +500,8 @@ set_ipfix_exporter_command_fn (vlib_main_t * vm, { if (unformat (input, "collector %U", unformat_ip4_address, &collector)) ; - else if (unformat (input, "port %u", &collector_port)) + else if (unformat (input, "port %U", unformat_udp_port, + &collector_port)) ; else if (unformat (input, "src %U", unformat_ip4_address, &src)) ; -- cgit 1.2.3-korg