summaryrefslogtreecommitdiff
blob: 4e2d0a237f493c4e7ee2b5a7bfc812b7666b67d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
X-Git-Url: http://accel-pptp.git.sourceforge.net/git/gitweb.cgi?p=accel-pptp%2Faccel-pptp;a=blobdiff_plain;f=kernel%2Fdriver%2Fpptp.c;h=78853fcb6908530fdecd50ed99ca67832d249a3c;hp=58eb307619392b908a515c68146e4bd8afc93fed;hb=5c6388a163646f5fe0726ee0ffbca281196b25a8;hpb=fc096cb1079a8ba334fdfd555bf56c8bb6f944bf

diff --git a/kernel/driver/pptp.c b/kernel/driver/pptp.c
index 58eb307..78853fc 100644
--- a/kernel/driver/pptp.c
+++ b/kernel/driver/pptp.c
@@ -400,7 +400,11 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
 		}
 	}
 #endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
 	tdev = rt->u.dst.dev;
+#else
+	tdev = rt->dst.dev;
+#endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
 	max_headroom = ((tdev->hard_header_len+15)&~15) + sizeof(*iph)+sizeof(*hdr)+2;
@@ -507,7 +511,11 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
 #endif
 	iph->version		=	4;
 	iph->ihl		=	sizeof(struct iphdr) >> 2;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
 	if (ip_dont_fragment(sk, &rt->u.dst))
+#else
+	if (ip_dont_fragment(sk, &rt->dst))
+#endif
 		iph->frag_off	=	htons(IP_DF);
 	else
 		iph->frag_off	=	0;
@@ -518,14 +526,22 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
 	iph->ttl = sk->protinfo.af_inet.ttl;
 #else
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
 	iph->ttl = dst_metric(&rt->u.dst, RTAX_HOPLIMIT);
+#else
+	iph->ttl = dst_metric(&rt->dst, RTAX_HOPLIMIT);
+#endif
 #endif
 	iph->tot_len = htons(skb->len);
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
 	skb_dst_drop(skb);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
 	skb_dst_set(skb,&rt->u.dst);
 #else
+	skb_dst_set(skb,&rt->dst);
+#endif
+#else
 	dst_release(skb->dst);
 	skb->dst = &rt->u.dst;
 #endif
@@ -533,7 +549,11 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
 	nf_reset(skb);
 
 	skb->ip_summed = CHECKSUM_NONE;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
 	ip_select_ident(iph, &rt->u.dst, NULL);
+#else
+	ip_select_ident(iph, &rt->dst, NULL);
+#endif
 	ip_send_check(iph);
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
@@ -855,13 +875,21 @@ static int pptp_connect(struct socket *sock, struct sockaddr *uservaddr,
 			error = -EHOSTUNREACH;
 			goto end;
 		}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
 		sk_setup_caps(sk, &rt->u.dst);
+#else
+		sk_setup_caps(sk, &rt->dst);
+#endif
 	}
 #endif
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
 	po->chan.mtu=PPP_MTU;
 #else
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
 	po->chan.mtu=dst_mtu(&rt->u.dst);
+#else
+	po->chan.mtu=dst_mtu(&rt->dst);
+#endif
 	if (!po->chan.mtu) po->chan.mtu=PPP_MTU;
 #endif
 	ip_rt_put(rt);