Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2027087ybb; Sun, 29 Mar 2020 20:21:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtxlGC5FrWdR29WSu4+jlLrgGdjxB6ltEyPYq+embZxqH0tezgHCNq1BXuhGJWrEAhDnuu/ X-Received: by 2002:a05:6830:15cf:: with SMTP id j15mr8119688otr.292.1585538494638; Sun, 29 Mar 2020 20:21:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585538494; cv=none; d=google.com; s=arc-20160816; b=v4xOdD1SrqWBPQMFMDJIxWtr3SxDWo0S95CpiQkuYdDRWojRfRhH5DrtyZgqxqzAYW ZhtHYwR/N1flpAGlw5v9PrEOnFBmhR5XQxZmg6xxmPmL3k2VJr3JhjoJh2FukZqKJGcx iTjl9XEKu+ZCvTVsgiAGh1B4aqBFsMfCLQcNLSPho4SNOVbhnLK4YdWxVVqbK3MBfrpO 7lZOyOhfCcliuZBuCc4uSiYs8PUyxvmUE+paZobGayRWhcwcwxpDFqvpLzI+xu7A9KSn 4lUypZkEXV2jH5y5kvx3srnITEQ1KF/tY25m9dWG3aX1bSBtij08KVwr6ulWI7BAKzHH 7/GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=Iffh26nH76WSIGQBQDyeUgDOOobkx3HPM8PKFzc/dWo=; b=A5QgPkpUPV2qVqqR/CecwJuRGGYx2nQnuIDCgpHgLgQlgZZ99L7/HjHj6zs9n6cn+7 Tx+81QDt3o/VHOhyc3le4Wm/I/g5ZUkk+yArq52awrX+k+dEmB1UsHmgXupRNeWNXnzl jB4zH8u9MNR7+kUUuvCSfw+HNfjIZ/qnBOAK6jUii3bCWQjLSPramwryCBOtSIYQrL03 3PCE8qJ7O8eGzv4E1ym6rTNNcL840frn4KAwKClRk0b0igCbUWkEKCa4bxYHEYquoMFv pXd7qdlLKGOAOahizDUh5S1D5K7DQBGmQnkUDNiSvlDyFiG6UBA5aMhQ7vllIAxqJIJ+ YHew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91si5598003ots.139.2020.03.29.20.21.19; Sun, 29 Mar 2020 20:21:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729222AbgC3DVA (ORCPT + 99 others); Sun, 29 Mar 2020 23:21:00 -0400 Received: from cmccmta3.chinamobile.com ([221.176.66.81]:4016 "EHLO cmccmta3.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728987AbgC3DVA (ORCPT ); Sun, 29 Mar 2020 23:21:00 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.5]) by rmmx-syy-dmz-app09-12009 (RichMail) with SMTP id 2ee95e81658ecc9-03bf0; Mon, 30 Mar 2020 11:20:46 +0800 (CST) X-RM-TRANSID: 2ee95e81658ecc9-03bf0 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost (unknown[223.105.0.241]) by rmsmtp-syy-appsvr03-12003 (RichMail) with SMTP id 2ee35e81658d0c3-a4187; Mon, 30 Mar 2020 11:20:46 +0800 (CST) X-RM-TRANSID: 2ee35e81658d0c3-a4187 From: Haishuang Yan To: Simon Horman , Julian Anastasov , Pablo Neira Ayuso Cc: netdev@vger.kernel.org, lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Haishuang Yan Subject: [PATCH nf-next] ipvs: fix uninitialized variable warning Date: Mon, 30 Mar 2020 11:20:15 +0800 Message-Id: <1585538415-27583-1-git-send-email-yanhaishuang@cmss.chinamobile.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If outer_proto is not set, GCC warning as following: In file included from net/netfilter/ipvs/ip_vs_core.c:52: net/netfilter/ipvs/ip_vs_core.c: In function 'ip_vs_in_icmp': include/net/ip_vs.h:233:4: warning: 'outer_proto' may be used uninitialized in this function [-Wmaybe-uninitialized] 233 | printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \ | ^~~~~~ net/netfilter/ipvs/ip_vs_core.c:1666:8: note: 'outer_proto' was declared here 1666 | char *outer_proto; | ^~~~~~~~~~~ Fixes: 73348fed35d0 ("ipvs: optimize tunnel dumps for icmp errors") Signed-off-by: Haishuang Yan --- net/netfilter/ipvs/ip_vs_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c index d2ac530..aa6a603 100644 --- a/net/netfilter/ipvs/ip_vs_core.c +++ b/net/netfilter/ipvs/ip_vs_core.c @@ -1663,7 +1663,7 @@ static int ipvs_gre_decap(struct netns_ipvs *ipvs, struct sk_buff *skb, unsigned int offset, offset2, ihl, verdict; bool tunnel, new_cp = false; union nf_inet_addr *raddr; - char *outer_proto; + char *outer_proto = "IPIP"; *related = 1; @@ -1723,7 +1723,6 @@ static int ipvs_gre_decap(struct netns_ipvs *ipvs, struct sk_buff *skb, if (cih == NULL) return NF_ACCEPT; /* The packet looks wrong, ignore */ tunnel = true; - outer_proto = "IPIP"; } else if ((cih->protocol == IPPROTO_UDP || /* Can be UDP encap */ cih->protocol == IPPROTO_GRE) && /* Can be GRE encap */ /* Error for our tunnel must arrive at LOCAL_IN */ -- 1.8.3.1