app/testpmd: fix uninitialized members of MPLS
authorOri Kam <orika@mellanox.com>
Thu, 30 Jan 2020 16:59:35 +0000 (16:59 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 5 Feb 2020 08:51:21 +0000 (09:51 +0100)
Some of the members 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@dpdk.org
Signed-off-by: Ori Kam <orika@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
app/test-pmd/cmdline_flow.c

index e99e24c..c2cc4c5 100644 (file)
@@ -4576,7 +4576,9 @@ parse_vc_action_mplsogre_encap(struct context *ctx, const struct token *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,
+       };
        uint8_t *header;
        int ret;