app/testpmd: fix unintentional integer overflow

Fix the potential overflow in expression 1 << begin by using 1ULL.

Coverity issue: 279437, 279445
Fixes: c73a907187 ("app/testpmd: add commands to test new offload API")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
This commit is contained in:
Tiwei Bie 2019-04-24 10:29:31 +08:00 committed by Ferruh Yigit
parent 994e039b95
commit 8efc716f7c

View File

@ -17833,7 +17833,7 @@ print_rx_offloads(uint64_t offloads)
begin = __builtin_ctzll(offloads);
end = sizeof(offloads) * CHAR_BIT - __builtin_clzll(offloads);
single_offload = 1 << begin;
single_offload = 1ULL << begin;
for (bit = begin; bit < end; bit++) {
if (offloads & single_offload)
printf(" %s",
@ -18227,7 +18227,7 @@ print_tx_offloads(uint64_t offloads)
begin = __builtin_ctzll(offloads);
end = sizeof(offloads) * CHAR_BIT - __builtin_clzll(offloads);
single_offload = 1 << begin;
single_offload = 1ULL << begin;
for (bit = begin; bit < end; bit++) {
if (offloads & single_offload)
printf(" %s",