]> git.baikalelectronics.ru Git - kernel.git/commitdiff
xfrm: fix unused variable warning if CONFIG_NETFILTER=n
authorFlorian Westphal <fw@strlen.de>
Mon, 11 May 2020 08:33:42 +0000 (10:33 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Mon, 11 May 2020 13:12:27 +0000 (15:12 +0200)
After recent change 'x' is only used when CONFIG_NETFILTER is set:

net/ipv4/xfrm4_output.c: In function '__xfrm4_output':
net/ipv4/xfrm4_output.c:19:21: warning: unused variable 'x' [-Wunused-variable]
   19 |  struct xfrm_state *x = skb_dst(skb)->xfrm;

Expand the CONFIG_NETFILTER scope to avoid this.

Fixes: 093b5a5476ed ("xfrm: remove output_finish indirection from xfrm_state_afinfo")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/ipv4/xfrm4_output.c

index 502eb189d852cfd7789a7dfbbd9f01c3de11b113..3cff51ba72bb019d920554fa653937d729469b32 100644 (file)
@@ -16,9 +16,9 @@
 
 static int __xfrm4_output(struct net *net, struct sock *sk, struct sk_buff *skb)
 {
+#ifdef CONFIG_NETFILTER
        struct xfrm_state *x = skb_dst(skb)->xfrm;
 
-#ifdef CONFIG_NETFILTER
        if (!x) {
                IPCB(skb)->flags |= IPSKB_REROUTED;
                return dst_output(net, sk, skb);