Skip to contentSkip to conversation

xfrm: avoid compiler warning when ipv6 is disabled

PATCH Applied Florian Westphal 2 participants 2 messages Jun 15, 2021 – Jun 18, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfrm: avoid compiler warning when ipv6 is disabled

with CONFIG_IPV6=n:
xfrm_output.c:140:12: warning: 'xfrm6_hdr_offset' defined but not used

Fixes 9acf4d3b9ec1 ("xfrm: ipv6: add xfrm6_hdr_offset helper")
---
 net/xfrm/xfrm_output.c | 2 ++
 1 file changed, 2 insertions(+)
net/xfrm/xfrm_output.c +2 -0
index 3709d3f7c5ce..527da58464f3 100644
@@ -137,6 +137,7 @@ static int mip6_rthdr_offset(struct sk_buff *skb, u8 **nexthdr, int type)
 }
 #endif
 
+#if IS_ENABLED(CONFIG_IPV6)
 static int xfrm6_hdr_offset(struct xfrm_state *x, struct sk_buff *skb, u8 **prevhdr)
 {
 	switch (x->type->proto) {
@@ -151,6 +152,7 @@ static int xfrm6_hdr_offset(struct xfrm_state *x, struct sk_buff *skb, u8 **prev
 
 	return ip6_find_1stfragopt(skb, prevhdr);
 }
+#endif
 
 /* Add encapsulation header.
  *
Signature · 1 line
2.31.1
maintainer Applied
#1 lore raw
Quoted 5 lines · Florian Westphal

with CONFIG_IPV6=n:
xfrm_output.c:140:12: warning: 'xfrm6_hdr_offset' defined but not used

Fixes 9acf4d3b9ec1 ("xfrm: ipv6: add xfrm6_hdr_offset helper")

Applied, thanks!