Skip to contentSkip to conversation

wireguard: fix build issue with updated 5.4 kernel

PATCH In review akuster 2 participants 3 messages Apr 4, 2021 – Apr 6, 2021

lore
Share & tools
lore

akuster

author
#0 lore raw

PATCH 1/1 wireguard: fix build issue with updated 5.4 kernel

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)
 |       |                    ^~~~~~~~~~~~~
---
 ...send-functions-were-backported-exten.patch | 32 +++++++++++++++++++
 .../wireguard-module_1.0.20200401.bb          |  3 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-kernel/wireguard/files/0001-compat-icmp_ndo_send-functions-were-backported-exten.patch
meta-networking/recipes-kernel/wireguard/files/0001-compat-icmp_ndo_send-functions-were-backported-exten.patch new file +32 -0
new file mode 100644
index 00000000000..f01cfe4e1c5
@@ -0,0 +1,32 @@
+From 122f06bfd8fc7b06a0899fa9adc4ce8e06900d98 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <[email protected]>
+Date: Sun, 7 Mar 2021 08:14:33 -0700
+Subject: [PATCH] compat: icmp_ndo_send functions were backported extensively
+
+Signed-off-by: Jason A. Donenfeld <[email protected]>
+
+Upstream-Status: Backport
+
+Fixes build with 5.4.103 update.
+/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);
+
+Signed-of-by: Armin Kuster <[email protected]>
+
+---
+ src/compat/compat.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: src/compat/compat.h
+===================================================================
+--- src.orig/compat/compat.h
++++ src/compat/compat.h
+@@ -946,7 +946,7 @@ static inline int skb_ensure_writable(st
+ }
+ #endif
+ 
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 102) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 178) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 223) && LINUX_VERSION_CODE > KERNEL_VERSION(4, 10, 0)) || LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 259) || defined(ISRHEL8) || defined(ISUBUNTU1804)
+ #if IS_ENABLED(CONFIG_NF_NAT)
+ #include <linux/ip.h>
+ #include <linux/icmpv6.h>
meta-networking/recipes-kernel/wireguard/wireguard-module_1.0.20200401.bb +2 -1
index e8891c4428a..6ed988bafa2 100644
@@ -3,7 +3,8 @@ require wireguard.inc
 SRCREV = "43f57dac7b8305024f83addc533c9eede6509129"
 
 SRC_URI = "git://git.zx2c4.com/wireguard-linux-compat \
-           file://0001-compat-SYM_FUNC_-START-END-were-backported-to-5.4.patch"
+           file://0001-compat-SYM_FUNC_-START-END-were-backported-to-5.4.patch \
+           file://0001-compat-icmp_ndo_send-functions-were-backported-exten.patch "
 
 inherit module kernel-module-split
 
Signature · 1 line
2.17.1
#1 lore raw

are we already past this patch in master ?

Quoted 68 lines · akuster

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)
  |       |                    ^~~~~~~~~~~~~
---
  ...send-functions-were-backported-exten.patch | 32 +++++++++++++++++++
  .../wireguard-module_1.0.20200401.bb          |  3 +-
  2 files changed, 34 insertions(+), 1 deletion(-)

create mode 100644 meta-networking/recipes-kernel/wireguard/files/0001-compat-icmp_ndo_send-functions-were-backported-exten.patch

meta-networking/recipes-kernel/wireguard/files/0001-compat-icmp_ndo_send-functions-were-backported-exten.patch new file +32 -0
new file mode 100644
index 00000000000..f01cfe4e1c5
@@ -0,0 +1,32 @@
+From 122f06bfd8fc7b06a0899fa9adc4ce8e06900d98 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <[email protected]>
+Date: Sun, 7 Mar 2021 08:14:33 -0700
+Subject: [PATCH] compat: icmp_ndo_send functions were backported extensively
+
+Signed-off-by: Jason A. Donenfeld <[email protected]>
+
+Upstream-Status: Backport
+
+Fixes build with 5.4.103 update.
+/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);
+
+Signed-of-by: Armin Kuster <[email protected]>
+
+---
+ src/compat/compat.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: src/compat/compat.h
+===================================================================
+--- src.orig/compat/compat.h
++++ src/compat/compat.h
+@@ -946,7 +946,7 @@ static inline int skb_ensure_writable(st
+ }
+ #endif
+
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 102) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 178) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 223) && LINUX_VERSION_CODE > KERNEL_VERSION(4, 10, 0)) || LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 259) || defined(ISRHEL8) || defined(ISUBUNTU1804)
+ #if IS_ENABLED(CONFIG_NF_NAT)
+ #include <linux/ip.h>
+ #include <linux/icmpv6.h>
meta-networking/recipes-kernel/wireguard/wireguard-module_1.0.20200401.bb +2 -1
index e8891c4428a..6ed988bafa2 100644
@@ -3,7 +3,8 @@ require wireguard.inc
  SRCREV = "43f57dac7b8305024f83addc533c9eede6509129"
 
  SRC_URI = "git://git.zx2c4.com/wireguard-linux-compat \
-           file://0001-compat-SYM_FUNC_-START-END-were-backported-to-5.4.patch"
+           file://0001-compat-SYM_FUNC_-START-END-were-backported-to-5.4.patch \
+           file://0001-compat-icmp_ndo_send-functions-were-backported-exten.patch "
 
  inherit module kernel-module-split
 
