aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-04-14 10:57:12 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-04-14 10:57:12 +0200
commitd8e4c98cf20c97246dc747b934d9cacd515ee3f0 (patch)
treea4869a40885142d93c15fc890853b2c6edddf6b2
parentversion: bump snapshot (diff)
downloadWireGuard-d8e4c98cf20c97246dc747b934d9cacd515ee3f0.tar.xz
WireGuard-d8e4c98cf20c97246dc747b934d9cacd515ee3f0.zip
compat: udp_tunnel: force cast sk_data_ready
Reference: https://lists.zx2c4.com/pipermail/wireguard/2019-April/004081.html
-rw-r--r--src/compat/udp_tunnel/udp_tunnel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compat/udp_tunnel/udp_tunnel.c b/src/compat/udp_tunnel/udp_tunnel.c
index 6afb11dc..dc47d616 100644
--- a/src/compat/udp_tunnel/udp_tunnel.c
+++ b/src/compat/udp_tunnel/udp_tunnel.c
@@ -84,7 +84,9 @@ void setup_udp_tunnel_sock(struct net *net, struct socket *sock,
inet_sk(sock->sk)->mc_loop = 0;
encap_rcv = cfg->encap_rcv;
rcu_assign_sk_user_data(sock->sk, cfg->sk_user_data);
- sock->sk->sk_data_ready = our_sk_data_ready;
+ /* We force the cast in this awful way, due to various Android kernels
+ * backporting things stupidly. */
+ *(void **)&sock->sk->sk_data_ready = (void *)our_sk_data_ready;
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)