netfilter: nftables: fix warning in nft_reject
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): 52cb0425.bwwhbZOarZlZjGHg%[email protected]
PATCH 1/1 netfilter: nftables: fix warning in nft_reject
The 0-day testing from Fenguang Wu issued the following warning:
net/netfilter/nft_reject.c: In function 'nft_reject_eval':
Quoted 1 line
Quoted 1 line
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.
--- net/netfilter/nft_reject.c | 2 ++ 1 file changed, 2 insertions(+)
net/netfilter/nft_reject.c +2 -0
@@ -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 :
Signature · 1 line
1.8.5.2
Pablo Neira Ayuso
maintainerQuoted 7 lines · Eric Leblond
The 0-day testing from Fenguang Wu issued the following warning:
net/netfilter/nft_reject.c: In function 'nft_reject_eval':Quoted 1 line
Quoted 1 line
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: