From: Adrian Bondrescu Date: Sun, 5 Jun 2011 13:00:39 +0000 (+0300) Subject: Fix compilation for kernel versions older than 2.6.36 X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=22efaec1b5870682823de23a7a7a77bb738f0d1e;hp=c3020b98a62024b7e9d74f23c041358e0f1a5c0b;p=swifty.git Fix compilation for kernel versions older than 2.6.36 --- diff --git a/src/kernel/swift.c b/src/kernel/swift.c index 1a7e164..b3aa899 100644 --- a/src/kernel/swift.c +++ b/src/kernel/swift.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -310,7 +311,11 @@ static int swift_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr log_error("Route lookup failed\n"); goto out_free; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) + sk_dst_set(sk, dst_clone(&rt->u.dst)); +#else sk_dst_set(sk, dst_clone(&rt->dst)); +#endif } err = ip_queue_xmit(skb);