Skip to contentSkip to conversation

net: wireguard: fix error with icmp{,v6}_ndo_send in 5.4

PATCH In review Frank Wunderlich 2 participants 2 messages Mar 15, 2021 – Mar 16, 2021

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

PATCH 1/1 net: wireguard: fix error with icmp{,v6}_ndo_send in 5.4

From: Frank Wunderlich <[email protected]>

commit 2019554f9656 introduces implementation of icmp{,v6}_ndo_send in include/linux/icmp{,v6}.h in case of NF_NAT is enabled. Now these functions are defined twice in wireguard. Fix this by hiding code if NF_NAT is set (reverse condition as in icmp*.h)

././net/wireguard/compat/compat.h:959:20: error: static declaration of 'icmp_ndo_send' follows non-static declaration
959 | static inline void icmp_ndo_send(struct sk_buff *skb_in, int type, int code, __be32 info)
./include/net/icmp.h:47:6: note: previous declaration of 'icmp_ndo_send' was here
47 | void icmp_ndo_send(struct sk_buff *skb_in, int type, int code, __be32 info);
././net/wireguard/compat/compat.h:988:20: error: static declaration of 'icmpv6_ndo_send' follows non-static declaration
988 | static inline void icmpv6_ndo_send(struct sk_buff *skb_in, u8 type, u8 code, __u32 info)
./include/linux/icmpv6.h:56:6: note: previous declaration of 'icmpv6_ndo_send' was here
56 | void icmpv6_ndo_send(struct sk_buff *skb_in, u8 type, u8 code, __u32 info);

Fixes 2019554f9656 ("icmp: introduce helper for nat'd source address in network device context")
---
 net/wireguard/compat/compat.h | 2 ++
 1 file changed, 2 insertions(+)
net/wireguard/compat/compat.h +2 -0
index 42f7beecaa5c..7cdb0b253c60 100644
@@ -956,6 +956,7 @@ static inline int skb_ensure_writable(struct sk_buff *skb, int write_len)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
 #include <net/netfilter/nf_nat_core.h>
 #endif
+#if !IS_ENABLED(CONFIG_NF_NAT)
 static inline void icmp_ndo_send(struct sk_buff *skb_in, int type, int code, __be32 info)
 {
 	struct sk_buff *cloned_skb = NULL;
@@ -1014,6 +1015,7 @@ static inline void icmpv6_ndo_send(struct sk_buff *skb_in, u8 type, u8 code, __u
 out:
 	consume_skb(cloned_skb);
 }
+#endif
 #else
 #define icmp_ndo_send icmp_send
 #define icmpv6_ndo_send icmpv6_send
Signature · 1 line
2.25.1
#1 lore raw

Hi,

sorry, please ignore this
wireguard was included with 5.6, my 5.4 uses external wireguard

regards Frank