diff -Nru wireguard-linux-compat-1.0.20201112/debian/changelog wireguard-linux-compat-1.0.20201112/debian/changelog --- wireguard-linux-compat-1.0.20201112/debian/changelog 2020-11-23 20:29:58.000000000 +0000 +++ wireguard-linux-compat-1.0.20201112/debian/changelog 2022-08-30 11:35:44.000000000 +0100 @@ -1,3 +1,13 @@ +wireguard-linux-compat (1.0.20201112-1~18.04.4) bionic; urgency=medium + + * Update compatibility layer to support new v4.15 stable changes. LP: + #1988147 + * Update debian/control debhelper depends to the one that doesn't + confuse future maintainers. + * Skip burned upload numbers. + + -- Dimitri John Ledkov Tue, 30 Aug 2022 11:35:44 +0100 + wireguard-linux-compat (1.0.20201112-1~18.04.1) bionic; urgency=medium * Backport latest upstream packages to bionic (LP: #1905325). diff -Nru wireguard-linux-compat-1.0.20201112/debian/control wireguard-linux-compat-1.0.20201112/debian/control --- wireguard-linux-compat-1.0.20201112/debian/control 2020-11-23 20:29:58.000000000 +0000 +++ wireguard-linux-compat-1.0.20201112/debian/control 2022-08-30 11:35:44.000000000 +0100 @@ -6,7 +6,7 @@ Uploaders: Unit 193 , Build-Depends: - debhelper-compat (= 10), + debhelper (>= 10), dkms, Standards-Version: 4.5.0 Homepage: https://www.wireguard.com diff -Nru wireguard-linux-compat-1.0.20201112/debian/patches/0001-compat-Update-for-additional-v4.15-stable-backports.patch wireguard-linux-compat-1.0.20201112/debian/patches/0001-compat-Update-for-additional-v4.15-stable-backports.patch --- wireguard-linux-compat-1.0.20201112/debian/patches/0001-compat-Update-for-additional-v4.15-stable-backports.patch 1970-01-01 01:00:00.000000000 +0100 +++ wireguard-linux-compat-1.0.20201112/debian/patches/0001-compat-Update-for-additional-v4.15-stable-backports.patch 2022-08-30 11:35:44.000000000 +0100 @@ -0,0 +1,64 @@ +From 0bb6483ace1198e356e25efe0a8aa9f8c89090b7 Mon Sep 17 00:00:00 2001 +From: Dimitri John Ledkov +Date: Tue, 30 Aug 2022 11:29:03 +0100 +Subject: [PATCH] compat: Update for additional v4.15 stable backports + +Signed-off-by: Dimitri John Ledkov +--- + src/compat/compat.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +Index: wireguard-linux-compat-1.0.20201112/src/compat/compat.h +=================================================================== +--- wireguard-linux-compat-1.0.20201112.orig/src/compat/compat.h ++++ wireguard-linux-compat-1.0.20201112/src/compat/compat.h +@@ -330,6 +330,7 @@ static inline int wait_for_random_bytes( + + #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) && (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) || LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 285)) && (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) || LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 320)) && !defined(ISRHEL8) + #include ++#ifndef HAVE_RNG_IS_INITIALIZED_BACKPORT + #include + struct rng_is_initialized_callback { + struct random_ready_callback cb; +@@ -370,6 +371,7 @@ static inline bool rng_is_initialized(vo + } + return false; + } ++#endif + #elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) + /* This is a disaster. Without this API, we really have no way of + * knowing if it's initialized. We just return that it has and hope +@@ -708,6 +710,7 @@ static inline void *skb_put_data(struct + #endif + + #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) && (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) || LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 285)) && (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) || LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 320)) ++#ifndef HAVE_LE32_TO_CPU_ARRAY_BACKPORT + static inline void le32_to_cpu_array(u32 *buf, unsigned int words) + { + while (words--) { +@@ -723,6 +726,7 @@ static inline void cpu_to_le32_array(u32 + } + } + #endif ++#endif + + #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) + #include +Index: wireguard-linux-compat-1.0.20201112/src/dkms.conf +=================================================================== +--- wireguard-linux-compat-1.0.20201112.orig/src/dkms.conf ++++ wireguard-linux-compat-1.0.20201112/src/dkms.conf +@@ -13,3 +13,13 @@ else + # upstream requires kernel 3.10 - 5.5, inclusive: + BUILD_EXCLUSIVE_KERNEL="^((5\.[0-5]($|[.-]))|(4\.)|(3\.1[0-9]))" + fi ++ ++DEFINES="" ++if grep -q '^static inline void le32_to_cpu_array(' $kernel_source_dir/include/linux/byteorder/generic.h; then ++ DEFINES+=CFLAGS_MODULE+="-DHAVE_LE32_TO_CPU_ARRAY_BACKPORT " ++fi ++if grep -q '^bool rng_is_initialized(' $kernel_source_dir/include/linux/random.h; then ++ DEFINES+=CFLAGS_MODULE+="-DHAVE_RNG_IS_INITIALIZED_BACKPORT " ++fi ++ ++MAKE[0]="make -C $kernel_source_dir M=$dkms_tree/$module/$module_version/build $DEFINES" diff -Nru wireguard-linux-compat-1.0.20201112/debian/patches/0001-compat-handle-backported-rng-and-blake2s.patch wireguard-linux-compat-1.0.20201112/debian/patches/0001-compat-handle-backported-rng-and-blake2s.patch --- wireguard-linux-compat-1.0.20201112/debian/patches/0001-compat-handle-backported-rng-and-blake2s.patch 1970-01-01 01:00:00.000000000 +0100 +++ wireguard-linux-compat-1.0.20201112/debian/patches/0001-compat-handle-backported-rng-and-blake2s.patch 2022-08-30 11:31:54.000000000 +0100 @@ -0,0 +1,66 @@ +From 3ec3e822b615e8f07ed0dfc464e026bb508bbcdc Mon Sep 17 00:00:00 2001 +From: "Jason A. Donenfeld" +Date: Wed, 22 Jun 2022 15:41:15 +0200 +Subject: [PATCH] compat: handle backported rng and blake2s + +Signed-off-by: Jason A. Donenfeld +--- + src/compat/compat.h | 12 +++++++----- + src/tests/qemu/Makefile | 2 +- + 2 files changed, 8 insertions(+), 6 deletions(-) + +Index: wireguard-linux-compat-1.0.20201112/src/compat/compat.h +=================================================================== +--- wireguard-linux-compat-1.0.20201112.orig/src/compat/compat.h ++++ wireguard-linux-compat-1.0.20201112/src/compat/compat.h +@@ -284,7 +284,7 @@ static const struct in6_addr __compat_in + #define in6addr_any __compat_in6addr_any + #endif + +-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) && (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) || LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 320)) + #include + #include + #include +@@ -328,7 +328,7 @@ static inline int wait_for_random_bytes( + } + #endif + +-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) && !defined(ISRHEL8) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) && (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) || LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 285)) && (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) || LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 320)) && !defined(ISRHEL8) + #include + #include + struct rng_is_initialized_callback { +@@ -380,7 +380,7 @@ static inline bool rng_is_initialized(vo + } + #endif + +-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) && (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) || LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 320)) + static inline int get_random_bytes_wait(void *buf, int nbytes) + { + int ret = wait_for_random_bytes(); +@@ -707,7 +707,7 @@ static inline void *skb_put_data(struct + #endif + #endif + +-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) && (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) || LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 285)) && (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) || LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 320)) + static inline void le32_to_cpu_array(u32 *buf, unsigned int words) + { + while (words--) { +@@ -872,11 +872,13 @@ static inline void skb_mark_not_on_list( + #endif + #endif + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 200) || (LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 249)) || (LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 285)) || (LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 320)) + #define blake2s_init zinc_blake2s_init + #define blake2s_init_key zinc_blake2s_init_key + #define blake2s_update zinc_blake2s_update + #define blake2s_final zinc_blake2s_final ++#endif ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0) + #define blake2s_hmac zinc_blake2s_hmac + #define chacha20 zinc_chacha20 + #define hchacha20 zinc_hchacha20 diff -Nru wireguard-linux-compat-1.0.20201112/debian/patches/series wireguard-linux-compat-1.0.20201112/debian/patches/series --- wireguard-linux-compat-1.0.20201112/debian/patches/series 2020-11-23 20:29:58.000000000 +0000 +++ wireguard-linux-compat-1.0.20201112/debian/patches/series 2022-08-30 11:35:44.000000000 +0100 @@ -1,2 +1,4 @@ 0001-Makefile-do-not-use-git-to-get-version-number.patch 0002-Avoid-trying-to-compile-on-debian-5.5-kernels-Closes.patch +0001-compat-handle-backported-rng-and-blake2s.patch +0001-compat-Update-for-additional-v4.15-stable-backports.patch