summaryrefslogtreecommitdiff
path: root/target/linux/generic-2.6/patches/120-openswan-2.4.0.kernel-2.6-natt.patch
diff options
context:
space:
mode:
authorImre Kaloz <kaloz@openwrt.org>2007-05-23 19:48:34 +0000
committerImre Kaloz <kaloz@openwrt.org>2007-05-23 19:48:34 +0000
commit615e8af8411e64db4db57d453af00ea9a7ca1fa2 (patch)
treeb4fa16ada763cf659876a3ef907e0e49e4cb73f1 /target/linux/generic-2.6/patches/120-openswan-2.4.0.kernel-2.6-natt.patch
parente1bb43f263ea0a0c72bac8750fb420697ca7866f (diff)
downloadmtk-20170518-615e8af8411e64db4db57d453af00ea9a7ca1fa2.zip
mtk-20170518-615e8af8411e64db4db57d453af00ea9a7ca1fa2.tar.gz
mtk-20170518-615e8af8411e64db4db57d453af00ea9a7ca1fa2.tar.bz2
break trunk temporary - upgrade to 2.6.21.1 and iptables 1.3.7
SVN-Revision: 7315
Diffstat (limited to 'target/linux/generic-2.6/patches/120-openswan-2.4.0.kernel-2.6-natt.patch')
-rw-r--r--target/linux/generic-2.6/patches/120-openswan-2.4.0.kernel-2.6-natt.patch56
1 files changed, 27 insertions, 29 deletions
diff --git a/target/linux/generic-2.6/patches/120-openswan-2.4.0.kernel-2.6-natt.patch b/target/linux/generic-2.6/patches/120-openswan-2.4.0.kernel-2.6-natt.patch
index 2b4238c..b11ed53 100644
--- a/target/linux/generic-2.6/patches/120-openswan-2.4.0.kernel-2.6-natt.patch
+++ b/target/linux/generic-2.6/patches/120-openswan-2.4.0.kernel-2.6-natt.patch
@@ -1,6 +1,6 @@
-diff -urN linux-2.6.19.old/include/net/xfrmudp.h linux-2.6.19.dev/include/net/xfrmudp.h
---- linux-2.6.19.old/include/net/xfrmudp.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/net/xfrmudp.h 2006-12-14 03:13:41.000000000 +0100
+diff -Nur linux-2.6.21.1/include/net/xfrmudp.h linux-2.6.21.1-owrt/include/net/xfrmudp.h
+--- linux-2.6.21.1/include/net/xfrmudp.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/net/xfrmudp.h 2007-05-14 11:26:11.000000000 +0200
@@ -0,0 +1,10 @@
+/*
+ * pointer to function for type that xfrm4_input wants, to permit
@@ -12,10 +12,10 @@ diff -urN linux-2.6.19.old/include/net/xfrmudp.h linux-2.6.19.dev/include/net/xf
+extern int udp4_register_esp_rcvencap(xfrm4_rcv_encap_t func
+ , xfrm4_rcv_encap_t *oldfunc);
+extern int udp4_unregister_esp_rcvencap(xfrm4_rcv_encap_t func);
-diff -urN linux-2.6.19.old/net/ipv4/Kconfig linux-2.6.19.dev/net/ipv4/Kconfig
---- linux-2.6.19.old/net/ipv4/Kconfig 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/Kconfig 2006-12-14 03:13:41.000000000 +0100
-@@ -273,6 +273,12 @@
+diff -Nur linux-2.6.21.1/net/ipv4/Kconfig linux-2.6.21.1-owrt/net/ipv4/Kconfig
+--- linux-2.6.21.1/net/ipv4/Kconfig 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1-owrt/net/ipv4/Kconfig 2007-05-14 11:26:11.000000000 +0200
+@@ -266,6 +266,12 @@
Network), but can be distributed all over the Internet. If you want
to do that, say Y here and to "IP multicast routing" below.
@@ -28,14 +28,15 @@ diff -urN linux-2.6.19.old/net/ipv4/Kconfig linux-2.6.19.dev/net/ipv4/Kconfig
config IP_MROUTE
bool "IP: multicast routing"
depends on IP_MULTICAST
-diff -urN linux-2.6.19.old/net/ipv4/udp.c linux-2.6.19.dev/net/ipv4/udp.c
---- linux-2.6.19.old/net/ipv4/udp.c 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/udp.c 2006-12-14 03:13:41.000000000 +0100
-@@ -108,11 +108,14 @@
- #include <net/inet_common.h>
+diff -Nur linux-2.6.21.1/net/ipv4/udp.c linux-2.6.21.1-owrt/net/ipv4/udp.c
+--- linux-2.6.21.1/net/ipv4/udp.c 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1-owrt/net/ipv4/udp.c 2007-05-14 11:42:44.000000000 +0200
+@@ -101,12 +101,15 @@
+ #include <net/route.h>
#include <net/checksum.h>
#include <net/xfrm.h>
+#include <net/xfrmudp.h>
+ #include "udp_impl.h"
/*
* Snmp MIB for the UDP layer
@@ -46,8 +47,8 @@ diff -urN linux-2.6.19.old/net/ipv4/udp.c linux-2.6.19.dev/net/ipv4/udp.c
DEFINE_SNMP_STAT(struct udp_mib, udp_statistics) __read_mostly;
struct hlist_head udp_hash[UDP_HTABLE_SIZE];
-@@ -917,6 +920,42 @@
- sk_common_release(sk);
+@@ -915,6 +918,42 @@
+ return 0;
}
+#if defined(CONFIG_XFRM) || defined(CONFIG_IPSEC_NAT_TRAVERSAL)
@@ -89,19 +90,16 @@ diff -urN linux-2.6.19.old/net/ipv4/udp.c linux-2.6.19.dev/net/ipv4/udp.c
/* return:
* 1 if the the UDP system should process it
* 0 if we should drop this packet
-@@ -924,9 +963,9 @@
+@@ -922,7 +961,7 @@
*/
static int udp_encap_rcv(struct sock * sk, struct sk_buff *skb)
{
-#ifndef CONFIG_XFRM
+#if !defined(CONFIG_XFRM) && !defined(CONFIG_IPSEC_NAT_TRAVERSAL)
- return 1;
--#else
-+#else /* either CONFIG_XFRM or CONFIG_IPSEC_NAT_TRAVERSAL */
+ return 1;
+ #else
struct udp_sock *up = udp_sk(sk);
- struct udphdr *uh;
- struct iphdr *iph;
-@@ -939,11 +978,11 @@
+@@ -937,11 +976,11 @@
/* if we're overly short, let UDP handle it */
len = skb->len - sizeof(struct udphdr);
if (len <= 0)
@@ -115,7 +113,7 @@ diff -urN linux-2.6.19.old/net/ipv4/udp.c linux-2.6.19.dev/net/ipv4/udp.c
/* If this is a paged skb, make sure we pull up
* whatever data we need to look at. */
-@@ -966,7 +1005,7 @@
+@@ -964,7 +1003,7 @@
len = sizeof(struct udphdr);
} else
/* Must be an IKE packet.. pass it through */
@@ -124,7 +122,7 @@ diff -urN linux-2.6.19.old/net/ipv4/udp.c linux-2.6.19.dev/net/ipv4/udp.c
break;
case UDP_ENCAP_ESPINUDP_NON_IKE:
/* Check if this is a keepalive packet. If so, eat it. */
-@@ -979,7 +1018,7 @@
+@@ -977,7 +1016,7 @@
len = sizeof(struct udphdr) + 2 * sizeof(u32);
} else
/* Must be an IKE packet.. pass it through */
@@ -133,7 +131,7 @@ diff -urN linux-2.6.19.old/net/ipv4/udp.c linux-2.6.19.dev/net/ipv4/udp.c
break;
}
-@@ -990,6 +1029,8 @@
+@@ -988,6 +1027,8 @@
*/
if (skb_cloned(skb) && pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
return 0;
@@ -142,24 +140,24 @@ diff -urN linux-2.6.19.old/net/ipv4/udp.c linux-2.6.19.dev/net/ipv4/udp.c
/* Now we can update and verify the packet length... */
iph = skb->nh.iph;
-@@ -1055,9 +1096,13 @@
+@@ -1051,9 +1092,13 @@
return 0;
}
if (ret < 0) {
- /* process the ESP packet */
- ret = xfrm4_rcv_encap(skb, up->encap_type);
-- UDP_INC_STATS_BH(UDP_MIB_INDATAGRAMS);
+- UDP_INC_STATS_BH(UDP_MIB_INDATAGRAMS, up->pcflag);
+ if(xfrm4_rcv_encap_func != NULL) {
+ ret = (*xfrm4_rcv_encap_func)(skb, up->encap_type);
-+ UDP_INC_STATS_BH(UDP_MIB_INDATAGRAMS);
++ UDP_INC_STATS_BH(UDP_MIB_INDATAGRAMS, up->pcflag);
+ } else {
-+ UDP_INC_STATS_BH(UDP_MIB_INERRORS);
++ UDP_INC_STATS_BH(UDP_MIB_INERRORS, up->pcflag);
+ ret = 1;
+ }
return -ret;
}
/* FALLTHROUGH -- it's a UDP Packet */
-@@ -1639,3 +1684,9 @@
+@@ -1733,3 +1778,9 @@
EXPORT_SYMBOL(udp_proc_register);
EXPORT_SYMBOL(udp_proc_unregister);
#endif