[1/4] app/testpmd: fix stats-period option check
Checks
Commit Message
Rather than silently ignore an invalid value, raise an error for
stats-period user input.
Fixes: cfea1f3048d1 ("app/testpmd: print statistics periodically")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
app/test-pmd/parameters.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 3/8/2024 2:48 PM, David Marchand wrote:
> Rather than silently ignore an invalid value, raise an error for
> stats-period user input.
>
> Fixes: cfea1f3048d1 ("app/testpmd: print statistics periodically")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
@@ -776,7 +776,7 @@ launch_args_parse(int argc, char** argv)
n = strtoul(optarg, &end, 10);
if ((optarg[0] == '\0') || (end == NULL) ||
(*end != '\0'))
- break;
+ rte_exit(EXIT_FAILURE, "Invalid stats-period value\n");
stats_period = n;
break;