From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BC7ACA0525 for ; Thu, 30 Jan 2020 17:18:25 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 99E491C037; Thu, 30 Jan 2020 17:18:25 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 4C7331BF0B for ; Thu, 30 Jan 2020 17:18:22 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from orika@mellanox.com) with ESMTPS (AES256-SHA encrypted); 30 Jan 2020 18:18:21 +0200 Received: from pegasus03.mtr.labs.mlnx (pegasus03.mtr.labs.mlnx [10.210.16.124]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 00UGILY5020769; Thu, 30 Jan 2020 18:18:21 +0200 From: Ori Kam To: Wenzhuo Lu , Jingjing Wu , Bernard Iremonger Cc: dev@dpdk.org, orika@mellanox.com, ferruh.yigit@intel.com, viacheslavo@mellanox.com, stable@dpdk.org Date: Thu, 30 Jan 2020 16:18:19 +0000 Message-Id: <1580401099-103931-1-git-send-email-orika@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-stable] [PATCH] testpmd: fix init mpls struct X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" When adding mpls item we copy the structure, in some cases the item is not initialized. This commit solves this by initializing the struct. Coverity issue: 325734 Fixes: a1191d39cb57 ("app/testpmd: add MPLSoUDP encapsulation") Cc: stable@dpdk.org Signed-off-by: Ori Kam --- 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..42d90f5 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 + }; uint8_t *header; int ret; -- 1.8.3.1