50 lines
2 KiB
Diff
50 lines
2 KiB
Diff
diff -rupN wireguard-linux-compat.orig/src/compat/compat.h wireguard-linux-compat/src/compat/compat.h
|
|
--- wireguard-linux-compat.orig/src/compat/compat.h 2022-05-18 13:48:16.173696186 +0000
|
|
+++ wireguard-linux-compat/src/compat/compat.h 2022-05-18 13:54:54.027438354 +0000
|
|
@@ -414,16 +414,6 @@ static inline u64 __compat_jiffies64_to_
|
|
}
|
|
#define jiffies64_to_nsecs __compat_jiffies64_to_nsecs
|
|
#endif
|
|
-static inline u64 ktime_get_coarse_boottime_ns(void)
|
|
-{
|
|
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
|
|
- return ktime_to_ns(ktime_get_boottime());
|
|
-#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 12) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)) || LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 53)
|
|
- return ktime_to_ns(ktime_mono_to_any(ns_to_ktime(jiffies64_to_nsecs(get_jiffies_64())), TK_OFFS_BOOT));
|
|
-#else
|
|
- return ktime_to_ns(ktime_get_coarse_boottime());
|
|
-#endif
|
|
-}
|
|
#endif
|
|
|
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0)
|
|
@@ -1080,29 +1070,8 @@ static inline void skb_reset_redirect(st
|
|
#define pre_exit exit
|
|
#endif
|
|
|
|
-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
|
|
-#include <linux/skbuff.h>
|
|
-#include <linux/ip.h>
|
|
-#include <linux/ipv6.h>
|
|
-static inline __be16 ip_tunnel_parse_protocol(const struct sk_buff *skb)
|
|
-{
|
|
- if (skb_network_header(skb) >= skb->head &&
|
|
- (skb_network_header(skb) + sizeof(struct iphdr)) <= skb_tail_pointer(skb) &&
|
|
- ip_hdr(skb)->version == 4)
|
|
- return htons(ETH_P_IP);
|
|
- if (skb_network_header(skb) >= skb->head &&
|
|
- (skb_network_header(skb) + sizeof(struct ipv6hdr)) <= skb_tail_pointer(skb) &&
|
|
- ipv6_hdr(skb)->version == 6)
|
|
- return htons(ETH_P_IPV6);
|
|
- return 0;
|
|
-}
|
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) || defined(ISRHEL8)
|
|
-static const struct header_ops ip_tunnel_header_ops = { .parse_protocol = ip_tunnel_parse_protocol };
|
|
-#else
|
|
#define header_ops hard_header_len
|
|
#define ip_tunnel_header_ops *(char *)0 - (char *)0
|
|
-#endif
|
|
-#endif
|
|
|
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
|
|
#define kfree_sensitive(a) kzfree(a)
|