aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/compat/udp_tunnel
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-05-14 01:17:07 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-05-17 18:07:42 +0200
commit386740835eb329c3432ee5e7781d6639a450ae16 (patch)
tree06b8110b1756ad19fc27cac25f5079fff8f3e243 /src/compat/udp_tunnel
parentcompat: use real crypto_memneq (diff)
downloadwireguard-monolithic-historical-386740835eb329c3432ee5e7781d6639a450ae16.tar.xz
wireguard-monolithic-historical-386740835eb329c3432ee5e7781d6639a450ae16.zip
compat: remember to call iptunnel_xmit_stats
Upstream's 039f50629b7f860f36644ed1f34b27da9aa62f43 only came in 4.5
Diffstat (limited to 'src/compat/udp_tunnel')
-rw-r--r--src/compat/udp_tunnel/udp_tunnel.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/compat/udp_tunnel/udp_tunnel.c b/src/compat/udp_tunnel/udp_tunnel.c
index 94d7df8..4a74d63 100644
--- a/src/compat/udp_tunnel/udp_tunnel.c
+++ b/src/compat/udp_tunnel/udp_tunnel.c
@@ -179,6 +179,10 @@ void udp_tunnel_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb
bool xnet, bool nocheck)
{
struct udphdr *uh;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
+ struct net_device *dev = skb->dev;
+ int ret;
+#endif
__skb_push(skb, sizeof(*uh));
skb_reset_transport_header(skb);
@@ -196,12 +200,17 @@ void udp_tunnel_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb
skb->sk = sk;
if (!skb->destructor)
skb->destructor = fake_destructor;
-
- iptunnel_xmit(
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
+ ret =
+#endif
+ iptunnel_xmit(
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
- sk,
+ sk,
+#endif
+ rt, skb, src, dst, IPPROTO_UDP, tos, ttl, df, xnet);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
+ iptunnel_xmit_stats(ret, &dev->stats, dev->tstats);
#endif
- rt, skb, src, dst, IPPROTO_UDP, tos, ttl, df, xnet);
}
EXPORT_SYMBOL_GPL(udp_tunnel_xmit_skb);