aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-11-05 01:28:11 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-11-05 01:29:00 +0100
commit9daabea159a03efb42048736e7b437d4d8700df1 (patch)
tree2a481cc8913a40d7f2bce0201e7cc7aa63a37042
parentqemu: bump default kernel (diff)
downloadwireguard-monolithic-historical-9daabea159a03efb42048736e7b437d4d8700df1.tar.xz
wireguard-monolithic-historical-9daabea159a03efb42048736e7b437d4d8700df1.zip
compat: csum_levels is new in 3.18 but backported to RHEL
-rw-r--r--src/compat/compat.h1
-rw-r--r--src/receive.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h
index 6223f9d..c4b20ae 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -149,6 +149,7 @@ static inline void netif_keep_dst(struct net_device *dev)
{
dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
}
+#define COMPAT_CANNOT_USE_CSUM_LEVEL
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0) && !defined(ISRHEL7)
diff --git a/src/receive.c b/src/receive.c
index 81140e9..5417ab9 100644
--- a/src/receive.c
+++ b/src/receive.c
@@ -386,7 +386,9 @@ static void wg_packet_consume_data_done(struct wg_peer *peer,
* again in software.
*/
skb->ip_summed = CHECKSUM_UNNECESSARY;
+#ifndef COMPAT_CANNOT_USE_CSUM_LEVEL
skb->csum_level = ~0; /* All levels */
+#endif
skb->protocol = wg_skb_examine_untrusted_ip_hdr(skb);
if (skb->protocol == htons(ETH_P_IP)) {
len = ntohs(ip_hdr(skb)->tot_len);