misc: ipfix-export unformat u16 collector_port fix 69/28469/2
authorElias Rudberg <elias.rudberg@bahnhof.net>
Tue, 26 May 2020 23:03:46 +0000 (01:03 +0200)
committerAndrew Yourtchenko <ayourtch@gmail.com>
Tue, 18 Aug 2020 19:47:21 +0000 (19:47 +0000)
commita4a794d152d31d2c81528951052c3068d68108f5
tree6c2a538509e58a0f0e8887601070ed1811819ce5
parent895c37fb8ab0d97fafa792bd399baa07f8fac98d
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 <elias.rudberg@bahnhof.net>
Change-Id: Id54273fcc458a7f9c5aa4025aa91711f160c1c1a
(cherry picked from commit 2dca180db989ea7afacdf4e70cc85e4408557382)
src/vnet/ipfix-export/flow_report.c
src/vnet/udp/udp.h
src/vnet/udp/udp_format.c