From: Frank Wunderlich <linux@fw-web.de>
To: "David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Frank Wunderlich <frank-w@public-files.de>
Subject: [PATCH] net: wireguard: fix error with icmp{,v6}_ndo_send in 5.4
Date: Mon, 15 Mar 2021 14:21:03 +0100 [thread overview]
Message-ID: <20210315132103.129386-1-linux@fw-web.de> (raw)
From: Frank Wunderlich <frank-w@public-files.de>
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")
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
net/wireguard/compat/compat.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/wireguard/compat/compat.h b/net/wireguard/compat/compat.h
index 42f7beecaa5c..7cdb0b253c60 100644
--- a/net/wireguard/compat/compat.h
+++ b/net/wireguard/compat/compat.h
@@ -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
--
2.25.1
next reply other threads:[~2021-03-15 13:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-15 13:21 Frank Wunderlich [this message]
2021-03-16 16:17 ` Aw: [PATCH] net: wireguard: fix error with icmp{,v6}_ndo_send in 5.4 Frank Wunderlich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210315132103.129386-1-linux@fw-web.de \
--to=linux@fw-web.de \
--cc=davem@davemloft.net \
--cc=frank-w@public-files.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).