Skip to content

Commit 4ea28b7

Browse files
committed
pivot wolfcryptified build of wireguard.ko on make WOLFCRYPT=1 (as already for wireguard-tools); tweak compat.h to allow building on kernels >= 5.6.0.
1 parent 34539f9 commit 4ea28b7

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/Kbuild

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ ccflags-$(if $(WIREGUARD_VERSION),y,) += -D'WIREGUARD_VERSION="$(WIREGUARD_VERSI
1010

1111
wireguard-y := main.o noise.o device.o peer.o timers.o queueing.o send.o receive.o socket.o peerlookup.o allowedips.o ratelimiter.o cookie.o netlink.o
1212

13-
# include $(src)/crypto/Kbuild.include
13+
ifndef WOLFCRYPT
14+
include $(src)/crypto/Kbuild.include
15+
endif
1416
include $(src)/compat/Kbuild.include
1517

1618
obj-$(if $(KBUILD_EXTMOD),m,$(CONFIG_WIREGUARD)) := wireguard.o
1719

18-
ccflags-y += -I$(src)/../../../../wolfssl -include $(src)/wolfcrypto_shim.h
20+
ifdef WOLFCRYPT
21+
ccflags-y += -DUSE_WOLFCRYPT -I$(src)/../../../../wolfssl -include $(src)/wolfcrypto_shim.h
1922
wireguard-y += wolfcrypto_shim.o
2023
KBUILD_EXTRA_SYMBOLS := $(src)/../../../../wolfssl/linuxkm/Module.symvers
24+
endif

src/compat/compat.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
#error "WireGuard requires Linux >= 3.10"
4343
#endif
4444

45-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
46-
#error "WireGuard has been merged into Linux >= 5.6 and therefore this compatibility module is no longer required."
47-
#endif
45+
/* #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) */
46+
/* #error "WireGuard has been merged into Linux >= 5.6 and therefore this compatibility module is no longer required." */
47+
/* #endif */
4848

4949
#if defined(ISRHEL7)
5050
#include <linux/skbuff.h>
@@ -872,7 +872,7 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb)
872872
#endif
873873
#endif
874874

875-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)
875+
#if !defined(USE_WOLFCRYPT) && (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0))
876876
#define blake2s_init zinc_blake2s_init
877877
#define blake2s_init_key zinc_blake2s_init_key
878878
#define blake2s_update zinc_blake2s_update

0 commit comments

Comments
 (0)