interface: fix overflow of link speed. 40/36140/4
authorAnton Nikolaev <anikolaev@netgate.com>
Mon, 16 May 2022 10:33:17 +0000 (10:33 +0000)
committerMatthew Smith <mgsmith@netgate.com>
Tue, 17 May 2022 19:42:17 +0000 (19:42 +0000)
commit61f6a4c4f026a83390f41595cb77771a668cc55c
treeeb7ffe4d7d65fe5c9d00c25720ea31b53aa65070
parent59a08e65094db28884fc40e9562e303fde3b21d8
interface: fix overflow of link speed.

Type: fix

There were several places where mbps were converted to kbps for
link_speed, but often drivers of devices set link speed to unknown
(0xFFFFFFFF) on initialization, so there was multiplication of
link_speed equal 0xFFFFFFFF(UINT32_MAX) by 1000, this provides
overflow of unsigned int, and as result link_speed was equal
4295 Gbps, but actually link_speed is unknown.

Signed-off-by: Anton Nikolaev <anikolaev@netgate.com>
Change-Id: Ib462ed6ed685654af4687041e115bfb74e640f13
src/plugins/avf/device.c
src/plugins/dpdk/device/init.c
src/plugins/vmxnet3/vmxnet3.c
src/vnet/interface_format.c