update nfs-kernel-server to 1.1.6
[openwrt/svn-archive/archive.git] / net / openswan / patches / 140-linux-2.6.31-compat.patch
1 Index: openswan-2.6.23/linux/net/ipsec/ipsec_xmit.c
2 ===================================================================
3 --- openswan-2.6.23.orig/linux/net/ipsec/ipsec_xmit.c 2009-09-09 02:42:54.000000000 +0200
4 +++ openswan-2.6.23/linux/net/ipsec/ipsec_xmit.c 2009-12-17 15:28:32.000000000 +0100
5 @@ -116,7 +116,7 @@
6 #endif
7
8 /* kernels > 2.4.2 */
9 -#if defined(IP_SELECT_IDENT) && defined(IP_SELECT_IDENT_NEW)
10 +#if defined(IP_SELECT_IDENT) && defined(IP_SELECT_IDENT_NEW) && LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 30)
11 #define KLIPS_IP_SELECT_IDENT(iph, skb) ip_select_ident(iph, skb->dst, NULL)
12 #endif
13
14 @@ -2037,8 +2037,14 @@
15 return IPSEC_XMIT_RECURSDETECT;
16 }
17
18 +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 30)
19 dst_release(ixs->skb->dst);
20 ixs->skb->dst = &ixs->route->u.dst;
21 +#else
22 + dst_release(skb_dst(ixs->skb));
23 + skb_dst_set(ixs->skb, &ixs->route->u.dst);
24 +#endif
25 +
26 if(ixs->stats) {
27 ixs->stats->tx_bytes += ixs->skb->len;
28 }
29 Index: openswan-2.6.23/linux/net/ipsec/ipsec_rcv.c
30 ===================================================================
31 --- openswan-2.6.23.orig/linux/net/ipsec/ipsec_rcv.c 2009-12-17 15:28:32.000000000 +0100
32 +++ openswan-2.6.23/linux/net/ipsec/ipsec_rcv.c 2009-12-17 15:28:32.000000000 +0100
33 @@ -1710,10 +1710,18 @@
34 /* release the dst that was attached, since we have likely
35 * changed the actual destination of the packet.
36 */
37 +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 30)
38 if(skb->dst) {
39 dst_release(skb->dst);
40 skb->dst = NULL;
41 }
42 +#else
43 + if(skb_dst(skb))
44 + {
45 + dst_release(skb_dst(skb));
46 + skb_dst_set(skb, NULL);
47 + }
48 +#endif
49 skb->pkt_type = PACKET_HOST;
50 if(irs->hard_header_len &&
51 (skb_mac_header(skb) != (skb_network_header(skb) - irs->hard_header_len)) &&
52 Index: openswan-2.6.23/linux/include/openswan/ipsec_param.h
53 ===================================================================
54 --- openswan-2.6.23.orig/linux/include/openswan/ipsec_param.h 2009-09-09 02:42:54.000000000 +0200
55 +++ openswan-2.6.23/linux/include/openswan/ipsec_param.h 2009-12-17 15:28:32.000000000 +0100
56 @@ -220,7 +220,12 @@
57
58 /* kernels > 2.4.2 */
59 #if defined(IP_SELECT_IDENT) && defined(IP_SELECT_IDENT_NEW)
60 +/* 2.6.31 changed skb_buff */
61 +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 30)
62 #define KLIPS_IP_SELECT_IDENT(iph, skb) ip_select_ident(iph, skb->dst, NULL)
63 +#else
64 +#define KLIPS_IP_SELECT_IDENT(iph, skb) ip_select_ident(iph, skb_dst(skb), NULL)
65 +#endif
66 #endif
67
68 #endif /* SUSE_LINUX_2_4_19_IS_STUPID */
69 Index: openswan-2.6.23/linux/net/ipsec/pfkey_v2.c
70 ===================================================================
71 --- openswan-2.6.23.orig/linux/net/ipsec/pfkey_v2.c 2009-09-09 02:42:54.000000000 +0200
72 +++ openswan-2.6.23/linux/net/ipsec/pfkey_v2.c 2009-12-17 15:28:32.000000000 +0100
73 @@ -492,7 +492,11 @@
74 printk(" h:0p%p", skb_transport_header(skb));
75 printk(" nh:0p%p", skb_network_header(skb));
76 printk(" mac:0p%p", skb_mac_header(skb));
77 +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 30)
78 printk(" dst:0p%p", skb->dst);
79 +#else
80 + printk(" dst:0p%p", skb_dst(skb));
81 +#endif
82 if(sysctl_ipsec_debug_verbose) {
83 int i;
84
85 Index: openswan-2.6.23/linux/net/ipsec/ipsec_mast.c
86 ===================================================================
87 --- openswan-2.6.23.orig/linux/net/ipsec/ipsec_mast.c 2009-12-17 15:28:57.000000000 +0100
88 +++ openswan-2.6.23/linux/net/ipsec/ipsec_mast.c 2009-12-17 15:29:58.000000000 +0100
89 @@ -178,8 +178,13 @@
90 ixs->dev->name);
91 return IPSEC_XMIT_RECURSDETECT;
92 }
93 +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 30)
94 dst_release(ixs->skb->dst);
95 ixs->skb->dst = &ixs->route->u.dst;
96 +#else
97 + dst_release(skb_dst(ixs->skb));
98 + skb_dst_set(ixs->skb, &ixs->route->u.dst);
99 +#endif
100 ixs->stats->tx_bytes += ixs->skb->len;
101 if(ixs->skb->len < ixs->skb->nh.raw - ixs->skb->data) {
102 ixs->stats->tx_errors++;