[dpdk-dev] [PATCH] app/testpmd: fix uninitialized members of mpls

Ferruh Yigit ferruh.yigit at intel.com
Fri Jan 31 12:07:38 CET 2020


On 1/30/2020 4:59 PM, Ori Kam wrote:
> Some of the memebers of the mpls struct are not initialized.
> this commit init the uninitialized members.
> 
> Coverity issue: 325735
> Fixes: 3e77031be855 ("app/testpmd: add MPLSoGRE encapsulation")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Ori Kam <orika at mellanox.com>
> ---
>  app/test-pmd/cmdline_flow.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index e99e24c..c2cc4c5 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -4576,7 +4576,9 @@ static int comp_set_raw_index(struct context *, const struct token *,
>  	struct rte_flow_item_gre gre = {
>  		.protocol = rte_cpu_to_be_16(ETHER_TYPE_MPLS_UNICAST),
>  	};
> -	struct rte_flow_item_mpls mpls;
> +	struct rte_flow_item_mpls mpls = {
> +		.ttl = 0,
> +	};

why not use "= {0};", the end result will be same, struct will be all zeroed out
in both case, "= {0};" makes the intention more obvious I think.

>  	uint8_t *header;
>  	int ret;
>  
> 



More information about the dev mailing list