author
#2 lore raw
Quoted 1 line · Khem Raj

are we already past this patch in master ?

Nope. Its the last commit in the repo.  We need to update to v1.0.20210219
<https://git.zx2c4.com/wireguard-linux-compat/tag/?h=v1.0.20210219> then one commit beyond.

hardknott and Gatesgarth will need this to but are excluded from world builds so it didn't register as an issue. I will send patches/update

I was wondering if this would work

RDEPENDS_${PN} = "KERNEL_VERSION (< 5.6 )"

-armin

Quoted 95 lines · akuster
Quoted 90 lines

  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)
  |       |                    ^~~~~~~~~~~~~

---
  ...send-functions-were-backported-exten.patch | 32 +++++++++++++++++++ .../wireguard-module_1.0.20200401.bb          |  3 +-

  2 files changed, 34 insertions(+), 1 deletion(-)

  create mode 100644 meta-networking/recipes-kernel/wireguard/files/0001-compat-icmp_ndo_send-functions-were-backported-exten.patch

diff --git a/meta-networking/recipes-kernel/wireguard/files/0001-compat-icmp_ndo_send-functions-were-backported-exten.patch b/meta-networking/recipes-kernel/wireguard/files/0001-compat-icmp_ndo_send-functions-were-backported-exten.patch

new file mode 100644
index 00000000000..f01cfe4e1c5
--- /dev/null
+++
b/meta-networking/recipes-kernel/wireguard/files/0001-compat-icmp_ndo_send-functions-were-backported-exten.patch

meta-networking/recipes-kernel/wireguard/files/0001-compat-icmp_ndo_send-functions-were-backported-exten.patch new file +4 -0
@@ -0,0 +1,32 @@
+From 122f06bfd8fc7b06a0899fa9adc4ce8e06900d98 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <[email protected]>
+Date: Sun, 7 Mar 2021 08:14:33 -0700
+Subject: [PATCH] compat: icmp_ndo_send functions were backported

extensively

meta-networking/recipes-kernel/wireguard/files/0001-compat-icmp_ndo_send-functions-were-backported-exten.patch new file +7 -0
+
+Signed-off-by: Jason A. Donenfeld <[email protected]>
+
+Upstream-Status: Backport
+
+Fixes build with 5.4.103 update.
+/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);

meta-networking/recipes-kernel/wireguard/files/0001-compat-icmp_ndo_send-functions-were-backported-exten.patch new file +17 -0
+
+Signed-of-by: Armin Kuster <[email protected]>
+
+---
+ src/compat/compat.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: src/compat/compat.h
+===================================================================
+--- src.orig/compat/compat.h
++++ src/compat/compat.h
+@@ -946,7 +946,7 @@ static inline int skb_ensure_writable(st
+ }
+ #endif
+
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0) &&

LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 102) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 178) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 223) && LINUX_VERSION_CODE > KERNEL_VERSION(4, 10, 0)) || LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 259) || defined(ISRHEL8) || defined(ISUBUNTU1804)
+ #if IS_ENABLED(CONFIG_NF_NAT)
+ #include <linux/ip.h>
+ #include <linux/icmpv6.h>
diff --git a/meta-networking/recipes-kernel/wireguard/wireguard-module_1.0.20200401.bb b/meta-networking/recipes-kernel/wireguard/wireguard-module_1.0.20200401.bb

index e8891c4428a..6ed988bafa2 100644
---
a/meta-networking/recipes-kernel/wireguard/wireguard-module_1.0.20200401.bb
+++
b/meta-networking/recipes-kernel/wireguard/wireguard-module_1.0.20200401.bb

(quoted diff) +0 -0
@@ -3,7 +3,8 @@ require wireguard.inc

  SRCREV = "43f57dac7b8305024f83addc533c9eede6509129" SRC_URI = "git://git.zx2c4.com/wireguard-linux-compat \
- file://0001-compat-SYM_FUNC_-START-END-were-backported-to-5.4.patch" + file://0001-compat-SYM_FUNC_-START-END-were-backported-to-5.4.patch \
+ file://0001-compat-icmp_ndo_send-functions-were-backported-exten.patch " inherit module kernel-module-split