summaryrefslogtreecommitdiffhomepage
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
commit0e63eafa2daf57bee7808ffae27720347d9d0652 (patch)
treedc17aac4297345c03ddc716e143fa826194b4ae3
parent3a0408d483f08c3a93da2875c2d0403392d4be49 (diff)
compat: udp_tunnel: force cast sk_data_ready
Reference: https://lists.zx2c4.com/pipermail/wireguard/2019-April/004081.html Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-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 6afb11d..dc47d61 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)