fix x86-2.6 build
[openwrt.git] / target / linux / package / openswan / patches / fix-compile-2.4.14-changes.patch
1 diff -Nur openswan-2.4.4/linux/include/openswan.h openswan-2.4.4.patched/linux/include/openswan.h
2 --- openswan-2.4.4/linux/include/openswan.h 2005-04-14 22:21:51.000000000 +0200
3 +++ openswan-2.4.4.patched/linux/include/openswan.h 2005-12-23 20:31:58.248159750 +0100
4 @@ -78,6 +78,10 @@
5 #define NET_21
6 #endif
7
8 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
9 +#define KERNEL_2615
10 +#endif
11 +
12 #ifndef IPPROTO_COMP
13 # define IPPROTO_COMP 108
14 #endif /* !IPPROTO_COMP */
15 diff -Nur openswan-2.4.4/linux/net/ipsec/ipcomp.c openswan-2.4.4.patched/linux/net/ipsec/ipcomp.c
16 --- openswan-2.4.4/linux/net/ipsec/ipcomp.c 2005-08-28 01:40:00.000000000 +0200
17 +++ openswan-2.4.4.patched/linux/net/ipsec/ipcomp.c 2005-12-23 20:35:02.482256250 +0100
18 @@ -600,7 +600,9 @@
19 memcpy(n->head,
20 skb->head,
21 ((char *)iph - (char *)skb->head) + iphlen);
22 - n->list=NULL;
23 +#ifndef KERNEL_2615
24 + n->list=NULL;
25 +#endif
26 n->next=NULL;
27 n->prev=NULL;
28 n->sk=NULL;
29 @@ -657,7 +659,11 @@
30 n->pkt_bridged=skb->pkt_bridged;
31 #endif /* NETDEV_23 */
32 n->ip_summed=0;
33 - n->stamp=skb->stamp;
34 +#ifdef KERNEL_2615
35 + n->tstamp=skb->tstamp;
36 +#else
37 + n->stamp=skb->stamp;
38 +#endif
39 #ifndef NETDEV_23 /* this seems to have been removed in 2.4 */
40 #if defined(CONFIG_SHAPER) || defined(CONFIG_SHAPER_MODULE)
41 n->shapelatency=skb->shapelatency; /* Latency on frame */
42 diff -Nur openswan-2.4.4/linux/net/ipsec/ipsec_tunnel.c openswan-2.4.4.patched/linux/net/ipsec/ipsec_tunnel.c
43 --- openswan-2.4.4/linux/net/ipsec/ipsec_tunnel.c 2005-09-22 00:57:43.000000000 +0200
44 +++ openswan-2.4.4.patched/linux/net/ipsec/ipsec_tunnel.c 2005-12-23 20:38:17.666454500 +0100
45 @@ -34,6 +34,9 @@
46 #include <linux/interrupt.h> /* mark_bh */
47
48 #include <net/tcp.h>
49 +#ifdef KERNEL_2615
50 +#include <net/inet_timewait_sock.h>
51 +#endif
52 #include <net/udp.h>
53 #include <linux/skbuff.h>
54
55 @@ -272,9 +275,13 @@
56
57 if(ixs->skb->sk) {
58 #ifdef NET_26
59 +#ifdef KERNEL_2615
60 + struct inet_timewait_sock *tw;
61 + tw = (struct inet_timewait_sock *)ixs->skb->sk;
62 +#else
63 struct tcp_tw_bucket *tw;
64 -
65 tw = (struct tcp_tw_bucket *)ixs->skb->sk;
66 +#endif
67
68 ixs->sport = ntohs(tw->tw_sport);
69 ixs->dport = ntohs(tw->tw_dport);
70 diff -Nur openswan-2.4.4/linux/net/ipsec/pfkey_v2.c openswan-2.4.4.patched/linux/net/ipsec/pfkey_v2.c
71 --- openswan-2.4.4/linux/net/ipsec/pfkey_v2.c 2005-09-14 18:40:45.000000000 +0200
72 +++ openswan-2.4.4.patched/linux/net/ipsec/pfkey_v2.c 2005-12-23 20:43:21.481441750 +0100
73 @@ -459,11 +459,17 @@
74 "skb=0p%p dequeued.\n", skb);
75 printk(KERN_INFO "klips_debug:pfkey_destroy_socket: "
76 "pfkey_skb contents:");
77 +#ifndef KERNEL_2615
78 + printk(" list:0p%p", skb->list);
79 +#endif
80 printk(" next:0p%p", skb->next);
81 printk(" prev:0p%p", skb->prev);
82 - printk(" list:0p%p", skb->list);
83 printk(" sk:0p%p", skb->sk);
84 +#ifdef KERNEL_2615
85 + printk(" tstamp:%d.%d", skb->tstamp.off_sec, skb->tstamp.off_usec);
86 +#else
87 printk(" stamp:%ld.%ld", skb->stamp.tv_sec, skb->stamp.tv_usec);
88 +#endif
89 printk(" dev:0p%p", skb->dev);
90 if(skb->dev) {
91 if(skb->dev->name) {
92 @@ -1376,7 +1382,12 @@
93 #endif /* NET_21 */
94
95 skb_copy_datagram_iovec(skb, 0, msg->msg_iov, size);
96 - sk->sk_stamp=skb->stamp;
97 +#ifdef KERNEL_2615
98 + sk->sk_stamp.tv_sec=skb->tstamp.off_sec;
99 + sk->sk_stamp.tv_usec=skb->tstamp.off_usec;
100 +#else
101 + sk->sk_stamp=skb->stamp;
102 +#endif
103
104 skb_free_datagram(sk, skb);
105 return size;
106 @@ -1495,8 +1506,13 @@
107 #endif
108 sk->sk_protocol,
109 sk->sk_sndbuf,
110 +#ifdef KERNEL_2615
111 + sk->sk_stamp.tv_sec,
112 + sk->sk_stamp.tv_usec,
113 +#else
114 (unsigned int)sk->sk_stamp.tv_sec,
115 (unsigned int)sk->sk_stamp.tv_usec,
116 +#endif
117 sk->sk_socket->flags,
118 sk->sk_socket->type,
119 sk->sk_socket->state);
This page took 0.045446 seconds and 5 git commands to generate.