openswan: Fix compile on linux-2.6.36
git-svn-id: svn://svn.openwrt.org/openwrt/packages@23353 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
58
net/openswan/patches/200-linux-2.6.36.patch
Normal file
58
net/openswan/patches/200-linux-2.6.36.patch
Normal file
@ -0,0 +1,58 @@
|
||||
---
|
||||
linux/net/ipsec/ipsec_xmit.c | 21 +++++++++++++++++++++
|
||||
1 file changed, 21 insertions(+)
|
||||
|
||||
--- openswan-2.6.29.orig/linux/net/ipsec/ipsec_xmit.c
|
||||
+++ openswan-2.6.29/linux/net/ipsec/ipsec_xmit.c
|
||||
@@ -105,6 +105,15 @@ static __u32 zeroes[64];
|
||||
int ipsec_xmit_trap_count = 0;
|
||||
int ipsec_xmit_trap_sendcount = 0;
|
||||
|
||||
+#ifndef NIPQUAD
|
||||
+#define NIPQUAD(addr) \
|
||||
+ ((unsigned char *)&addr)[0], \
|
||||
+ ((unsigned char *)&addr)[1], \
|
||||
+ ((unsigned char *)&addr)[2], \
|
||||
+ ((unsigned char *)&addr)[3]
|
||||
+#define NIPQUAD_FMT "%u.%u.%u.%u"
|
||||
+#endif
|
||||
+
|
||||
#define dmp(_x,_y,_z) if(debug_xmit && sysctl_ipsec_debug_verbose) ipsec_dmp_block(_x,_y,_z)
|
||||
|
||||
#if !defined(SKB_COPY_EXPAND) || defined(KLIPS_UNIT_TESTS)
|
||||
@@ -2085,7 +2094,11 @@ ipsec_xmit_send(struct ipsec_xmit_state*
|
||||
return IPSEC_XMIT_ROUTEERR;
|
||||
}
|
||||
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
|
||||
+ if(ixs->dev == ixs->route->dst.dev) {
|
||||
+#else
|
||||
if(ixs->dev == ixs->route->u.dst.dev) {
|
||||
+#endif
|
||||
ip_rt_put(ixs->route);
|
||||
/* This is recursion, drop it. */
|
||||
if (ixs->stats)
|
||||
@@ -2098,7 +2111,11 @@ ipsec_xmit_send(struct ipsec_xmit_state*
|
||||
}
|
||||
|
||||
skb_dst_drop(ixs->skb);
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
|
||||
+ skb_dst_set(ixs->skb, &ixs->route->dst);
|
||||
+#else
|
||||
skb_dst_set(ixs->skb, &ixs->route->u.dst);
|
||||
+#endif
|
||||
if(ixs->stats) {
|
||||
ixs->stats->tx_bytes += ixs->skb->len;
|
||||
}
|
||||
@@ -2139,7 +2156,11 @@ ipsec_xmit_send(struct ipsec_xmit_state*
|
||||
|
||||
else
|
||||
err = NF_HOOK(PF_INET, OSW_NF_INET_LOCAL_OUT, ixs->skb, NULL,
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
|
||||
+ ixs->route->dst.dev,
|
||||
+#else
|
||||
ixs->route->u.dst.dev,
|
||||
+#endif
|
||||
ipsec_xmit_send2);
|
||||
|
||||
if(err != NET_XMIT_SUCCESS && err != NET_XMIT_CN) {
|
Reference in New Issue
Block a user