From patchwork Fri Oct 28 15:31:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101578 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp1237689qge; Fri, 28 Oct 2016 08:31:59 -0700 (PDT) X-Received: by 10.98.21.197 with SMTP id 188mr25785575pfv.38.1477668718831; Fri, 28 Oct 2016 08:31:58 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o9si14104785pgc.284.2016.10.28.08.31.58; Fri, 28 Oct 2016 08:31:58 -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 S965106AbcJ1Pby (ORCPT + 27 others); Fri, 28 Oct 2016 11:31:54 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:60871 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937846AbcJ1Pbw (ORCPT ); Fri, 28 Oct 2016 11:31:52 -0400 Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue003) with ESMTPA (Nemesis) id 0Lx3Yj-1cxJGM28vR-016cpC; Fri, 28 Oct 2016 17:31:31 +0200 From: Arnd Bergmann To: Pablo Neira Ayuso Cc: Arnd Bergmann , Patrick McHardy , Jozsef Kadlecsik , "David S. Miller" , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Florian Westphal , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [rfc, netfilter-next] netfilter: nf_tables: fib warnings Date: Fri, 28 Oct 2016 17:31:12 +0200 Message-Id: <20161028153124.3773180-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 MIME-Version: 1.0 X-Provags-ID: V03:K0:4dww37cdQijtsUNvos9/I8M1j4JK+8EMLQAqLfMsMFijPTn2rW0 YZVnmurH95LK+YgSWJIlhH4MvJn4yuq2AJn7f6mbOnjwTAvcCYd/D3iuiOQ8JFt66JhM8AK +A8kHWdTGVqwJf6BJatmcadO8ZGHyUNHtADG4AO+HjFqBMAWOqaEbGPeHUc632FsfQ15xS6 URA46a3CebX7RRLEexo3Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:B7iYxUjtVHA=:51JQawS6aPNetIYiFHwgsz MKzfvhtJYEjVbrIsOMajZbWTk44qgHH95fXOo8rELFWZV9D29Bz4pAwD6oN0FwFBG17LVwm0o V00Nmdy8vphRv0iGyn3yTdmLgQMRf85zKDGihPxZClBsjDTGivu6Xo4sZtHhPP7BN0utcc4iD f9aJ70w8SUnE8E/7NAW30K1IhuX6moxaTp4ZUY3MrYCTJjnZK0BdpKBm8IsaKjVZkFFlTtY9r o3opSg7R+bcidhWoQDeKQcyQl1+o7fBBtrt4C3P+iK1NIUpXM7WBUohNoCfJNKew4Jc7eqNvC JzR9QqcIAOB5oJphUH7qlYtlQ7gTPqurRQxmQ7yLmVWPdk7BWMKePasGKUVd5ujdrcB4geFnz HMOvlj+40vnaCA1fN3q2gm+GvyhV/zh4ui7htU/QDrr4nEuo1IHfTYN1UZq8TYYsGjKaOFMat 3i0dYT0meu5R1qww0xygTyuxkoaDLp4bG2rx8rVfr82CgLUthRtuXlnFrbovIEQLk+FPkwDwH hWtAv9p8YYev7VQ4hxCouytCvyvXKK6z67FD8xt48TE0OEpQSgxes4fS6ugvMbNkk3qoJslLB rH0OQz6T25e8XHAmngNA1jZkYdUBWrCOrz7iosxqjeCWLLAVKqykwdw6UCpUxXPd3hSJ39Rxx aBvr9ZNg9U7dEPBDRsJ2J7Vas1hkIh0re5TZlO0YoHl6U2yLpnCJVqbd8fMj5IV1zLOg7PNV6 Nqxkeq3IyV5grUfF Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The newly added nft fib code produces two warnings: net/ipv4/netfilter/nft_fib_ipv4.c: In function 'nft_fib4_eval': net/ipv4/netfilter/nft_fib_ipv4.c:80:6: error: unused variable 'i' [-Werror=unused-variable] net/ipv4/netfilter/nft_fib_ipv4.c: In function ‘nft_fib4_eval’: net/ipv4/netfilter/nft_fib_ipv4.c:137:6: error: ‘oif’ may be used uninitialized in this function [-Werror=maybe-uninitialized] The first one is obvious as the only user of that variable is inside of an #ifdef, but the second one is a bit trickier. It is clear that 'oif' is uninitialized here if neither NFTA_FIB_F_OIF nor NFTA_FIB_F_IIF are set. I have no idea how that should be handled, this patch just returns without doing anything, which may or may not be the right thing to do. Fixes: 84f5eedb983e ("netfilter: nf_tables: add fib expression") Signed-off-by: Arnd Bergmann --- net/ipv4/netfilter/nft_fib_ipv4.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.9.0 diff --git a/net/ipv4/netfilter/nft_fib_ipv4.c b/net/ipv4/netfilter/nft_fib_ipv4.c index 6787c563cfc9..b29f70593e8b 100644 --- a/net/ipv4/netfilter/nft_fib_ipv4.c +++ b/net/ipv4/netfilter/nft_fib_ipv4.c @@ -77,7 +77,9 @@ void nft_fib4_eval(const struct nft_expr *expr, struct nft_regs *regs, }; const struct net_device *oif; struct net_device *found; +#ifdef CONFIG_IP_ROUTE_MULTIPATH int i; +#endif /* * Do not set flowi4_oif, it restricts results (for example, asking @@ -90,6 +92,8 @@ void nft_fib4_eval(const struct nft_expr *expr, struct nft_regs *regs, oif = pkt->out; else if (priv->flags & NFTA_FIB_F_IIF) oif = pkt->in; + else + return; if (pkt->hook == NF_INET_PRE_ROUTING && fib4_is_local(pkt->skb)) { nft_fib_store_result(dest, priv->result, pkt, LOOPBACK_IFINDEX);