Skip to content

Commit

Permalink
examples/l2fwd-crypto: fix port mask overflow
Browse files Browse the repository at this point in the history
[ upstream commit aaf4ac404362752e9c8effa4641bb480187d04ec ]

Coverity flags an issue with 32-bit value. If max ethports value is
configured with a value larger than 32 there will be an issue.
Coverity issue: 375863 Unintentional integer overflow

Fixes: 387259b ("examples/l2fwd-crypto: add sample application")

Signed-off-by: Brian Dooley <brian.dooley@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
  • Loading branch information
bdoole1 authored and cpaelzer committed Mar 9, 2022
1 parent 22cb63b commit 0810491
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/l2fwd-crypto/main.c
Expand Up @@ -2639,7 +2639,7 @@ initialize_ports(struct l2fwd_crypto_options *options)
last_portid = portid;
}

l2fwd_enabled_port_mask |= (1 << portid);
l2fwd_enabled_port_mask |= (1ULL << portid);
enabled_portcount++;
}

Expand Down

0 comments on commit 0810491

Please sign in to comment.