app/pdump: fix type casting of ring size

ring_size value is wrongly type casted to uint16_t.
It should be type casted to uint32_t, as maximum
ring size is 28bit long. Wrong type cast
wrapping around the ring size values bigger than 65535.

Fixes: caa7028276 ("app/pdump: add tool for packet capturing")

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
This commit is contained in:
Reshma Pattan 2016-06-24 17:36:23 +01:00 committed by Thomas Monjalon
parent 819d48b9d0
commit 9115326d99

View File

@ -362,7 +362,7 @@ parse_pdump(const char *optarg)
&parse_uint_value, &v);
if (ret < 0)
goto free_kvlist;
pt->ring_size = (uint16_t) v.val;
pt->ring_size = (uint32_t) v.val;
} else
pt->ring_size = RING_SIZE;