netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netfilter: nftables: fix warning in nft_reject
       [not found] <52cb0425.bwwhbZOarZlZjGHg%fengguang.wu@intel.com>
@ 2014-01-06 21:19 ` Eric Leblond
  2014-01-07 23:04   ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Leblond @ 2014-01-06 21:19 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel, Eric Leblond

The 0-day testing from Fenguang Wu issued the following warning:
 net/netfilter/nft_reject.c: In function 'nft_reject_eval':
 >> net/netfilter/nft_reject.c:37:14: warning: unused variable 'net' [-Wunused-variable]
      struct net *net = dev_net((pkt->in != NULL) ? pkt->in : pkt->out);

This is due to the fact that if IPv6 is not build the variable is
indeed unused.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Eric Leblond <eric@regit.org>
---
 net/netfilter/nft_reject.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/netfilter/nft_reject.c b/net/netfilter/nft_reject.c
index 0d690d4..c65fbd8 100644
--- a/net/netfilter/nft_reject.c
+++ b/net/netfilter/nft_reject.c
@@ -34,7 +34,9 @@ static void nft_reject_eval(const struct nft_expr *expr,
 			      const struct nft_pktinfo *pkt)
 {
 	struct nft_reject *priv = nft_expr_priv(expr);
+#if IS_ENABLED(CONFIG_NF_TABLES_IPV6)
 	struct net *net = dev_net((pkt->in != NULL) ? pkt->in : pkt->out);
+#endif
 
 	switch (priv->type) {
 	case NFT_REJECT_ICMP_UNREACH:
-- 
1.8.5.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] netfilter: nftables: fix warning in nft_reject
  2014-01-06 21:19 ` [PATCH] netfilter: nftables: fix warning in nft_reject Eric Leblond
@ 2014-01-07 23:04   ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2014-01-07 23:04 UTC (permalink / raw)
  To: Eric Leblond; +Cc: netfilter-devel

On Mon, Jan 06, 2014 at 10:19:14PM +0100, Eric Leblond wrote:
> The 0-day testing from Fenguang Wu issued the following warning:
>  net/netfilter/nft_reject.c: In function 'nft_reject_eval':
>  >> net/netfilter/nft_reject.c:37:14: warning: unused variable 'net' [-Wunused-variable]
>       struct net *net = dev_net((pkt->in != NULL) ? pkt->in : pkt->out);
> 
> This is due to the fact that if IPv6 is not build the variable is
> indeed unused.

Thanks Eric.

I sent this patch a bit earlier to address this:

http://patchwork.ozlabs.org/patch/307435/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-07 23:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <52cb0425.bwwhbZOarZlZjGHg%fengguang.wu@intel.com>
2014-01-06 21:19 ` [PATCH] netfilter: nftables: fix warning in nft_reject Eric Leblond
2014-01-07 23:04   ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).