lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190325135336.2107801-1-arnd@arndb.de>
Date:   Mon, 25 Mar 2019 14:53:05 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Pablo Neira Ayuso <pablo@...filter.org>,
        Jozsef Kadlecsik <kadlec@...ckhole.kfki.hu>,
        Florian Westphal <fw@...len.de>,
        "David S. Miller" <davem@...emloft.net>
Cc:     Arnd Bergmann <arnd@...db.de>, netfilter-devel@...r.kernel.org,
        coreteam@...filter.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] netfilter: nat: avoid unused-variable warning

masq_refcnt6 was added at the start of the file, but it is
only used in the option IPv6 section of the file, causing
a harmless compiler warning if IPv6 is disabled:

net/netfilter/nf_nat_masquerade.c:15:21: error: 'masq_refcnt6' defined but not used [-Werror=unused-variable]
 static unsigned int masq_refcnt6 __read_mostly;

Move the variable next to the user to avoid that warning.

Fixes: 46f7487e161b ("netfilter: nat: don't register device notifier twice")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
----
This is an older patch stack, for some reason I seem to have never
sent it, and I can't find any indication of anyone else sending
a similar fix, so sending this out now.

If it's already fixed upstream, please ignore.
---
 net/netfilter/nf_nat_masquerade.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/netfilter/nf_nat_masquerade.c b/net/netfilter/nf_nat_masquerade.c
index d85c4d902e7b..878a73b4f65c 100644
--- a/net/netfilter/nf_nat_masquerade.c
+++ b/net/netfilter/nf_nat_masquerade.c
@@ -12,7 +12,6 @@
 
 static DEFINE_MUTEX(masq_mutex);
 static unsigned int masq_refcnt4 __read_mostly;
-static unsigned int masq_refcnt6 __read_mostly;
 
 unsigned int
 nf_nat_masquerade_ipv4(struct sk_buff *skb, unsigned int hooknum,
@@ -322,6 +321,8 @@ static struct notifier_block masq_inet6_notifier = {
 	.notifier_call	= masq_inet6_event,
 };
 
+static unsigned int masq_refcnt6 __read_mostly;
+
 int nf_nat_masquerade_ipv6_register_notifier(void)
 {
 	int ret = 0;
-- 
2.20.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