diff options
author | Nathan Chancellor <natechancellor@gmail.com> | 2019-08-24 22:37:50 -0700 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-08-25 11:02:19 -0600 |
commit | 278fd990d06c3c3619df508c81e76ad20f106a12 (patch) | |
tree | 9a5189347566558331360b5d99b3afcc8add465a /src/compat | |
parent | fe3034afaf77dd7b902d13860eec40f6d89e621d (diff) |
compat: account for android-4.9 backport of addr_gen_mode
Android kernels backported d35a00b8e33dab7385f724e713ae71c8be0a49f4, so
now we need to do feature detection.
Link: https://android-review.googlesource.com/c/kernel/common/+/1103831
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/compat')
-rw-r--r-- | src/compat/Kbuild.include | 4 | ||||
-rw-r--r-- | src/compat/compat.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/compat/Kbuild.include b/src/compat/Kbuild.include index 7404992..db4b0a6 100644 --- a/src/compat/Kbuild.include +++ b/src/compat/Kbuild.include @@ -47,6 +47,10 @@ ccflags-y += -include $(kbuild-dir)/compat/memneq/include.h wireguard-y += compat/memneq/memneq.o endif +ifeq ($(shell grep -s -F "addr_gen_mode" "$(srctree)/include/linux/ipv6.h"),) +ccflags-y += -DCOMPAT_CANNOT_USE_DEV_CNF +endif + ifdef CONFIG_HZ ifeq ($(wildcard $(srctree)/include/generated/timeconst.h),) ccflags-y += $(shell echo 'define gcd(a,b){auto t;while(b){t=b;b=a%b;a=t;};return a;};hz=$(CONFIG_HZ);cd=gcd(hz,1000000);print "-DHZ_TO_USEC_NUM=",1000000/cd," -DHZ_TO_USEC_DEN=",hz/cd;halt;' | bc -q) diff --git a/src/compat/compat.h b/src/compat/compat.h index c98d623..fb09037 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -600,10 +600,6 @@ static int wg_get_device_dump_real(a, b) #define COMPAT_CANNOT_USE_IN6_DEV_GET #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) -#define COMPAT_CANNOT_USE_DEV_CNF -#endif - #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) #define COMPAT_CANNOT_USE_IFF_NO_QUEUE #endif |