aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic-2.6/patches
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/generic-2.6/patches')
-rw-r--r--target/linux/generic-2.6/patches/001-squashfs.patch70
-rw-r--r--target/linux/generic-2.6/patches/002-lzma_decompress.patch241
-rw-r--r--target/linux/generic-2.6/patches/013-mips_generic_gpio_support.patch50
-rw-r--r--target/linux/generic-2.6/patches/050-mtdpart_redboot_partition_truncate.patch61
-rw-r--r--target/linux/generic-2.6/patches/060-rootfs_split.patch30
-rw-r--r--target/linux/generic-2.6/patches/110-ipp2p_0.8.1rc1.patch4
-rw-r--r--target/linux/generic-2.6/patches/120-openswan-2.4.0.kernel-2.6-natt.patch56
-rw-r--r--target/linux/generic-2.6/patches/130-netfilter-ipset.patch157
-rw-r--r--target/linux/generic-2.6/patches/150-netfilter_imq.patch98
-rw-r--r--target/linux/generic-2.6/patches/160-netfilter_route.patch1284
-rw-r--r--target/linux/generic-2.6/patches/170-netfilter_chaostables.patch326
-rw-r--r--target/linux/generic-2.6/patches/200-sched_esfq.patch215
-rw-r--r--target/linux/generic-2.6/patches/201-multiple_default_gateways.patch1025
-rw-r--r--target/linux/generic-2.6/patches/510-Yaffs.patch202
-rw-r--r--target/linux/generic-2.6/patches/600-x86_lzma.patch108
-rw-r--r--target/linux/generic-2.6/patches/700-airprime.patch12
-rw-r--r--target/linux/generic-2.6/patches/901-asm_bitops_include.patch11
-rw-r--r--target/linux/generic-2.6/patches/904-ls_time_locale.patch33
18 files changed, 1565 insertions, 2418 deletions
diff --git a/target/linux/generic-2.6/patches/001-squashfs.patch b/target/linux/generic-2.6/patches/001-squashfs.patch
index 6881cd0bb1..8722c99592 100644
--- a/target/linux/generic-2.6/patches/001-squashfs.patch
+++ b/target/linux/generic-2.6/patches/001-squashfs.patch
@@ -1,7 +1,7 @@
-diff -urN linux-2.6.19.old/fs/Kconfig linux-2.6.19.dev/fs/Kconfig
---- linux-2.6.19.old/fs/Kconfig 2006-12-14 03:13:16.000000000 +0100
-+++ linux-2.6.19.dev/fs/Kconfig 2006-12-14 03:13:16.000000000 +0100
-@@ -1457,6 +1457,71 @@
+diff -Nur linux-2.6.21.1/fs/Kconfig linux-2.6.21.1-owrt/fs/Kconfig
+--- linux-2.6.21.1/fs/Kconfig 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1-owrt/fs/Kconfig 2007-05-23 19:09:55.000000000 +0200
+@@ -1371,6 +1371,71 @@
If unsure, say N.
@@ -73,10 +73,10 @@ diff -urN linux-2.6.19.old/fs/Kconfig linux-2.6.19.dev/fs/Kconfig
config VXFS_FS
tristate "FreeVxFS file system support (VERITAS VxFS(TM) compatible)"
depends on BLOCK
-diff -urN linux-2.6.19.old/fs/Makefile linux-2.6.19.dev/fs/Makefile
---- linux-2.6.19.old/fs/Makefile 2006-12-14 03:13:16.000000000 +0100
-+++ linux-2.6.19.dev/fs/Makefile 2006-12-14 03:13:16.000000000 +0100
-@@ -67,6 +67,7 @@
+diff -Nur linux-2.6.21.1/fs/Makefile linux-2.6.21.1-owrt/fs/Makefile
+--- linux-2.6.21.1/fs/Makefile 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1-owrt/fs/Makefile 2007-05-23 19:09:55.000000000 +0200
+@@ -68,6 +68,7 @@
obj-$(CONFIG_JBD2) += jbd2/
obj-$(CONFIG_EXT2_FS) += ext2/
obj-$(CONFIG_CRAMFS) += cramfs/
@@ -84,9 +84,9 @@ diff -urN linux-2.6.19.old/fs/Makefile linux-2.6.19.dev/fs/Makefile
obj-$(CONFIG_RAMFS) += ramfs/
obj-$(CONFIG_HUGETLBFS) += hugetlbfs/
obj-$(CONFIG_CODA_FS) += coda/
-diff -urN linux-2.6.19.old/fs/squashfs/inode.c linux-2.6.19.dev/fs/squashfs/inode.c
---- linux-2.6.19.old/fs/squashfs/inode.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/fs/squashfs/inode.c 2006-12-14 03:13:16.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/squashfs/inode.c linux-2.6.21.1-owrt/fs/squashfs/inode.c
+--- linux-2.6.21.1/fs/squashfs/inode.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/squashfs/inode.c 2007-05-23 19:52:20.000000000 +0200
@@ -0,0 +1,2124 @@
+/*
+ * Squashfs - a compressed read only filesystem for Linux
@@ -2160,13 +2160,13 @@ diff -urN linux-2.6.19.old/fs/squashfs/inode.c linux-2.6.19.dev/fs/squashfs/inod
+}
+
+
-+static kmem_cache_t * squashfs_inode_cachep;
++static struct kmem_cache * squashfs_inode_cachep;
+
+
+static struct inode *squashfs_alloc_inode(struct super_block *sb)
+{
+ struct squashfs_inode_info *ei;
-+ ei = kmem_cache_alloc(squashfs_inode_cachep, SLAB_KERNEL);
++ ei = kmem_cache_alloc(squashfs_inode_cachep, GFP_KERNEL);
+ if (!ei)
+ return NULL;
+ return &ei->vfs_inode;
@@ -2179,7 +2179,7 @@ diff -urN linux-2.6.19.old/fs/squashfs/inode.c linux-2.6.19.dev/fs/squashfs/inod
+}
+
+
-+static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
++static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
+{
+ struct squashfs_inode_info *ei = foo;
+
@@ -2212,9 +2212,9 @@ diff -urN linux-2.6.19.old/fs/squashfs/inode.c linux-2.6.19.dev/fs/squashfs/inod
+MODULE_DESCRIPTION("squashfs, a compressed read-only filesystem");
+MODULE_AUTHOR("Phillip Lougher <phillip@lougher.org.uk>");
+MODULE_LICENSE("GPL");
-diff -urN linux-2.6.19.old/fs/squashfs/Makefile linux-2.6.19.dev/fs/squashfs/Makefile
---- linux-2.6.19.old/fs/squashfs/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/fs/squashfs/Makefile 2006-12-14 03:13:16.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/squashfs/Makefile linux-2.6.21.1-owrt/fs/squashfs/Makefile
+--- linux-2.6.21.1/fs/squashfs/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/squashfs/Makefile 2007-05-23 19:09:55.000000000 +0200
@@ -0,0 +1,7 @@
+#
+# Makefile for the linux squashfs routines.
@@ -2223,9 +2223,9 @@ diff -urN linux-2.6.19.old/fs/squashfs/Makefile linux-2.6.19.dev/fs/squashfs/Mak
+obj-$(CONFIG_SQUASHFS) += squashfs.o
+squashfs-y += inode.o
+squashfs-y += squashfs2_0.o
-diff -urN linux-2.6.19.old/fs/squashfs/squashfs2_0.c linux-2.6.19.dev/fs/squashfs/squashfs2_0.c
---- linux-2.6.19.old/fs/squashfs/squashfs2_0.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/fs/squashfs/squashfs2_0.c 2006-12-14 03:13:16.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/squashfs/squashfs2_0.c linux-2.6.21.1-owrt/fs/squashfs/squashfs2_0.c
+--- linux-2.6.21.1/fs/squashfs/squashfs2_0.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/squashfs/squashfs2_0.c 2007-05-23 19:09:55.000000000 +0200
@@ -0,0 +1,758 @@
+/*
+ * Squashfs - a compressed read only filesystem for Linux
@@ -2985,9 +2985,9 @@ diff -urN linux-2.6.19.old/fs/squashfs/squashfs2_0.c linux-2.6.19.dev/fs/squashf
+
+ return 1;
+}
-diff -urN linux-2.6.19.old/fs/squashfs/squashfs.h linux-2.6.19.dev/fs/squashfs/squashfs.h
---- linux-2.6.19.old/fs/squashfs/squashfs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/fs/squashfs/squashfs.h 2006-12-14 03:13:16.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/squashfs/squashfs.h linux-2.6.21.1-owrt/fs/squashfs/squashfs.h
+--- linux-2.6.21.1/fs/squashfs/squashfs.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/squashfs/squashfs.h 2007-05-23 19:09:56.000000000 +0200
@@ -0,0 +1,86 @@
+/*
+ * Squashfs - a compressed read only filesystem for Linux
@@ -3075,9 +3075,9 @@ diff -urN linux-2.6.19.old/fs/squashfs/squashfs.h linux-2.6.19.dev/fs/squashfs/s
+ return 0;
+}
+#endif
-diff -urN linux-2.6.19.old/include/linux/squashfs_fs.h linux-2.6.19.dev/include/linux/squashfs_fs.h
---- linux-2.6.19.old/include/linux/squashfs_fs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/squashfs_fs.h 2006-12-14 03:13:16.000000000 +0100
+diff -Nur linux-2.6.21.1/include/linux/squashfs_fs.h linux-2.6.21.1-owrt/include/linux/squashfs_fs.h
+--- linux-2.6.21.1/include/linux/squashfs_fs.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/squashfs_fs.h 2007-05-23 19:09:56.000000000 +0200
@@ -0,0 +1,911 @@
+#ifndef SQUASHFS_FS
+#define SQUASHFS_FS
@@ -3990,9 +3990,9 @@ diff -urN linux-2.6.19.old/include/linux/squashfs_fs.h linux-2.6.19.dev/include/
+
+#endif
+#endif
-diff -urN linux-2.6.19.old/include/linux/squashfs_fs_i.h linux-2.6.19.dev/include/linux/squashfs_fs_i.h
---- linux-2.6.19.old/include/linux/squashfs_fs_i.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/squashfs_fs_i.h 2006-12-14 03:13:16.000000000 +0100
+diff -Nur linux-2.6.21.1/include/linux/squashfs_fs_i.h linux-2.6.21.1-owrt/include/linux/squashfs_fs_i.h
+--- linux-2.6.21.1/include/linux/squashfs_fs_i.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/squashfs_fs_i.h 2007-05-23 19:09:56.000000000 +0200
@@ -0,0 +1,45 @@
+#ifndef SQUASHFS_FS_I
+#define SQUASHFS_FS_I
@@ -4039,9 +4039,9 @@ diff -urN linux-2.6.19.old/include/linux/squashfs_fs_i.h linux-2.6.19.dev/includ
+ struct inode vfs_inode;
+};
+#endif
-diff -urN linux-2.6.19.old/include/linux/squashfs_fs_sb.h linux-2.6.19.dev/include/linux/squashfs_fs_sb.h
---- linux-2.6.19.old/include/linux/squashfs_fs_sb.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/squashfs_fs_sb.h 2006-12-14 03:13:16.000000000 +0100
+diff -Nur linux-2.6.21.1/include/linux/squashfs_fs_sb.h linux-2.6.21.1-owrt/include/linux/squashfs_fs_sb.h
+--- linux-2.6.21.1/include/linux/squashfs_fs_sb.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/squashfs_fs_sb.h 2007-05-23 19:09:56.000000000 +0200
@@ -0,0 +1,74 @@
+#ifndef SQUASHFS_FS_SB
+#define SQUASHFS_FS_SB
@@ -4117,9 +4117,9 @@ diff -urN linux-2.6.19.old/include/linux/squashfs_fs_sb.h linux-2.6.19.dev/inclu
+ int (*read_fragment_index_table)(struct super_block *s);
+};
+#endif
-diff -urN linux-2.6.19.old/init/do_mounts_rd.c linux-2.6.19.dev/init/do_mounts_rd.c
---- linux-2.6.19.old/init/do_mounts_rd.c 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/init/do_mounts_rd.c 2006-12-14 03:13:16.000000000 +0100
+diff -Nur linux-2.6.21.1/init/do_mounts_rd.c linux-2.6.21.1-owrt/init/do_mounts_rd.c
+--- linux-2.6.21.1/init/do_mounts_rd.c 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1-owrt/init/do_mounts_rd.c 2007-05-23 19:09:56.000000000 +0200
@@ -5,6 +5,7 @@
#include <linux/ext2_fs.h>
#include <linux/romfs_fs.h>
diff --git a/target/linux/generic-2.6/patches/002-lzma_decompress.patch b/target/linux/generic-2.6/patches/002-lzma_decompress.patch
index ca9767729c..d39d3d6877 100644
--- a/target/linux/generic-2.6/patches/002-lzma_decompress.patch
+++ b/target/linux/generic-2.6/patches/002-lzma_decompress.patch
@@ -1,15 +1,110 @@
---- linux-2.6.19.old/lib/Makefile 2007-04-18 17:41:22.679403384 +0200
-+++ linux-2.6.19.dev/lib/Makefile 2007-04-18 17:41:43.303268080 +0200
-@@ -54,6 +54,7 @@
- obj-$(CONFIG_AUDIT_GENERIC) += audit.o
-
- obj-$(CONFIG_SWIOTLB) += swiotlb.o
-+obj-y += LzmaDecode.o
-
- hostprogs-y := gen_crc32table
- clean-files := crc32table.h
---- linux-2.6.19.old/lib/LzmaDecode.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/lib/LzmaDecode.c 2006-12-14 03:13:20.000000000 +0100
+diff -Nur linux-2.6.21.1/include/linux/LzmaDecode.h linux-2.6.21.1-owrt/include/linux/LzmaDecode.h
+--- linux-2.6.21.1/include/linux/LzmaDecode.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/LzmaDecode.h 2007-05-14 10:51:05.000000000 +0200
+@@ -0,0 +1,100 @@
++/*
++ LzmaDecode.h
++ LZMA Decoder interface
++
++ LZMA SDK 4.05 Copyright (c) 1999-2004 Igor Pavlov (2004-08-25)
++ http://www.7-zip.org/
++
++ LZMA SDK is licensed under two licenses:
++ 1) GNU Lesser General Public License (GNU LGPL)
++ 2) Common Public License (CPL)
++ It means that you can select one of these two licenses and
++ follow rules of that license.
++
++ SPECIAL EXCEPTION:
++ Igor Pavlov, as the author of this code, expressly permits you to
++ statically or dynamically link your code (or bind by name) to the
++ interfaces of this file without subjecting your linked code to the
++ terms of the CPL or GNU LGPL. Any modifications or additions
++ to this file, however, are subject to the LGPL or CPL terms.
++*/
++
++#ifndef __LZMADECODE_H
++#define __LZMADECODE_H
++
++/* #define _LZMA_IN_CB */
++/* Use callback for input data */
++
++/* #define _LZMA_OUT_READ */
++/* Use read function for output data */
++
++/* #define _LZMA_PROB32 */
++/* It can increase speed on some 32-bit CPUs,
++ but memory usage will be doubled in that case */
++
++/* #define _LZMA_LOC_OPT */
++/* Enable local speed optimizations inside code */
++
++#ifndef UInt32
++#ifdef _LZMA_UINT32_IS_ULONG
++#define UInt32 unsigned long
++#else
++#define UInt32 unsigned int
++#endif
++#endif
++
++#ifdef _LZMA_PROB32
++#define CProb UInt32
++#else
++#define CProb unsigned short
++#endif
++
++#define LZMA_RESULT_OK 0
++#define LZMA_RESULT_DATA_ERROR 1
++#define LZMA_RESULT_NOT_ENOUGH_MEM 2
++
++#ifdef _LZMA_IN_CB
++typedef struct _ILzmaInCallback
++{
++ int (*Read)(void *object, unsigned char **buffer, UInt32 *bufferSize);
++} ILzmaInCallback;
++#endif
++
++#define LZMA_BASE_SIZE 1846
++#define LZMA_LIT_SIZE 768
++
++/*
++bufferSize = (LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp)))* sizeof(CProb)
++bufferSize += 100 in case of _LZMA_OUT_READ
++by default CProb is unsigned short,
++but if specify _LZMA_PROB_32, CProb will be UInt32(unsigned int)
++*/
++
++#ifdef _LZMA_OUT_READ
++int LzmaDecoderInit(
++ unsigned char *buffer, UInt32 bufferSize,
++ int lc, int lp, int pb,
++ unsigned char *dictionary, UInt32 dictionarySize,
++ #ifdef _LZMA_IN_CB
++ ILzmaInCallback *inCallback
++ #else
++ unsigned char *inStream, UInt32 inSize
++ #endif
++);
++#endif
++
++int LzmaDecode(
++ unsigned char *buffer,
++ #ifndef _LZMA_OUT_READ
++ UInt32 bufferSize,
++ int lc, int lp, int pb,
++ #ifdef _LZMA_IN_CB
++ ILzmaInCallback *inCallback,
++ #else
++ unsigned char *inStream, UInt32 inSize,
++ #endif
++ #endif
++ unsigned char *outStream, UInt32 outSize,
++ UInt32 *outSizeProcessed);
++
++#endif
+diff -Nur linux-2.6.21.1/lib/LzmaDecode.c linux-2.6.21.1-owrt/lib/LzmaDecode.c
+--- linux-2.6.21.1/lib/LzmaDecode.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/lib/LzmaDecode.c 2007-05-14 10:51:05.000000000 +0200
@@ -0,0 +1,663 @@
+/*
+ LzmaDecode.c
@@ -674,107 +769,23 @@
+ *outSizeProcessed = nowPos;
+ return LZMA_RESULT_OK;
+}
---- linux-2.6.19.old/include/linux/LzmaDecode.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/LzmaDecode.h 2006-12-14 03:13:20.000000000 +0100
-@@ -0,0 +1,100 @@
-+/*
-+ LzmaDecode.h
-+ LZMA Decoder interface
-+
-+ LZMA SDK 4.05 Copyright (c) 1999-2004 Igor Pavlov (2004-08-25)
-+ http://www.7-zip.org/
-+
-+ LZMA SDK is licensed under two licenses:
-+ 1) GNU Lesser General Public License (GNU LGPL)
-+ 2) Common Public License (CPL)
-+ It means that you can select one of these two licenses and
-+ follow rules of that license.
-+
-+ SPECIAL EXCEPTION:
-+ Igor Pavlov, as the author of this code, expressly permits you to
-+ statically or dynamically link your code (or bind by name) to the
-+ interfaces of this file without subjecting your linked code to the
-+ terms of the CPL or GNU LGPL. Any modifications or additions
-+ to this file, however, are subject to the LGPL or CPL terms.
-+*/
-+
-+#ifndef __LZMADECODE_H
-+#define __LZMADECODE_H
-+
-+/* #define _LZMA_IN_CB */
-+/* Use callback for input data */
-+
-+/* #define _LZMA_OUT_READ */
-+/* Use read function for output data */
-+
-+/* #define _LZMA_PROB32 */
-+/* It can increase speed on some 32-bit CPUs,
-+ but memory usage will be doubled in that case */
-+
-+/* #define _LZMA_LOC_OPT */
-+/* Enable local speed optimizations inside code */
-+
-+#ifndef UInt32
-+#ifdef _LZMA_UINT32_IS_ULONG
-+#define UInt32 unsigned long
-+#else
-+#define UInt32 unsigned int
-+#endif
-+#endif
-+
-+#ifdef _LZMA_PROB32
-+#define CProb UInt32
-+#else
-+#define CProb unsigned short
-+#endif
-+
-+#define LZMA_RESULT_OK 0
-+#define LZMA_RESULT_DATA_ERROR 1
-+#define LZMA_RESULT_NOT_ENOUGH_MEM 2
-+
-+#ifdef _LZMA_IN_CB
-+typedef struct _ILzmaInCallback
-+{
-+ int (*Read)(void *object, unsigned char **buffer, UInt32 *bufferSize);
-+} ILzmaInCallback;
-+#endif
-+
-+#define LZMA_BASE_SIZE 1846
-+#define LZMA_LIT_SIZE 768
-+
-+/*
-+bufferSize = (LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp)))* sizeof(CProb)
-+bufferSize += 100 in case of _LZMA_OUT_READ
-+by default CProb is unsigned short,
-+but if specify _LZMA_PROB_32, CProb will be UInt32(unsigned int)
-+*/
-+
-+#ifdef _LZMA_OUT_READ
-+int LzmaDecoderInit(
-+ unsigned char *buffer, UInt32 bufferSize,
-+ int lc, int lp, int pb,
-+ unsigned char *dictionary, UInt32 dictionarySize,
-+ #ifdef _LZMA_IN_CB
-+ ILzmaInCallback *inCallback
-+ #else
-+ unsigned char *inStream, UInt32 inSize
-+ #endif
-+);
-+#endif
-+
-+int LzmaDecode(
-+ unsigned char *buffer,
-+ #ifndef _LZMA_OUT_READ
-+ UInt32 bufferSize,
-+ int lc, int lp, int pb,
-+ #ifdef _LZMA_IN_CB
-+ ILzmaInCallback *inCallback,
-+ #else
-+ unsigned char *inStream, UInt32 inSize,
-+ #endif
-+ #endif
-+ unsigned char *outStream, UInt32 outSize,
-+ UInt32 *outSizeProcessed);
+diff -Nur linux-2.6.21.1/lib/Makefile linux-2.6.21.1-owrt/lib/Makefile
+--- linux-2.6.21.1/lib/Makefile 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1-owrt/lib/Makefile 2007-05-14 10:52:43.000000000 +0200
+@@ -12,7 +12,7 @@
+
+ lib-y += kobject.o kref.o kobject_uevent.o klist.o
+
+-obj-y += sort.o parser.o halfmd4.o debug_locks.o random32.o bust_spinlocks.o
++obj-y += sort.o parser.o halfmd4.o debug_locks.o random32.o bust_spinlocks.o LzmaDecode.o
+
+ ifeq ($(CONFIG_DEBUG_KOBJECT),y)
+ CFLAGS_kobject.o += -DDEBUG
+@@ -56,6 +56,7 @@
+ obj-$(CONFIG_AUDIT_GENERIC) += audit.o
+
+ obj-$(CONFIG_SWIOTLB) += swiotlb.o
+
-+#endif
-
+ obj-$(CONFIG_FAULT_INJECTION) += fault-inject.o
+
+ lib-$(CONFIG_GENERIC_BUG) += bug.o
diff --git a/target/linux/generic-2.6/patches/013-mips_generic_gpio_support.patch b/target/linux/generic-2.6/patches/013-mips_generic_gpio_support.patch
deleted file mode 100644
index 6f779b9849..0000000000
--- a/target/linux/generic-2.6/patches/013-mips_generic_gpio_support.patch
+++ /dev/null
@@ -1,50 +0,0 @@
---- linux-2.6.19.2.orig/arch/mips/Kconfig 2007-05-11 22:08:15.000000000 +0200
-+++ linux-2.6.19.2/arch/mips/Kconfig 2007-05-12 18:51:13.000000000 +0200
-@@ -818,6 +818,10 @@
- bool
- default y
-
-+config GENERIC_GPIO
-+ bool
-+ default n
-+
- config SCHED_NO_NO_OMIT_FRAME_POINTER
- bool
- default y
---- linux-2.6.19.2.orig/include/asm-generic/gpio.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.2/include/asm-generic/gpio.h 2007-03-18 17:17:10.000000000 +0100
-@@ -0,0 +1,25 @@
-+#ifndef _ASM_GENERIC_GPIO_H
-+#define _ASM_GENERIC_GPIO_H
-+
-+/* platforms that don't directly support access to GPIOs through I2C, SPI,
-+ * or other blocking infrastructure can use these wrappers.
-+ */
-+
-+static inline int gpio_cansleep(unsigned gpio)
-+{
-+ return 0;
-+}
-+
-+static inline int gpio_get_value_cansleep(unsigned gpio)
-+{
-+ might_sleep();
-+ return gpio_get_value(gpio);
-+}
-+
-+static inline void gpio_set_value_cansleep(unsigned gpio, int value)
-+{
-+ might_sleep();
-+ gpio_set_value(gpio, value);
-+}
-+
-+#endif /* _ASM_GENERIC_GPIO_H */
---- linux-2.6.19.2.orig/include/asm-mips/gpio.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.2/include/asm-mips/gpio.h 2007-03-18 17:17:10.000000000 +0100
-@@ -0,0 +1,6 @@
-+#ifndef _ASM_MIPS_GPIO_H
-+#define _ASM_MIPS_GPIO_H
-+
-+#include <gpio.h>
-+
-+#endif /* _ASM_MIPS_GPIO_H */
diff --git a/target/linux/generic-2.6/patches/050-mtdpart_redboot_partition_truncate.patch b/target/linux/generic-2.6/patches/050-mtdpart_redboot_partition_truncate.patch
deleted file mode 100644
index 2e2cde0f43..0000000000
--- a/target/linux/generic-2.6/patches/050-mtdpart_redboot_partition_truncate.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-Redboot supports storing the FIS directory and the RedBoot
-configuration information in the same block of flash memory. This is
-not the most common RedBoot configuration, but it is used on
-commercially available boards supported by the kernel.
-
-A recent patch to mtd/redboot.c (http://lkml.org/lkml/2006/3/20/410)
-which corrected the skipping of deleted table entries has exposed the
-latent problem of the kernel redboot parser running off the end of the
-FIS directory and interpreting the RedBoot configuration information
-as table entries.
-
-This patch terminates the table parsing when the first truly empty
-entry is found (table entry deletion only clears the first byte of the
-name, so two cleared bytes in a row indicates the end of the table),
-thereby supporting the combined redboot FIS directory and RedBoot
-configuration information flash layout scenario.
-
-Signed-off-by: Rod Whitby <rod@whitby.id.au>
---
-
-Index: linux-2.6.19/drivers/mtd/redboot.c
-===================================================================
---- linux-2.6.19.orig/drivers/mtd/redboot.c
-+++ linux-2.6.19/drivers/mtd/redboot.c
-@@ -96,7 +96,19 @@ static int parse_redboot_partitions(stru
- */
- if (swab32(buf[i].size) == master->erasesize) {
- int j;
-- for (j = 0; j < numslots && buf[j].name[0] != 0xff; ++j) {
-+ for (j = 0; j < numslots; ++j) {
-+
-+ /* A single 0xff denotes a deleted entry.
-+ * Two of them in a row is the end of the table.
-+ */
-+ if (buf[j].name[0] == 0xff) {
-+ if (buf[j].name[1] == 0xff) {
-+ break;
-+ } else {
-+ continue;
-+ }
-+ }
-+
- /* The unsigned long fields were written with the
- * wrong byte sex, name and pad have no byte sex.
- */
-@@ -123,8 +135,13 @@ static int parse_redboot_partitions(stru
- for (i = 0; i < numslots; i++) {
- struct fis_list *new_fl, **prev;
-
-- if (buf[i].name[0] == 0xff)
-- continue;
-+ if (buf[i].name[0] == 0xff) {
-+ if (buf[i].name[1] == 0xff) {
-+ break;
-+ } else {
-+ continue;
-+ }
-+ }
- if (!redboot_checksum(&buf[i]))
- break;
-
diff --git a/target/linux/generic-2.6/patches/060-rootfs_split.patch b/target/linux/generic-2.6/patches/060-rootfs_split.patch
index b4a55256bf..c3f674afbd 100644
--- a/target/linux/generic-2.6/patches/060-rootfs_split.patch
+++ b/target/linux/generic-2.6/patches/060-rootfs_split.patch
@@ -1,6 +1,6 @@
-diff -ur linux.old/drivers/mtd/Kconfig linux.dev/drivers/mtd/Kconfig
---- linux.old/drivers/mtd/Kconfig 2007-01-10 20:10:37.000000000 +0100
-+++ linux.dev/drivers/mtd/Kconfig 2007-02-19 23:00:53.739457000 +0100
+diff -Nur linux-2.6.21.1/drivers/mtd/Kconfig linux-2.6.21.1-owrt/drivers/mtd/Kconfig
+--- linux-2.6.21.1/drivers/mtd/Kconfig 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1-owrt/drivers/mtd/Kconfig 2007-05-14 10:59:59.000000000 +0200
@@ -49,6 +49,11 @@
devices. Partitioning on NFTL 'devices' is a different - that's the
'normal' form of partitioning used on a block device.
@@ -13,9 +13,9 @@ diff -ur linux.old/drivers/mtd/Kconfig linux.dev/drivers/mtd/Kconfig
config MTD_REDBOOT_PARTS
tristate "RedBoot partition table parsing"
depends on MTD_PARTITIONS
-diff -ur linux.old/drivers/mtd/mtdpart.c linux.dev/drivers/mtd/mtdpart.c
---- linux.old/drivers/mtd/mtdpart.c 2007-01-10 20:10:37.000000000 +0100
-+++ linux.dev/drivers/mtd/mtdpart.c 2007-02-20 00:01:38.587355896 +0100
+diff -Nur linux-2.6.21.1/drivers/mtd/mtdpart.c linux-2.6.21.1-owrt/drivers/mtd/mtdpart.c
+--- linux-2.6.21.1/drivers/mtd/mtdpart.c 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1-owrt/drivers/mtd/mtdpart.c 2007-05-14 11:18:56.000000000 +0200
@@ -20,6 +20,8 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
@@ -25,7 +25,7 @@ diff -ur linux.old/drivers/mtd/mtdpart.c linux.dev/drivers/mtd/mtdpart.c
/* Our partition linked list */
static LIST_HEAD(mtd_partitions);
-@@ -303,6 +305,173 @@
+@@ -308,6 +310,172 @@
return 0;
}
@@ -35,14 +35,13 @@ diff -ur linux.old/drivers/mtd/mtdpart.c linux.dev/drivers/mtd/mtdpart.c
+ struct mtd_part *slave;
+
+ /* allocate the partition structure */
-+ slave = kmalloc (sizeof(*slave), GFP_KERNEL);
++ slave = kzalloc (sizeof(*slave), GFP_KERNEL);
+ if (!slave) {
+ printk ("memory allocation error while creating partitions for \"%s\"\n",
+ master->name);
+ del_mtd_partitions(master);
+ return -ENOMEM;
+ }
-+ memset(slave, 0, sizeof(*slave));
+ list_add(&slave->list, &mtd_partitions);
+
+ /* set up the MTD object for this partition */
@@ -51,8 +50,8 @@ diff -ur linux.old/drivers/mtd/mtdpart.c linux.dev/drivers/mtd/mtdpart.c
+ slave->mtd.size = part->size;
+ slave->mtd.writesize = master->writesize;
+ slave->mtd.oobsize = master->oobsize;
-+ slave->mtd.ecctype = master->ecctype;
-+ slave->mtd.eccsize = master->eccsize;
++ slave->mtd.oobavail = master->oobavail;
++ slave->mtd.subpage_sft = master->subpage_sft;
+
+ slave->mtd.name = part->name;
+ slave->mtd.bank_size = master->bank_size;
@@ -199,7 +198,7 @@ diff -ur linux.old/drivers/mtd/mtdpart.c linux.dev/drivers/mtd/mtdpart.c
/*
* This function, given a master MTD object and a partition table, creates
* and registers slave MTD objects which are bound to the master according to
-@@ -314,171 +483,53 @@
+@@ -319,170 +487,53 @@
const struct mtd_partition *parts,
int nbparts)
{
@@ -250,14 +249,13 @@ diff -ur linux.old/drivers/mtd/mtdpart.c linux.dev/drivers/mtd/mtdpart.c
+ return ret;
- /* allocate the partition structure */
-- slave = kmalloc (sizeof(*slave), GFP_KERNEL);
+- slave = kzalloc (sizeof(*slave), GFP_KERNEL);
- if (!slave) {
- printk ("memory allocation error while creating partitions for \"%s\"\n",
- master->name);
- del_mtd_partitions(master);
- return -ENOMEM;
- }
-- memset(slave, 0, sizeof(*slave));
- list_add(&slave->list, &mtd_partitions);
-
- /* set up the MTD object for this partition */
@@ -266,8 +264,8 @@ diff -ur linux.old/drivers/mtd/mtdpart.c linux.dev/drivers/mtd/mtdpart.c
- slave->mtd.size = parts[i].size;
- slave->mtd.writesize = master->writesize;
- slave->mtd.oobsize = master->oobsize;
-- slave->mtd.ecctype = master->ecctype;
-- slave->mtd.eccsize = master->eccsize;
+- slave->mtd.oobavail = master->oobavail;
+- slave->mtd.subpage_sft = master->subpage_sft;
-
- slave->mtd.name = parts[i].name;
- slave->mtd.bank_size = master->bank_size;
diff --git a/target/linux/generic-2.6/patches/110-ipp2p_0.8.1rc1.patch b/target/linux/generic-2.6/patches/110-ipp2p_0.8.1rc1.patch
index e03f4d5676..67a66b1d90 100644
--- a/target/linux/generic-2.6/patches/110-ipp2p_0.8.1rc1.patch
+++ b/target/linux/generic-2.6/patches/110-ipp2p_0.8.1rc1.patch
@@ -905,12 +905,12 @@ diff -urN linux-2.6.19.old/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.19.dev/net/i
+static int __init init(void)
+{
+ printk(KERN_INFO "IPP2P v%s loading\n", IPP2P_VERSION);
-+ return ipt_register_match(&ipp2p_match);
++ return xt_register_match(&ipp2p_match);
+}
+
+static void __exit fini(void)
+{
-+ ipt_unregister_match(&ipp2p_match);
++ xt_unregister_match(&ipp2p_match);
+ printk(KERN_INFO "IPP2P v%s unloaded\n", IPP2P_VERSION);
+}
+
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 2b4238c688..b11ed53881 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
diff --git a/target/linux/generic-2.6/patches/130-netfilter-ipset.patch b/target/linux/generic-2.6/patches/130-netfilter-ipset.patch
index 8a35d8a6b4..443e78b832 100644
--- a/target/linux/generic-2.6/patches/130-netfilter-ipset.patch
+++ b/target/linux/generic-2.6/patches/130-netfilter-ipset.patch
@@ -1,6 +1,6 @@
-diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set.h linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set.h
---- linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set.h 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set.h linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set.h
+--- linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set.h 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,489 @@
+#ifndef _IP_SET_H
+#define _IP_SET_H
@@ -491,9 +491,9 @@ diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set.h linux-2.6.19.de
+#endif /* __KERNEL__ */
+
+#endif /*_IP_SET_H*/
-diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_iphash.h linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set_iphash.h
---- linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_iphash.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set_iphash.h 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set_iphash.h linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set_iphash.h
+--- linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set_iphash.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set_iphash.h 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,30 @@
+#ifndef __IP_SET_IPHASH_H
+#define __IP_SET_IPHASH_H
@@ -525,9 +525,9 @@ diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_iphash.h linux-2.
+};
+
+#endif /* __IP_SET_IPHASH_H */
-diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_ipmap.h linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set_ipmap.h
---- linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_ipmap.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set_ipmap.h 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set_ipmap.h linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set_ipmap.h
+--- linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set_ipmap.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set_ipmap.h 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,56 @@
+#ifndef __IP_SET_IPMAP_H
+#define __IP_SET_IPMAP_H
@@ -585,9 +585,9 @@ diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_ipmap.h linux-2.6
+}
+
+#endif /* __IP_SET_IPMAP_H */
-diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_iptree.h linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set_iptree.h
---- linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_iptree.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set_iptree.h 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set_iptree.h linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set_iptree.h
+--- linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set_iptree.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set_iptree.h 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,39 @@
+#ifndef __IP_SET_IPTREE_H
+#define __IP_SET_IPTREE_H
@@ -628,9 +628,9 @@ diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_iptree.h linux-2.
+};
+
+#endif /* __IP_SET_IPTREE_H */
-diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_jhash.h linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set_jhash.h
---- linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_jhash.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set_jhash.h 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set_jhash.h linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set_jhash.h
+--- linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set_jhash.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set_jhash.h 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,148 @@
+#ifndef _LINUX_IPSET_JHASH_H
+#define _LINUX_IPSET_JHASH_H
@@ -780,9 +780,9 @@ diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_jhash.h linux-2.6
+}
+
+#endif /* _LINUX_IPSET_JHASH_H */
-diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_macipmap.h linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set_macipmap.h
---- linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_macipmap.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set_macipmap.h 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set_macipmap.h linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set_macipmap.h
+--- linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set_macipmap.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set_macipmap.h 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,38 @@
+#ifndef __IP_SET_MACIPMAP_H
+#define __IP_SET_MACIPMAP_H
@@ -822,9 +822,9 @@ diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_macipmap.h linux-
+};
+
+#endif /* __IP_SET_MACIPMAP_H */
-diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_malloc.h linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set_malloc.h
---- linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_malloc.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set_malloc.h 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set_malloc.h linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set_malloc.h
+--- linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set_malloc.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set_malloc.h 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,42 @@
+#ifndef _IP_SET_MALLOC_H
+#define _IP_SET_MALLOC_H
@@ -868,9 +868,9 @@ diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_malloc.h linux-2.
+#endif /* __KERNEL__ */
+
+#endif /*_IP_SET_MALLOC_H*/
-diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_nethash.h linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set_nethash.h
---- linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_nethash.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set_nethash.h 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set_nethash.h linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set_nethash.h
+--- linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set_nethash.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set_nethash.h 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,55 @@
+#ifndef __IP_SET_NETHASH_H
+#define __IP_SET_NETHASH_H
@@ -927,9 +927,9 @@ diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_nethash.h linux-2
+}
+
+#endif /* __IP_SET_NETHASH_H */
-diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_portmap.h linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set_portmap.h
---- linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_portmap.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set_portmap.h 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set_portmap.h linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set_portmap.h
+--- linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set_portmap.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set_portmap.h 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,25 @@
+#ifndef __IP_SET_PORTMAP_H
+#define __IP_SET_PORTMAP_H
@@ -956,9 +956,9 @@ diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_portmap.h linux-2
+};
+
+#endif /* __IP_SET_PORTMAP_H */
-diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_prime.h linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set_prime.h
---- linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_prime.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_set_prime.h 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set_prime.h linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set_prime.h
+--- linux-2.6.21.1/include/linux/netfilter_ipv4/ip_set_prime.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ip_set_prime.h 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,34 @@
+#ifndef __IP_SET_PRIME_H
+#define __IP_SET_PRIME_H
@@ -994,9 +994,9 @@ diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_set_prime.h linux-2.6
+}
+
+#endif /* __IP_SET_PRIME_H */
-diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ipt_set.h linux-2.6.19.dev/include/linux/netfilter_ipv4/ipt_set.h
---- linux-2.6.19.old/include/linux/netfilter_ipv4/ipt_set.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/ipt_set.h 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/include/linux/netfilter_ipv4/ipt_set.h linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ipt_set.h
+--- linux-2.6.21.1/include/linux/netfilter_ipv4/ipt_set.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ipt_set.h 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,21 @@
+#ifndef _IPT_SET_H
+#define _IPT_SET_H
@@ -1019,9 +1019,9 @@ diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ipt_set.h linux-2.6.19.d
+};
+
+#endif /*_IPT_SET_H*/
-diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/listhelp.h linux-2.6.19.dev/include/linux/netfilter_ipv4/listhelp.h
---- linux-2.6.19.old/include/linux/netfilter_ipv4/listhelp.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/listhelp.h 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/include/linux/netfilter_ipv4/listhelp.h linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/listhelp.h
+--- linux-2.6.21.1/include/linux/netfilter_ipv4/listhelp.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/listhelp.h 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,123 @@
+#ifndef _LISTHELP_H
+#define _LISTHELP_H
@@ -1146,9 +1146,9 @@ diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/listhelp.h linux-2.6.19.
+LIST_FIND(head, __list_cmp_name, void *, name)
+
+#endif /*_LISTHELP_H*/
-diff -urN linux-2.6.19.old/net/ipv4/netfilter/ip_set.c linux-2.6.19.dev/net/ipv4/netfilter/ip_set.c
---- linux-2.6.19.old/net/ipv4/netfilter/ip_set.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/netfilter/ip_set.c 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/net/ipv4/netfilter/ip_set.c linux-2.6.21.1-owrt/net/ipv4/netfilter/ip_set.c
+--- linux-2.6.21.1/net/ipv4/netfilter/ip_set.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/net/ipv4/netfilter/ip_set.c 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,1989 @@
+/* Copyright (C) 2000-2002 Joakim Axelsson <gozem@linux.nu>
+ * Patrick Schaaf <bof@bof.de>
@@ -3139,9 +3139,9 @@ diff -urN linux-2.6.19.old/net/ipv4/netfilter/ip_set.c linux-2.6.19.dev/net/ipv4
+
+module_init(init);
+module_exit(fini);
-diff -urN linux-2.6.19.old/net/ipv4/netfilter/ip_set_iphash.c linux-2.6.19.dev/net/ipv4/netfilter/ip_set_iphash.c
---- linux-2.6.19.old/net/ipv4/netfilter/ip_set_iphash.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/netfilter/ip_set_iphash.c 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/net/ipv4/netfilter/ip_set_iphash.c linux-2.6.21.1-owrt/net/ipv4/netfilter/ip_set_iphash.c
+--- linux-2.6.21.1/net/ipv4/netfilter/ip_set_iphash.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/net/ipv4/netfilter/ip_set_iphash.c 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,379 @@
+/* Copyright (C) 2003-2004 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
+ *
@@ -3522,9 +3522,9 @@ diff -urN linux-2.6.19.old/net/ipv4/netfilter/ip_set_iphash.c linux-2.6.19.dev/n
+
+module_init(init);
+module_exit(fini);
-diff -urN linux-2.6.19.old/net/ipv4/netfilter/ip_set_ipmap.c linux-2.6.19.dev/net/ipv4/netfilter/ip_set_ipmap.c
---- linux-2.6.19.old/net/ipv4/netfilter/ip_set_ipmap.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/netfilter/ip_set_ipmap.c 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/net/ipv4/netfilter/ip_set_ipmap.c linux-2.6.21.1-owrt/net/ipv4/netfilter/ip_set_ipmap.c
+--- linux-2.6.21.1/net/ipv4/netfilter/ip_set_ipmap.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/net/ipv4/netfilter/ip_set_ipmap.c 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,313 @@
+/* Copyright (C) 2000-2002 Joakim Axelsson <gozem@linux.nu>
+ * Patrick Schaaf <bof@bof.de>
@@ -3839,9 +3839,9 @@ diff -urN linux-2.6.19.old/net/ipv4/netfilter/ip_set_ipmap.c linux-2.6.19.dev/ne
+
+module_init(init);
+module_exit(fini);
-diff -urN linux-2.6.19.old/net/ipv4/netfilter/ip_set_iptree.c linux-2.6.19.dev/net/ipv4/netfilter/ip_set_iptree.c
---- linux-2.6.19.old/net/ipv4/netfilter/ip_set_iptree.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/netfilter/ip_set_iptree.c 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/net/ipv4/netfilter/ip_set_iptree.c linux-2.6.21.1-owrt/net/ipv4/netfilter/ip_set_iptree.c
+--- linux-2.6.21.1/net/ipv4/netfilter/ip_set_iptree.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/net/ipv4/netfilter/ip_set_iptree.c 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,510 @@
+/* Copyright (C) 2005 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
+ *
@@ -4353,9 +4353,9 @@ diff -urN linux-2.6.19.old/net/ipv4/netfilter/ip_set_iptree.c linux-2.6.19.dev/n
+
+module_init(init);
+module_exit(fini);
-diff -urN linux-2.6.19.old/net/ipv4/netfilter/ip_set_macipmap.c linux-2.6.19.dev/net/ipv4/netfilter/ip_set_macipmap.c
---- linux-2.6.19.old/net/ipv4/netfilter/ip_set_macipmap.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/netfilter/ip_set_macipmap.c 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/net/ipv4/netfilter/ip_set_macipmap.c linux-2.6.21.1-owrt/net/ipv4/netfilter/ip_set_macipmap.c
+--- linux-2.6.21.1/net/ipv4/netfilter/ip_set_macipmap.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/net/ipv4/netfilter/ip_set_macipmap.c 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,338 @@
+/* Copyright (C) 2000-2002 Joakim Axelsson <gozem@linux.nu>
+ * Patrick Schaaf <bof@bof.de>
@@ -4695,9 +4695,9 @@ diff -urN linux-2.6.19.old/net/ipv4/netfilter/ip_set_macipmap.c linux-2.6.19.dev
+
+module_init(init);
+module_exit(fini);
-diff -urN linux-2.6.19.old/net/ipv4/netfilter/ip_set_nethash.c linux-2.6.19.dev/net/ipv4/netfilter/ip_set_nethash.c
---- linux-2.6.19.old/net/ipv4/netfilter/ip_set_nethash.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/netfilter/ip_set_nethash.c 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/net/ipv4/netfilter/ip_set_nethash.c linux-2.6.21.1-owrt/net/ipv4/netfilter/ip_set_nethash.c
+--- linux-2.6.21.1/net/ipv4/netfilter/ip_set_nethash.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/net/ipv4/netfilter/ip_set_nethash.c 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,449 @@
+/* Copyright (C) 2003-2004 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
+ *
@@ -5148,9 +5148,9 @@ diff -urN linux-2.6.19.old/net/ipv4/netfilter/ip_set_nethash.c linux-2.6.19.dev/
+
+module_init(init);
+module_exit(fini);
-diff -urN linux-2.6.19.old/net/ipv4/netfilter/ip_set_portmap.c linux-2.6.19.dev/net/ipv4/netfilter/ip_set_portmap.c
---- linux-2.6.19.old/net/ipv4/netfilter/ip_set_portmap.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/netfilter/ip_set_portmap.c 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/net/ipv4/netfilter/ip_set_portmap.c linux-2.6.21.1-owrt/net/ipv4/netfilter/ip_set_portmap.c
+--- linux-2.6.21.1/net/ipv4/netfilter/ip_set_portmap.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/net/ipv4/netfilter/ip_set_portmap.c 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,325 @@
+/* Copyright (C) 2003-2004 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
+ *
@@ -5477,9 +5477,9 @@ diff -urN linux-2.6.19.old/net/ipv4/netfilter/ip_set_portmap.c linux-2.6.19.dev/
+
+module_init(init);
+module_exit(fini);
-diff -urN linux-2.6.19.old/net/ipv4/netfilter/ipt_set.c linux-2.6.19.dev/net/ipv4/netfilter/ipt_set.c
---- linux-2.6.19.old/net/ipv4/netfilter/ipt_set.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/netfilter/ipt_set.c 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/net/ipv4/netfilter/ipt_set.c linux-2.6.21.1-owrt/net/ipv4/netfilter/ipt_set.c
+--- linux-2.6.21.1/net/ipv4/netfilter/ipt_set.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/net/ipv4/netfilter/ipt_set.c 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,105 @@
+/* Copyright (C) 2000-2002 Joakim Axelsson <gozem@linux.nu>
+ * Patrick Schaaf <bof@bof.de>
@@ -5586,9 +5586,9 @@ diff -urN linux-2.6.19.old/net/ipv4/netfilter/ipt_set.c linux-2.6.19.dev/net/ipv
+
+module_init(init);
+module_exit(fini);
-diff -urN linux-2.6.19.old/net/ipv4/netfilter/ipt_SET.c linux-2.6.19.dev/net/ipv4/netfilter/ipt_SET.c
---- linux-2.6.19.old/net/ipv4/netfilter/ipt_SET.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/netfilter/ipt_SET.c 2006-12-14 03:13:43.000000000 +0100
+diff -Nur linux-2.6.21.1/net/ipv4/netfilter/ipt_SET.c linux-2.6.21.1-owrt/net/ipv4/netfilter/ipt_SET.c
+--- linux-2.6.21.1/net/ipv4/netfilter/ipt_SET.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/net/ipv4/netfilter/ipt_SET.c 2007-05-14 11:44:19.000000000 +0200
@@ -0,0 +1,120 @@
+/* Copyright (C) 2000-2002 Joakim Axelsson <gozem@linux.nu>
+ * Patrick Schaaf <bof@bof.de>
@@ -5700,7 +5700,7 @@ diff -urN linux-2.6.19.old/net/ipv4/netfilter/ipt_SET.c linux-2.6.19.dev/net/ipv
+
+static int __init init(void)
+{
-+ return ipt_register_target(&SET_target);
++ return xt_register_target(&SET_target);
+}
+
+static void __exit fini(void)
@@ -5710,10 +5710,10 @@ diff -urN linux-2.6.19.old/net/ipv4/netfilter/ipt_SET.c linux-2.6.19.dev/net/ipv
+
+module_init(init);
+module_exit(fini);
-diff -urN linux-2.6.19.old/net/ipv4/netfilter/Kconfig linux-2.6.19.dev/net/ipv4/netfilter/Kconfig
---- linux-2.6.19.old/net/ipv4/netfilter/Kconfig 2006-12-14 03:13:41.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/netfilter/Kconfig 2006-12-14 03:13:43.000000000 +0100
-@@ -647,5 +647,106 @@
+diff -Nur linux-2.6.21.1/net/ipv4/netfilter/Kconfig linux-2.6.21.1-owrt/net/ipv4/netfilter/Kconfig
+--- linux-2.6.21.1/net/ipv4/netfilter/Kconfig 2007-05-14 11:24:57.000000000 +0200
++++ linux-2.6.21.1-owrt/net/ipv4/netfilter/Kconfig 2007-05-14 11:44:19.000000000 +0200
+@@ -681,5 +681,106 @@
Allows altering the ARP packet payload: source and destination
hardware and network addresses.
@@ -5820,21 +5820,21 @@ diff -urN linux-2.6.19.old/net/ipv4/netfilter/Kconfig linux-2.6.19.dev/net/ipv4/
+
endmenu
-diff -urN linux-2.6.19.old/net/ipv4/netfilter/Makefile linux-2.6.19.dev/net/ipv4/netfilter/Makefile
---- linux-2.6.19.old/net/ipv4/netfilter/Makefile 2006-12-14 03:13:41.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/netfilter/Makefile 2006-12-14 03:13:43.000000000 +0100
-@@ -54,6 +54,7 @@
+diff -Nur linux-2.6.21.1/net/ipv4/netfilter/Makefile linux-2.6.21.1-owrt/net/ipv4/netfilter/Makefile
+--- linux-2.6.21.1/net/ipv4/netfilter/Makefile 2007-05-14 11:24:57.000000000 +0200
++++ linux-2.6.21.1-owrt/net/ipv4/netfilter/Makefile 2007-05-14 11:47:22.000000000 +0200
+@@ -83,6 +83,7 @@
+ obj-$(CONFIG_IP_NF_RAW) += iptable_raw.o
# matches
- obj-$(CONFIG_IP_NF_MATCH_HASHLIMIT) += ipt_hashlimit.o
+obj-$(CONFIG_IP_NF_MATCH_SET) += ipt_set.o
obj-$(CONFIG_IP_NF_MATCH_IPRANGE) += ipt_iprange.o
obj-$(CONFIG_IP_NF_MATCH_OWNER) += ipt_owner.o
obj-$(CONFIG_IP_NF_MATCH_TOS) += ipt_tos.o
-@@ -77,6 +78,17 @@
- obj-$(CONFIG_IP_NF_TARGET_LOG) += ipt_LOG.o
+@@ -107,6 +108,16 @@
obj-$(CONFIG_IP_NF_TARGET_ULOG) += ipt_ULOG.o
- obj-$(CONFIG_IP_NF_TARGET_TCPMSS) += ipt_TCPMSS.o
+ obj-$(CONFIG_IP_NF_TARGET_CLUSTERIP) += ipt_CLUSTERIP.o
+ obj-$(CONFIG_IP_NF_TARGET_TTL) += ipt_TTL.o
+obj-$(CONFIG_IP_NF_TARGET_SET) += ipt_SET.o
+
+# sets
@@ -5845,7 +5845,6 @@ diff -urN linux-2.6.19.old/net/ipv4/netfilter/Makefile linux-2.6.19.dev/net/ipv4
+obj-$(CONFIG_IP_NF_SET_IPHASH) += ip_set_iphash.o
+obj-$(CONFIG_IP_NF_SET_NETHASH) += ip_set_nethash.o
+obj-$(CONFIG_IP_NF_SET_IPTREE) += ip_set_iptree.o
-+
- obj-$(CONFIG_IP_NF_TARGET_CLUSTERIP) += ipt_CLUSTERIP.o
- obj-$(CONFIG_IP_NF_TARGET_TTL) += ipt_TTL.o
+ # generic ARP tables
+ obj-$(CONFIG_IP_NF_ARPTABLES) += arp_tables.o
diff --git a/target/linux/generic-2.6/patches/150-netfilter_imq.patch b/target/linux/generic-2.6/patches/150-netfilter_imq.patch
index 54324022a9..742b4e8d01 100644
--- a/target/linux/generic-2.6/patches/150-netfilter_imq.patch
+++ b/target/linux/generic-2.6/patches/150-netfilter_imq.patch
@@ -1,6 +1,5 @@
-diff -urN linux-2.6.19/drivers/net/imq.c linux-2.6.19+imq/drivers/net/imq.c
---- linux-2.6.19/drivers/net/imq.c 1970-01-01 09:30:00.000000000 +0930
-+++ linux-2.6.19+imq/drivers/net/imq.c 2006-12-05 23:01:02.000000000 +1030
+--- linux-2.6.20-original/drivers/net/imq.c 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.20/drivers/net/imq.c 2007-02-12 23:55:04.000000000 +0200
@@ -0,0 +1,402 @@
+/*
+ * Pseudo-driver for the intermediate queue device.
@@ -404,9 +403,8 @@ diff -urN linux-2.6.19/drivers/net/imq.c linux-2.6.19+imq/drivers/net/imq.c
+MODULE_AUTHOR("http://www.linuximq.net");
+MODULE_DESCRIPTION("Pseudo-driver for the intermediate queue device. See http://www.linuximq.net/ for more information.");
+MODULE_LICENSE("GPL");
-diff -urN linux-2.6.19/drivers/net/Kconfig linux-2.6.19+imq/drivers/net/Kconfig
---- linux-2.6.19/drivers/net/Kconfig 2006-12-01 14:05:30.000000000 +1030
-+++ linux-2.6.19+imq/drivers/net/Kconfig 2006-12-05 23:03:52.000000000 +1030
+--- linux-2.6.20-original/drivers/net/Kconfig 2007-02-04 20:44:54.000000000 +0200
++++ linux-2.6.20/drivers/net/Kconfig 2007-02-12 23:55:04.000000000 +0200
@@ -96,6 +96,129 @@
To compile this driver as a module, choose M here: the module
will be called eql. If unsure, say N.
@@ -537,9 +535,8 @@ diff -urN linux-2.6.19/drivers/net/Kconfig linux-2.6.19+imq/drivers/net/Kconfig
config TUN
tristate "Universal TUN/TAP device driver support"
select CRC32
-diff -urN linux-2.6.19/drivers/net/Makefile linux-2.6.19+imq/drivers/net/Makefile
---- linux-2.6.19/drivers/net/Makefile 2006-12-01 14:05:30.000000000 +1030
-+++ linux-2.6.19+imq/drivers/net/Makefile 2006-12-04 12:41:01.000000000 +1030
+--- linux-2.6.20-original/drivers/net/Makefile 2007-02-04 20:44:54.000000000 +0200
++++ linux-2.6.20/drivers/net/Makefile 2007-02-12 23:55:04.000000000 +0200
@@ -124,6 +124,7 @@
obj-$(CONFIG_SLHC) += slhc.o
@@ -548,9 +545,8 @@ diff -urN linux-2.6.19/drivers/net/Makefile linux-2.6.19+imq/drivers/net/Makefil
obj-$(CONFIG_IFB) += ifb.o
obj-$(CONFIG_DE600) += de600.o
obj-$(CONFIG_DE620) += de620.o
-diff -urN linux-2.6.19/include/linux/imq.h linux-2.6.19+imq/include/linux/imq.h
---- linux-2.6.19/include/linux/imq.h 1970-01-01 09:30:00.000000000 +0930
-+++ linux-2.6.19+imq/include/linux/imq.h 2006-12-04 12:41:01.000000000 +1030
+--- linux-2.6.20-original/include/linux/imq.h 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.20/include/linux/imq.h 2007-02-12 23:55:04.000000000 +0200
@@ -0,0 +1,9 @@
+#ifndef _IMQ_H
+#define _IMQ_H
@@ -561,9 +557,8 @@ diff -urN linux-2.6.19/include/linux/imq.h linux-2.6.19+imq/include/linux/imq.h
+#define IMQ_F_ENQUEUE 0x80
+
+#endif /* _IMQ_H */
-diff -urN linux-2.6.19/include/linux/netfilter_ipv4/ipt_IMQ.h linux-2.6.19+imq/include/linux/netfilter_ipv4/ipt_IMQ.h
---- linux-2.6.19/include/linux/netfilter_ipv4/ipt_IMQ.h 1970-01-01 09:30:00.000000000 +0930
-+++ linux-2.6.19+imq/include/linux/netfilter_ipv4/ipt_IMQ.h 2006-12-05 23:04:22.000000000 +1030
+--- linux-2.6.20-original/include/linux/netfilter_ipv4/ipt_IMQ.h 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.20/include/linux/netfilter_ipv4/ipt_IMQ.h 2007-02-12 23:55:04.000000000 +0200
@@ -0,0 +1,8 @@
+#ifndef _IPT_IMQ_H
+#define _IPT_IMQ_H
@@ -573,9 +568,8 @@ diff -urN linux-2.6.19/include/linux/netfilter_ipv4/ipt_IMQ.h linux-2.6.19+imq/i
+};
+
+#endif /* _IPT_IMQ_H */
-diff -urN linux-2.6.19/include/linux/netfilter_ipv6/ip6t_IMQ.h linux-2.6.19+imq/include/linux/netfilter_ipv6/ip6t_IMQ.h
---- linux-2.6.19/include/linux/netfilter_ipv6/ip6t_IMQ.h 1970-01-01 09:30:00.000000000 +0930
-+++ linux-2.6.19+imq/include/linux/netfilter_ipv6/ip6t_IMQ.h 2006-12-05 23:04:32.000000000 +1030
+--- linux-2.6.20-original/include/linux/netfilter_ipv6/ip6t_IMQ.h 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.20/include/linux/netfilter_ipv6/ip6t_IMQ.h 2007-02-12 23:55:04.000000000 +0200
@@ -0,0 +1,8 @@
+#ifndef _IP6T_IMQ_H
+#define _IP6T_IMQ_H
@@ -585,10 +579,9 @@ diff -urN linux-2.6.19/include/linux/netfilter_ipv6/ip6t_IMQ.h linux-2.6.19+imq/
+};
+
+#endif /* _IP6T_IMQ_H */
-diff -urN linux-2.6.19/include/linux/skbuff.h linux-2.6.19+imq/include/linux/skbuff.h
---- linux-2.6.19/include/linux/skbuff.h 2006-12-01 14:05:44.000000000 +1030
-+++ linux-2.6.19+imq/include/linux/skbuff.h 2006-12-05 23:05:06.000000000 +1030
-@@ -292,6 +292,10 @@
+--- linux-2.6.20-original/include/linux/skbuff.h 2007-02-04 20:44:54.000000000 +0200
++++ linux-2.6.20/include/linux/skbuff.h 2007-02-12 23:55:04.000000000 +0200
+@@ -293,6 +293,10 @@
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
struct sk_buff *nfct_reasm;
#endif
@@ -599,9 +592,8 @@ diff -urN linux-2.6.19/include/linux/skbuff.h linux-2.6.19+imq/include/linux/skb
#ifdef CONFIG_BRIDGE_NETFILTER
struct nf_bridge_info *nf_bridge;
#endif
-diff -urN linux-2.6.19/net/core/dev.c linux-2.6.19+imq/net/core/dev.c
---- linux-2.6.19/net/core/dev.c 2006-12-01 14:05:45.000000000 +1030
-+++ linux-2.6.19+imq/net/core/dev.c 2006-12-05 23:05:40.000000000 +1030
+--- linux-2.6.20-original/net/core/dev.c 2007-02-04 20:44:54.000000000 +0200
++++ linux-2.6.20/net/core/dev.c 2007-02-12 23:55:04.000000000 +0200
@@ -94,6 +94,9 @@
#include <linux/skbuff.h>
#include <net/sock.h>
@@ -612,7 +604,7 @@ diff -urN linux-2.6.19/net/core/dev.c linux-2.6.19+imq/net/core/dev.c
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/stat.h>
-@@ -1344,7 +1347,11 @@
+@@ -1343,7 +1346,11 @@
int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
if (likely(!skb->next)) {
@@ -625,10 +617,9 @@ diff -urN linux-2.6.19/net/core/dev.c linux-2.6.19+imq/net/core/dev.c
dev_queue_xmit_nit(skb, dev);
if (netif_needs_gso(dev, skb)) {
-diff -urN linux-2.6.19/net/core/skbuff.c linux-2.6.19+imq/net/core/skbuff.c
---- linux-2.6.19/net/core/skbuff.c 2006-12-01 14:05:45.000000000 +1030
-+++ linux-2.6.19+imq/net/core/skbuff.c 2006-12-04 12:41:01.000000000 +1030
-@@ -482,6 +482,10 @@
+--- linux-2.6.20-original/net/core/skbuff.c 2007-02-04 20:44:54.000000000 +0200
++++ linux-2.6.20/net/core/skbuff.c 2007-02-12 23:55:04.000000000 +0200
+@@ -485,6 +485,10 @@
C(nfct_reasm);
nf_conntrack_get_reasm(skb->nfct_reasm);
#endif
@@ -639,7 +630,7 @@ diff -urN linux-2.6.19/net/core/skbuff.c linux-2.6.19+imq/net/core/skbuff.c
#ifdef CONFIG_BRIDGE_NETFILTER
C(nf_bridge);
nf_bridge_get(skb->nf_bridge);
-@@ -546,6 +550,10 @@
+@@ -549,6 +553,10 @@
#if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE)
new->ipvs_property = old->ipvs_property;
#endif
@@ -650,9 +641,8 @@ diff -urN linux-2.6.19/net/core/skbuff.c linux-2.6.19+imq/net/core/skbuff.c
#ifdef CONFIG_BRIDGE_NETFILTER
new->nf_bridge = old->nf_bridge;
nf_bridge_get(old->nf_bridge);
-diff -urN linux-2.6.19/net/ipv4/netfilter/ipt_IMQ.c linux-2.6.19+imq/net/ipv4/netfilter/ipt_IMQ.c
---- linux-2.6.19/net/ipv4/netfilter/ipt_IMQ.c 1970-01-01 09:30:00.000000000 +0930
-+++ linux-2.6.19.2/net/ipv4/netfilter/ipt_IMQ.c 2007-01-25 09:59:34.000000000 +0100
+--- linux-2.6.20-original/net/ipv4/netfilter/ipt_IMQ.c 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.20/net/ipv4/netfilter/ipt_IMQ.c 2007-02-12 23:55:04.000000000 +0200
@@ -0,0 +1,71 @@
+/*
+ * This target marks packets to be enqueued to an imq device
@@ -708,7 +698,7 @@ diff -urN linux-2.6.19/net/ipv4/netfilter/ipt_IMQ.c linux-2.6.19+imq/net/ipv4/ne
+
+static int __init init(void)
+{
-+ if (ipt_register_target(&ipt_imq_reg))
++ if (xt_register_target(&ipt_imq_reg))
+ return -EINVAL;
+
+ return 0;
@@ -716,7 +706,7 @@ diff -urN linux-2.6.19/net/ipv4/netfilter/ipt_IMQ.c linux-2.6.19+imq/net/ipv4/ne
+
+static void __exit fini(void)
+{
-+ ipt_unregister_target(&ipt_imq_reg);
++ xt_unregister_target(&ipt_imq_reg);
+}
+
+module_init(init);
@@ -725,10 +715,9 @@ diff -urN linux-2.6.19/net/ipv4/netfilter/ipt_IMQ.c linux-2.6.19+imq/net/ipv4/ne
+MODULE_AUTHOR("http://www.linuximq.net");
+MODULE_DESCRIPTION("Pseudo-driver for the intermediate queue device. See http://www.linuximq.net/ for more information.");
+MODULE_LICENSE("GPL");
-diff -urN linux-2.6.19/net/ipv4/netfilter/Kconfig linux-2.6.19+imq/net/ipv4/netfilter/Kconfig
---- linux-2.6.19/net/ipv4/netfilter/Kconfig 2006-12-01 14:05:45.000000000 +1030
-+++ linux-2.6.19+imq/net/ipv4/netfilter/Kconfig 2006-12-04 12:41:01.000000000 +1030
-@@ -533,6 +533,17 @@
+--- linux-2.6.20-original/net/ipv4/netfilter/Kconfig 2007-02-04 20:44:54.000000000 +0200
++++ linux-2.6.20/net/ipv4/netfilter/Kconfig 2007-02-12 23:55:04.000000000 +0200
+@@ -591,6 +591,17 @@
To compile it as a module, choose M here. If unsure, say N.
@@ -746,10 +735,9 @@ diff -urN linux-2.6.19/net/ipv4/netfilter/Kconfig linux-2.6.19+imq/net/ipv4/netf
config IP_NF_TARGET_TOS
tristate "TOS target support"
depends on IP_NF_MANGLE
-diff -urN linux-2.6.19/net/ipv4/netfilter/Makefile linux-2.6.19+imq/net/ipv4/netfilter/Makefile
---- linux-2.6.19/net/ipv4/netfilter/Makefile 2006-12-01 14:05:45.000000000 +1030
-+++ linux-2.6.19+imq/net/ipv4/netfilter/Makefile 2006-12-04 12:41:01.000000000 +1030
-@@ -67,6 +67,7 @@
+--- linux-2.6.20-original/net/ipv4/netfilter/Makefile 2007-02-04 20:44:54.000000000 +0200
++++ linux-2.6.20/net/ipv4/netfilter/Makefile 2007-02-12 23:55:04.000000000 +0200
+@@ -96,6 +96,7 @@
obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o
obj-$(CONFIG_IP_NF_TARGET_TOS) += ipt_TOS.o
obj-$(CONFIG_IP_NF_TARGET_ECN) += ipt_ECN.o
@@ -757,9 +745,8 @@ diff -urN linux-2.6.19/net/ipv4/netfilter/Makefile linux-2.6.19+imq/net/ipv4/net
obj-$(CONFIG_IP_NF_TARGET_MASQUERADE) += ipt_MASQUERADE.o
obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o
obj-$(CONFIG_IP_NF_TARGET_NETMAP) += ipt_NETMAP.o
-diff -urN linux-2.6.19/net/ipv6/netfilter/ip6t_IMQ.c linux-2.6.19+imq/net/ipv6/netfilter/ip6t_IMQ.c
---- linux-2.6.19/net/ipv6/netfilter/ip6t_IMQ.c 1970-01-01 09:30:00.000000000 +0930
-+++ linux-2.6.19.2/net/ipv6/netfilter/ip6t_IMQ.c 2007-01-25 10:06:41.000000000 +0100
+--- linux-2.6.20-original/net/ipv6/netfilter/ip6t_IMQ.c 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.20/net/ipv6/netfilter/ip6t_IMQ.c 2007-02-12 23:55:04.000000000 +0200
@@ -0,0 +1,71 @@
+/*
+ * This target marks packets to be enqueued to an imq device
@@ -832,10 +819,9 @@ diff -urN linux-2.6.19/net/ipv6/netfilter/ip6t_IMQ.c linux-2.6.19+imq/net/ipv6/n
+MODULE_AUTHOR("http://www.linuximq.net");
+MODULE_DESCRIPTION("Pseudo-driver for the intermediate queue device. See http://www.linuximq.net/ for more information.");
+MODULE_LICENSE("GPL");
-diff -urN linux-2.6.19/net/ipv6/netfilter/Kconfig linux-2.6.19+imq/net/ipv6/netfilter/Kconfig
---- linux-2.6.19/net/ipv6/netfilter/Kconfig 2006-12-01 14:05:46.000000000 +1030
-+++ linux-2.6.19+imq/net/ipv6/netfilter/Kconfig 2006-12-04 12:41:01.000000000 +1030
-@@ -163,6 +163,15 @@
+--- linux-2.6.20-original/net/ipv6/netfilter/Kconfig 2007-02-04 20:44:54.000000000 +0200
++++ linux-2.6.20/net/ipv6/netfilter/Kconfig 2007-02-12 23:55:04.000000000 +0200
+@@ -164,6 +164,15 @@
To compile it as a module, choose M here. If unsure, say N.
@@ -851,9 +837,8 @@ diff -urN linux-2.6.19/net/ipv6/netfilter/Kconfig linux-2.6.19+imq/net/ipv6/netf
config IP6_NF_TARGET_HL
tristate 'HL (hoplimit) target support'
depends on IP6_NF_MANGLE
-diff -urN linux-2.6.19/net/ipv6/netfilter/Makefile linux-2.6.19+imq/net/ipv6/netfilter/Makefile
---- linux-2.6.19/net/ipv6/netfilter/Makefile 2006-12-01 14:05:46.000000000 +1030
-+++ linux-2.6.19+imq/net/ipv6/netfilter/Makefile 2006-12-04 12:41:01.000000000 +1030
+--- linux-2.6.20-original/net/ipv6/netfilter/Makefile 2007-02-04 20:44:54.000000000 +0200
++++ linux-2.6.20/net/ipv6/netfilter/Makefile 2007-02-12 23:55:04.000000000 +0200
@@ -13,6 +13,7 @@
obj-$(CONFIG_IP6_NF_MATCH_OWNER) += ip6t_owner.o
obj-$(CONFIG_IP6_NF_FILTER) += ip6table_filter.o
@@ -862,9 +847,8 @@ diff -urN linux-2.6.19/net/ipv6/netfilter/Makefile linux-2.6.19+imq/net/ipv6/net
obj-$(CONFIG_IP6_NF_TARGET_HL) += ip6t_HL.o
obj-$(CONFIG_IP6_NF_QUEUE) += ip6_queue.o
obj-$(CONFIG_IP6_NF_TARGET_LOG) += ip6t_LOG.o
-diff -urN linux-2.6.19/net/sched/sch_generic.c linux-2.6.19+imq/net/sched/sch_generic.c
---- linux-2.6.19/net/sched/sch_generic.c 2006-12-01 14:05:46.000000000 +1030
-+++ linux-2.6.19+imq/net/sched/sch_generic.c 2006-12-05 23:08:54.000000000 +1030
+--- linux-2.6.20-original/net/sched/sch_generic.c 2007-02-04 20:44:54.000000000 +0200
++++ linux-2.6.20/net/sched/sch_generic.c 2007-02-12 23:55:04.000000000 +0200
@@ -87,7 +87,6 @@
NOTE: Called under dev->queue_lock with locally disabled BH.
diff --git a/target/linux/generic-2.6/patches/160-netfilter_route.patch b/target/linux/generic-2.6/patches/160-netfilter_route.patch
index 7e8491c3e3..0d73ba3193 100644
--- a/target/linux/generic-2.6/patches/160-netfilter_route.patch
+++ b/target/linux/generic-2.6/patches/160-netfilter_route.patch
@@ -1,6 +1,6 @@
-diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ipt_ROUTE.h linux-2.6.19.dev/include/linux/netfilter_ipv4/ipt_ROUTE.h
---- linux-2.6.19.old/include/linux/netfilter_ipv4/ipt_ROUTE.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/ipt_ROUTE.h 2006-12-14 03:13:49.000000000 +0100
+diff -Nur linux-2.6.21.1/include/linux/netfilter_ipv4/ipt_ROUTE.h linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ipt_ROUTE.h
+--- linux-2.6.21.1/include/linux/netfilter_ipv4/ipt_ROUTE.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/netfilter_ipv4/ipt_ROUTE.h 2007-05-23 20:32:22.000000000 +0200
@@ -0,0 +1,23 @@
+/* Header file for iptables ipt_ROUTE target
+ *
@@ -14,10 +14,10 @@ diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ipt_ROUTE.h linux-2.6.19
+#define IPT_ROUTE_IFNAMSIZ 16
+
+struct ipt_route_target_info {
-+ char oif[IPT_ROUTE_IFNAMSIZ]; /* Output Interface Name */
-+ char iif[IPT_ROUTE_IFNAMSIZ]; /* Input Interface Name */
-+ u_int32_t gw; /* IP address of gateway */
-+ u_int8_t flags;
++ char oif[IPT_ROUTE_IFNAMSIZ]; /* Output Interface Name */
++ char iif[IPT_ROUTE_IFNAMSIZ]; /* Input Interface Name */
++ u_int32_t gw; /* IP address of gateway */
++ u_int8_t flags;
+};
+
+/* Values for "flags" field */
@@ -25,9 +25,9 @@ diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ipt_ROUTE.h linux-2.6.19
+#define IPT_ROUTE_TEE 0x02
+
+#endif /*_IPT_ROUTE_H_target*/
-diff -urN linux-2.6.19.old/include/linux/netfilter_ipv6/ip6t_ROUTE.h linux-2.6.19.dev/include/linux/netfilter_ipv6/ip6t_ROUTE.h
---- linux-2.6.19.old/include/linux/netfilter_ipv6/ip6t_ROUTE.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/netfilter_ipv6/ip6t_ROUTE.h 2006-12-14 03:13:49.000000000 +0100
+diff -Nur linux-2.6.21.1/include/linux/netfilter_ipv6/ip6t_ROUTE.h linux-2.6.21.1-owrt/include/linux/netfilter_ipv6/ip6t_ROUTE.h
+--- linux-2.6.21.1/include/linux/netfilter_ipv6/ip6t_ROUTE.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/netfilter_ipv6/ip6t_ROUTE.h 2007-05-23 20:32:22.000000000 +0200
@@ -0,0 +1,23 @@
+/* Header file for iptables ip6t_ROUTE target
+ *
@@ -41,10 +41,10 @@ diff -urN linux-2.6.19.old/include/linux/netfilter_ipv6/ip6t_ROUTE.h linux-2.6.1
+#define IP6T_ROUTE_IFNAMSIZ 16
+
+struct ip6t_route_target_info {
-+ char oif[IP6T_ROUTE_IFNAMSIZ]; /* Output Interface Name */
-+ char iif[IP6T_ROUTE_IFNAMSIZ]; /* Input Interface Name */
-+ u_int32_t gw[4]; /* IPv6 address of gateway */
-+ u_int8_t flags;
++ char oif[IP6T_ROUTE_IFNAMSIZ]; /* Output Interface Name */
++ char iif[IP6T_ROUTE_IFNAMSIZ]; /* Input Interface Name */
++ u_int32_t gw[4]; /* IPv6 address of gateway */
++ u_int8_t flags;
+};
+
+/* Values for "flags" field */
@@ -52,10 +52,10 @@ diff -urN linux-2.6.19.old/include/linux/netfilter_ipv6/ip6t_ROUTE.h linux-2.6.1
+#define IP6T_ROUTE_TEE 0x02
+
+#endif /*_IP6T_ROUTE_H_target*/
-diff -urN linux-2.6.19.old/net/ipv4/netfilter/ipt_ROUTE.c linux-2.6.19.dev/net/ipv4/netfilter/ipt_ROUTE.c
---- linux-2.6.19.old/net/ipv4/netfilter/ipt_ROUTE.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/netfilter/ipt_ROUTE.c 2006-12-14 03:13:49.000000000 +0100
-@@ -0,0 +1,455 @@
+diff -Nur linux-2.6.21.1/net/ipv4/netfilter/ipt_ROUTE.c linux-2.6.21.1-owrt/net/ipv4/netfilter/ipt_ROUTE.c
+--- linux-2.6.21.1/net/ipv4/netfilter/ipt_ROUTE.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/net/ipv4/netfilter/ipt_ROUTE.c 2007-05-23 20:32:22.000000000 +0200
+@@ -0,0 +1,483 @@
+/*
+ * This implements the ROUTE target, which enables you to setup unusual
+ * routes not supported by the standard kernel routing table.
@@ -75,6 +75,7 @@ diff -urN linux-2.6.19.old/net/ipv4/netfilter/ipt_ROUTE.c linux-2.6.19.dev/net/i
+#include <linux/netfilter_ipv4/ipt_ROUTE.h>
+#include <linux/netdevice.h>
+#include <linux/route.h>
++#include <linux/version.h>
+#include <linux/if_arp.h>
+#include <net/ip.h>
+#include <net/route.h>
@@ -93,73 +94,73 @@ diff -urN linux-2.6.19.old/net/ipv4/netfilter/ipt_ROUTE.c linux-2.6.19.dev/net/i
+
+/* Try to route the packet according to the routing keys specified in
+ * route_info. Keys are :
-+ * - ifindex :
-+ * 0 if no oif preferred,
++ * - ifindex :
++ * 0 if no oif preferred,
+ * otherwise set to the index of the desired oif
+ * - route_info->gw :
+ * 0 if no gateway specified,
+ * otherwise set to the next host to which the pkt must be routed
-+ * If success, skb->dev is the output device to which the packet must
++ * If success, skb->dev is the output device to which the packet must
+ * be sent and skb->dst is not NULL
+ *
+ * RETURN: -1 if an error occured
-+ * 1 if the packet was succesfully routed to the
++ * 1 if the packet was succesfully routed to the
+ * destination desired
+ * 0 if the kernel routing table could not route the packet
+ * according to the keys specified
+ */
+static int route(struct sk_buff *skb,
-+ unsigned int ifindex,
-+ const struct ipt_route_target_info *route_info)
++ unsigned int ifindex,
++ const struct ipt_route_target_info *route_info)
+{
-+ int err;
-+ struct rtable *rt;
-+ struct iphdr *iph = skb->nh.iph;
-+ struct flowi fl = {
-+ .oif = ifindex,
-+ .nl_u = {
-+ .ip4_u = {
-+ .daddr = iph->daddr,
-+ .saddr = 0,
-+ .tos = RT_TOS(iph->tos),
-+ .scope = RT_SCOPE_UNIVERSE,
-+ }
-+ }
-+ };
-+
-+ /* The destination address may be overloaded by the target */
-+ if (route_info->gw)
-+ fl.fl4_dst = route_info->gw;
-+
-+ /* Trying to route the packet using the standard routing table. */
-+ if ((err = ip_route_output_key(&rt, &fl))) {
-+ if (net_ratelimit())
-+ DEBUGP("ipt_ROUTE: couldn't route pkt (err: %i)",err);
-+ return -1;
-+ }
-+
-+ /* Drop old route. */
-+ dst_release(skb->dst);
-+ skb->dst = NULL;
-+
-+ /* Success if no oif specified or if the oif correspond to the
-+ * one desired */
-+ if (!ifindex || rt->u.dst.dev->ifindex == ifindex) {
-+ skb->dst = &rt->u.dst;
-+ skb->dev = skb->dst->dev;
-+ skb->protocol = htons(ETH_P_IP);
-+ return 1;
-+ }
-+
-+ /* The interface selected by the routing table is not the one
-+ * specified by the user. This may happen because the dst address
-+ * is one of our own addresses.
-+ */
-+ if (net_ratelimit())
-+ DEBUGP("ipt_ROUTE: failed to route as desired gw=%u.%u.%u.%u oif=%i (got oif=%i)\n",
-+ NIPQUAD(route_info->gw), ifindex, rt->u.dst.dev->ifindex);
-+
-+ return 0;
++ int err;
++ struct rtable *rt;
++ struct iphdr *iph = skb->nh.iph;
++ struct flowi fl = {
++ .oif = ifindex,
++ .nl_u = {
++ .ip4_u = {
++ .daddr = iph->daddr,
++ .saddr = 0,
++ .tos = RT_TOS(iph->tos),
++ .scope = RT_SCOPE_UNIVERSE,
++ }
++ }
++ };
++
++ /* The destination address may be overloaded by the target */
++ if (route_info->gw)
++ fl.fl4_dst = route_info->gw;
++
++ /* Trying to route the packet using the standard routing table. */
++ if ((err = ip_route_output_key(&rt, &fl))) {
++ if (net_ratelimit())
++ DEBUGP("ipt_ROUTE: couldn't route pkt (err: %i)",err);
++ return -1;
++ }
++
++ /* Drop old route. */
++ dst_release(skb->dst);
++ skb->dst = NULL;
++
++ /* Success if no oif specified or if the oif correspond to the
++ * one desired */
++ if (!ifindex || rt->u.dst.dev->ifindex == ifindex) {
++ skb->dst = &rt->u.dst;
++ skb->dev = skb->dst->dev;
++ skb->protocol = htons(ETH_P_IP);
++ return 1;
++ }
++
++ /* The interface selected by the routing table is not the one
++ * specified by the user. This may happen because the dst address
++ * is one of our own addresses.
++ */
++ if (net_ratelimit())
++ DEBUGP("ipt_ROUTE: failed to route as desired gw=%u.%u.%u.%u oif=%i (got oif=%i)\n",
++ NIPQUAD(route_info->gw), ifindex, rt->u.dst.dev->ifindex);
++
++ return 0;
+}
+
+
@@ -171,158 +172,158 @@ diff -urN linux-2.6.19.old/net/ipv4/netfilter/ipt_ROUTE.c linux-2.6.19.dev/net/i
+ */
+static void ip_direct_send(struct sk_buff *skb)
+{
-+ struct dst_entry *dst = skb->dst;
-+ struct hh_cache *hh = dst->hh;
-+ struct net_device *dev = dst->dev;
-+ int hh_len = LL_RESERVED_SPACE(dev);
-+
-+ /* Be paranoid, rather than too clever. */
-+ if (unlikely(skb_headroom(skb) < hh_len && dev->hard_header)) {
-+ struct sk_buff *skb2;
-+
-+ skb2 = skb_realloc_headroom(skb, LL_RESERVED_SPACE(dev));
-+ if (skb2 == NULL) {
-+ kfree_skb(skb);
-+ return;
-+ }
-+ if (skb->sk)
-+ skb_set_owner_w(skb2, skb->sk);
-+ kfree_skb(skb);
-+ skb = skb2;
-+ }
-+
-+ if (hh) {
-+ int hh_alen;
-+
-+ read_lock_bh(&hh->hh_lock);
-+ hh_alen = HH_DATA_ALIGN(hh->hh_len);
-+ memcpy(skb->data - hh_alen, hh->hh_data, hh_alen);
-+ read_unlock_bh(&hh->hh_lock);
-+ skb_push(skb, hh->hh_len);
-+ hh->hh_output(skb);
-+ } else if (dst->neighbour)
-+ dst->neighbour->output(skb);
-+ else {
-+ if (net_ratelimit())
-+ DEBUGP(KERN_DEBUG "ipt_ROUTE: no hdr & no neighbour cache!\n");
-+ kfree_skb(skb);
-+ }
++ struct dst_entry *dst = skb->dst;
++ struct hh_cache *hh = dst->hh;
++ struct net_device *dev = dst->dev;
++ int hh_len = LL_RESERVED_SPACE(dev);
++
++ /* Be paranoid, rather than too clever. */
++ if (unlikely(skb_headroom(skb) < hh_len && dev->hard_header)) {
++ struct sk_buff *skb2;
++
++ skb2 = skb_realloc_headroom(skb, LL_RESERVED_SPACE(dev));
++ if (skb2 == NULL) {
++ kfree_skb(skb);
++ return;
++ }
++ if (skb->sk)
++ skb_set_owner_w(skb2, skb->sk);
++ kfree_skb(skb);
++ skb = skb2;
++ }
++
++ if (hh) {
++ int hh_alen;
++
++ read_lock_bh(&hh->hh_lock);
++ hh_alen = HH_DATA_ALIGN(hh->hh_len);
++ memcpy(skb->data - hh_alen, hh->hh_data, hh_alen);
++ read_unlock_bh(&hh->hh_lock);
++ skb_push(skb, hh->hh_len);
++ hh->hh_output(skb);
++ } else if (dst->neighbour)
++ dst->neighbour->output(skb);
++ else {
++ if (net_ratelimit())
++ DEBUGP(KERN_DEBUG "ipt_ROUTE: no hdr & no neighbour cache!\n");
++ kfree_skb(skb);
++ }
+}
+
+
+/* PRE : skb->dev is set to the device we are leaving by
-+ * POST: - the packet is directly sent to the skb->dev device, without
++ * POST: - the packet is directly sent to the skb->dev device, without
+ * pushing the link layer header.
+ * - the packet is destroyed
+ */
+static inline int dev_direct_send(struct sk_buff *skb)
+{
-+ return dev_queue_xmit(skb);
++ return dev_queue_xmit(skb);
+}
+
+
+static unsigned int route_oif(const struct ipt_route_target_info *route_info,
-+ struct sk_buff *skb)
++ struct sk_buff *skb)
+{
-+ unsigned int ifindex = 0;
-+ struct net_device *dev_out = NULL;
-+
-+ /* The user set the interface name to use.
-+ * Getting the current interface index.
-+ */
-+ if ((dev_out = dev_get_by_name(route_info->oif))) {
-+ ifindex = dev_out->ifindex;
-+ } else {
-+ /* Unknown interface name : packet dropped */
-+ if (net_ratelimit())
-+ DEBUGP("ipt_ROUTE: oif interface %s not found\n", route_info->oif);
-+ return NF_DROP;
-+ }
-+
-+ /* Trying the standard way of routing packets */
-+ switch (route(skb, ifindex, route_info)) {
-+ case 1:
-+ dev_put(dev_out);
-+ if (route_info->flags & IPT_ROUTE_CONTINUE)
-+ return IPT_CONTINUE;
-+
-+ ip_direct_send(skb);
-+ return NF_STOLEN;
-+
-+ case 0:
-+ /* Failed to send to oif. Trying the hard way */
-+ if (route_info->flags & IPT_ROUTE_CONTINUE)
-+ return NF_DROP;
-+
-+ if (net_ratelimit())
-+ DEBUGP("ipt_ROUTE: forcing the use of %i\n",
-+ ifindex);
-+
-+ /* We have to force the use of an interface.
-+ * This interface must be a tunnel interface since
-+ * otherwise we can't guess the hw address for
-+ * the packet. For a tunnel interface, no hw address
-+ * is needed.
-+ */
-+ if ((dev_out->type != ARPHRD_TUNNEL)
-+ && (dev_out->type != ARPHRD_IPGRE)) {
-+ if (net_ratelimit())
-+ DEBUGP("ipt_ROUTE: can't guess the hw addr !\n");
-+ dev_put(dev_out);
-+ return NF_DROP;
-+ }
-+
-+ /* Send the packet. This will also free skb
-+ * Do not go through the POST_ROUTING hook because
-+ * skb->dst is not set and because it will probably
-+ * get confused by the destination IP address.
-+ */
-+ skb->dev = dev_out;
-+ dev_direct_send(skb);
-+ dev_put(dev_out);
-+ return NF_STOLEN;
-+
-+ default:
-+ /* Unexpected error */
-+ dev_put(dev_out);
-+ return NF_DROP;
-+ }
++ unsigned int ifindex = 0;
++ struct net_device *dev_out = NULL;
++
++ /* The user set the interface name to use.
++ * Getting the current interface index.
++ */
++ if ((dev_out = dev_get_by_name(route_info->oif))) {
++ ifindex = dev_out->ifindex;
++ } else {
++ /* Unknown interface name : packet dropped */
++ if (net_ratelimit())
++ DEBUGP("ipt_ROUTE: oif interface %s not found\n", route_info->oif);
++ return NF_DROP;
++ }
++
++ /* Trying the standard way of routing packets */
++ switch (route(skb, ifindex, route_info)) {
++ case 1:
++ dev_put(dev_out);
++ if (route_info->flags & IPT_ROUTE_CONTINUE)
++ return IPT_CONTINUE;
++
++ ip_direct_send(skb);
++ return NF_STOLEN;
++
++ case 0:
++ /* Failed to send to oif. Trying the hard way */
++ if (route_info->flags & IPT_ROUTE_CONTINUE)
++ return NF_DROP;
++
++ if (net_ratelimit())
++ DEBUGP("ipt_ROUTE: forcing the use of %i\n",
++ ifindex);
++
++ /* We have to force the use of an interface.
++ * This interface must be a tunnel interface since
++ * otherwise we can't guess the hw address for
++ * the packet. For a tunnel interface, no hw address
++ * is needed.
++ */
++ if ((dev_out->type != ARPHRD_TUNNEL)
++ && (dev_out->type != ARPHRD_IPGRE)) {
++ if (net_ratelimit())
++ DEBUGP("ipt_ROUTE: can't guess the hw addr !\n");
++ dev_put(dev_out);
++ return NF_DROP;
++ }
++
++ /* Send the packet. This will also free skb
++ * Do not go through the POST_ROUTING hook because
++ * skb->dst is not set and because it will probably
++ * get confused by the destination IP address.
++ */
++ skb->dev = dev_out;
++ dev_direct_send(skb);
++ dev_put(dev_out);
++ return NF_STOLEN;
++
++ default:
++ /* Unexpected error */
++ dev_put(dev_out);
++ return NF_DROP;
++ }
+}
+
+
+static unsigned int route_iif(const struct ipt_route_target_info *route_info,
-+ struct sk_buff *skb)
++ struct sk_buff *skb)
+{
-+ struct net_device *dev_in = NULL;
-+
-+ /* Getting the current interface index. */
-+ if (!(dev_in = dev_get_by_name(route_info->iif))) {
-+ if (net_ratelimit())
-+ DEBUGP("ipt_ROUTE: iif interface %s not found\n", route_info->iif);
-+ return NF_DROP;
-+ }
-+
-+ skb->dev = dev_in;
-+ dst_release(skb->dst);
-+ skb->dst = NULL;
-+
-+ netif_rx(skb);
-+ dev_put(dev_in);
-+ return NF_STOLEN;
++ struct net_device *dev_in = NULL;
++
++ /* Getting the current interface index. */
++ if (!(dev_in = dev_get_by_name(route_info->iif))) {
++ if (net_ratelimit())
++ DEBUGP("ipt_ROUTE: iif interface %s not found\n", route_info->iif);
++ return NF_DROP;
++ }
++
++ skb->dev = dev_in;
++ dst_release(skb->dst);
++ skb->dst = NULL;
++
++ netif_rx(skb);
++ dev_put(dev_in);
++ return NF_STOLEN;
+}
+
+
+static unsigned int route_gw(const struct ipt_route_target_info *route_info,
-+ struct sk_buff *skb)
++ struct sk_buff *skb)
+{
-+ if (route(skb, 0, route_info)!=1)
-+ return NF_DROP;
++ if (route(skb, 0, route_info)!=1)
++ return NF_DROP;
+
-+ if (route_info->flags & IPT_ROUTE_CONTINUE)
-+ return IPT_CONTINUE;
++ if (route_info->flags & IPT_ROUTE_CONTINUE)
++ return IPT_CONTINUE;
+
-+ ip_direct_send(skb);
-+ return NF_STOLEN;
++ ip_direct_send(skb);
++ return NF_STOLEN;
+}
+
+
@@ -335,224 +336,250 @@ diff -urN linux-2.6.19.old/net/ipv4/netfilter/ipt_ROUTE.c linux-2.6.19.dev/net/i
+static struct ip_conntrack route_tee_track;
+
+static unsigned int ipt_route_target(struct sk_buff **pskb,
-+ const struct net_device *in,
-+ const struct net_device *out,
-+ unsigned int hooknum,
-+ const struct xt_target *target,
-+ const void *targinfo)
++ const struct net_device *in,
++ const struct net_device *out,
++ unsigned int hooknum,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
++ const struct xt_target *target,
++#endif
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
++ const void *targinfo,
++ void *userinfo)
++#else
++ const void *targinfo)
++#endif
+{
-+ const struct ipt_route_target_info *route_info = targinfo;
-+ struct sk_buff *skb = *pskb;
-+ unsigned int res;
-+
-+ if (skb->nfct == &route_tee_track.ct_general) {
-+ /* Loopback - a packet we already routed, is to be
-+ * routed another time. Avoid that, now.
-+ */
-+ if (net_ratelimit())
-+ DEBUGP(KERN_DEBUG "ipt_ROUTE: loopback - DROP!\n");
-+ return NF_DROP;
-+ }
-+
-+ /* If we are at PREROUTING or INPUT hook
-+ * the TTL isn't decreased by the IP stack
-+ */
-+ if (hooknum == NF_IP_PRE_ROUTING ||
-+ hooknum == NF_IP_LOCAL_IN) {
-+
-+ struct iphdr *iph = skb->nh.iph;
-+
-+ if (iph->ttl <= 1) {
-+ struct rtable *rt;
-+ struct flowi fl = {
-+ .oif = 0,
-+ .nl_u = {
-+ .ip4_u = {
-+ .daddr = iph->daddr,
-+ .saddr = iph->saddr,
-+ .tos = RT_TOS(iph->tos),
-+ .scope = ((iph->tos & RTO_ONLINK) ?
-+ RT_SCOPE_LINK :
-+ RT_SCOPE_UNIVERSE)
-+ }
-+ }
-+ };
-+
-+ if (ip_route_output_key(&rt, &fl)) {
-+ return NF_DROP;
-+ }
-+
-+ if (skb->dev == rt->u.dst.dev) {
-+ /* Drop old route. */
-+ dst_release(skb->dst);
-+ skb->dst = &rt->u.dst;
-+
-+ /* this will traverse normal stack, and
-+ * thus call conntrack on the icmp packet */
-+ icmp_send(skb, ICMP_TIME_EXCEEDED,
-+ ICMP_EXC_TTL, 0);
-+ }
-+
-+ return NF_DROP;
-+ }
-+
-+ /*
-+ * If we are at INPUT the checksum must be recalculated since
-+ * the length could change as the result of a defragmentation.
-+ */
-+ if(hooknum == NF_IP_LOCAL_IN) {
-+ iph->ttl = iph->ttl - 1;
-+ iph->check = 0;
-+ iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
-+ } else {
-+ ip_decrease_ttl(iph);
-+ }
-+ }
-+
-+ if ((route_info->flags & IPT_ROUTE_TEE)) {
-+ /*
-+ * Copy the *pskb, and route the copy. Will later return
-+ * IPT_CONTINUE for the original skb, which should continue
-+ * on its way as if nothing happened. The copy should be
-+ * independantly delivered to the ROUTE --gw.
-+ */
-+ skb = skb_copy(*pskb, GFP_ATOMIC);
-+ if (!skb) {
-+ if (net_ratelimit())
-+ DEBUGP(KERN_DEBUG "ipt_ROUTE: copy failed!\n");
-+ return IPT_CONTINUE;
-+ }
-+ }
-+
-+ /* Tell conntrack to forget this packet since it may get confused
-+ * when a packet is leaving with dst address == our address.
-+ * Good idea ? Dunno. Need advice.
-+ *
-+ * NEW: mark the skb with our &route_tee_track, so we avoid looping
-+ * on any already routed packet.
-+ */
-+ if (!(route_info->flags & IPT_ROUTE_CONTINUE)) {
-+ nf_conntrack_put(skb->nfct);
-+ skb->nfct = &route_tee_track.ct_general;
-+ skb->nfctinfo = IP_CT_NEW;
-+ nf_conntrack_get(skb->nfct);
-+ }
-+
-+ if (route_info->oif[0] != '\0') {
-+ res = route_oif(route_info, skb);
-+ } else if (route_info->iif[0] != '\0') {
-+ res = route_iif(route_info, skb);
-+ } else if (route_info->gw) {
-+ res = route_gw(route_info, skb);
-+ } else {
-+ if (net_ratelimit())
-+ DEBUGP(KERN_DEBUG "ipt_ROUTE: no parameter !\n");
-+ res = IPT_CONTINUE;
-+ }
-+
-+ if ((route_info->flags & IPT_ROUTE_TEE))
-+ res = IPT_CONTINUE;
-+
-+ return res;
++ const struct ipt_route_target_info *route_info = targinfo;
++ struct sk_buff *skb = *pskb;
++ unsigned int res;
++
++ if (skb->nfct == &route_tee_track.ct_general) {
++ /* Loopback - a packet we already routed, is to be
++ * routed another time. Avoid that, now.
++ */
++ if (net_ratelimit())
++ DEBUGP(KERN_DEBUG "ipt_ROUTE: loopback - DROP!\n");
++ return NF_DROP;
++ }
++
++ /* If we are at PREROUTING or INPUT hook
++ * the TTL isn't decreased by the IP stack
++ */
++ if (hooknum == NF_IP_PRE_ROUTING ||
++ hooknum == NF_IP_LOCAL_IN) {
++
++ struct iphdr *iph = skb->nh.iph;
++
++ if (iph->ttl <= 1) {
++ struct rtable *rt;
++ struct flowi fl = {
++ .oif = 0,
++ .nl_u = {
++ .ip4_u = {
++ .daddr = iph->daddr,
++ .saddr = iph->saddr,
++ .tos = RT_TOS(iph->tos),
++ .scope = ((iph->tos & RTO_ONLINK) ?
++ RT_SCOPE_LINK :
++ RT_SCOPE_UNIVERSE)
++ }
++ }
++ };
++
++ if (ip_route_output_key(&rt, &fl)) {
++ return NF_DROP;
++ }
++
++ if (skb->dev == rt->u.dst.dev) {
++ /* Drop old route. */
++ dst_release(skb->dst);
++ skb->dst = &rt->u.dst;
++
++ /* this will traverse normal stack, and
++ * thus call conntrack on the icmp packet */
++ icmp_send(skb, ICMP_TIME_EXCEEDED,
++ ICMP_EXC_TTL, 0);
++ }
++
++ return NF_DROP;
++ }
++
++ /*
++ * If we are at INPUT the checksum must be recalculated since
++ * the length could change as the result of a defragmentation.
++ */
++ if(hooknum == NF_IP_LOCAL_IN) {
++ iph->ttl = iph->ttl - 1;
++ iph->check = 0;
++ iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
++ } else {
++ ip_decrease_ttl(iph);
++ }
++ }
++
++ if ((route_info->flags & IPT_ROUTE_TEE)) {
++ /*
++ * Copy the *pskb, and route the copy. Will later return
++ * IPT_CONTINUE for the original skb, which should continue
++ * on its way as if nothing happened. The copy should be
++ * independantly delivered to the ROUTE --gw.
++ */
++ skb = skb_copy(*pskb, GFP_ATOMIC);
++ if (!skb) {
++ if (net_ratelimit())
++ DEBUGP(KERN_DEBUG "ipt_ROUTE: copy failed!\n");
++ return IPT_CONTINUE;
++ }
++ }
++
++ /* Tell conntrack to forget this packet since it may get confused
++ * when a packet is leaving with dst address == our address.
++ * Good idea ? Dunno. Need advice.
++ *
++ * NEW: mark the skb with our &route_tee_track, so we avoid looping
++ * on any already routed packet.
++ */
++ if (!(route_info->flags & IPT_ROUTE_CONTINUE)) {
++ nf_conntrack_put(skb->nfct);
++ skb->nfct = &route_tee_track.ct_general;
++ skb->nfctinfo = IP_CT_NEW;
++ nf_conntrack_get(skb->nfct);
++ }
++
++ if (route_info->oif[0] != '\0') {
++ res = route_oif(route_info, skb);
++ } else if (route_info->iif[0] != '\0') {
++ res = route_iif(route_info, skb);
++ } else if (route_info->gw) {
++ res = route_gw(route_info, skb);
++ } else {
++ if (net_ratelimit())
++ DEBUGP(KERN_DEBUG "ipt_ROUTE: no parameter !\n");
++ res = IPT_CONTINUE;
++ }
++
++ if ((route_info->flags & IPT_ROUTE_TEE))
++ res = IPT_CONTINUE;
++
++ return res;
+}
+
+
+static int ipt_route_checkentry(const char *tablename,
-+ const void *e,
-+ const struct xt_target *target,
-+ void *targinfo,
-+ unsigned int hook_mask)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
++ const void *e,
++#else
++ const struct ipt_ip *ip,
++#endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
++ const struct xt_target *target,
++#endif
++ void *targinfo,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
++ unsigned int targinfosize,
++#endif
++ unsigned int hook_mask)
+{
-+ if (strcmp(tablename, "mangle") != 0) {
-+ printk("ipt_ROUTE: bad table `%s', use the `mangle' table.\n",
-+ tablename);
-+ return 0;
-+ }
-+
-+ if (hook_mask & ~( (1 << NF_IP_PRE_ROUTING)
-+ | (1 << NF_IP_LOCAL_IN)
-+ | (1 << NF_IP_FORWARD)
-+ | (1 << NF_IP_LOCAL_OUT)
-+ | (1 << NF_IP_POST_ROUTING))) {
-+ printk("ipt_ROUTE: bad hook\n");
-+ return 0;
-+ }
-+
-+ return 1;
++ if (strcmp(tablename, "mangle") != 0) {
++ printk("ipt_ROUTE: bad table `%s', use the `mangle' table.\n",
++ tablename);
++ return 0;
++ }
++
++ if (hook_mask & ~( (1 << NF_IP_PRE_ROUTING)
++ | (1 << NF_IP_LOCAL_IN)
++ | (1 << NF_IP_FORWARD)
++ | (1 << NF_IP_LOCAL_OUT)
++ | (1 << NF_IP_POST_ROUTING))) {
++ printk("ipt_ROUTE: bad hook\n");
++ return 0;
++ }
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
++ if (targinfosize != IPT_ALIGN(sizeof(struct ipt_route_target_info))) {
++ printk(KERN_WARNING "ipt_ROUTE: targinfosize %u != %Zu\n",
++ targinfosize,
++ IPT_ALIGN(sizeof(struct ipt_route_target_info)));
++ return 0;
++ }
++#endif
++
++ return 1;
+}
+
+
-+static struct ipt_target ipt_route_reg = {
-+ .name = "ROUTE",
-+ .target = ipt_route_target,
-+ .targetsize = sizeof(struct ipt_route_target_info),
-+ .checkentry = ipt_route_checkentry,
-+ .me = THIS_MODULE,
++static struct ipt_target ipt_route_reg = {
++ .name = "ROUTE",
++ .target = ipt_route_target,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
++ .targetsize = sizeof(struct ipt_route_target_info),
++#endif
++ .checkentry = ipt_route_checkentry,
++ .me = THIS_MODULE,
+};
+
+static int __init init(void)
+{
-+ /* Set up fake conntrack (stolen from raw.patch):
-+ - to never be deleted, not in any hashes */
-+ atomic_set(&route_tee_track.ct_general.use, 1);
-+ /* - and look it like as a confirmed connection */
-+ set_bit(IPS_CONFIRMED_BIT, &route_tee_track.status);
-+ /* Initialize fake conntrack so that NAT will skip it */
-+ route_tee_track.status |= IPS_NAT_DONE_MASK;
-+
-+ return ipt_register_target(&ipt_route_reg);
++ /* Set up fake conntrack (stolen from raw.patch):
++ - to never be deleted, not in any hashes */
++ atomic_set(&route_tee_track.ct_general.use, 1);
++ /* - and look it like as a confirmed connection */
++ set_bit(IPS_CONFIRMED_BIT, &route_tee_track.status);
++ /* Initialize fake conntrack so that NAT will skip it */
++ route_tee_track.status |= IPS_NAT_DONE_MASK;
++
++ return xt_register_target(&ipt_route_reg);
+}
+
+
+static void __exit fini(void)
+{
-+ ipt_unregister_target(&ipt_route_reg);
++ xt_unregister_target(&ipt_route_reg);
+}
+
+module_init(init);
+module_exit(fini);
-diff -urN linux-2.6.19.old/net/ipv4/netfilter/Kconfig linux-2.6.19.dev/net/ipv4/netfilter/Kconfig
---- linux-2.6.19.old/net/ipv4/netfilter/Kconfig 2006-12-14 03:13:49.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/netfilter/Kconfig 2006-12-14 03:13:49.000000000 +0100
-@@ -494,6 +494,23 @@
-
- To compile it as a module, choose M here. If unsure, say N.
+diff -Nur linux-2.6.21.1/net/ipv4/netfilter/Kconfig linux-2.6.21.1-owrt/net/ipv4/netfilter/Kconfig
+--- linux-2.6.21.1/net/ipv4/netfilter/Kconfig 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1-owrt/net/ipv4/netfilter/Kconfig 2007-05-23 20:32:22.000000000 +0200
+@@ -657,5 +657,22 @@
+ Allows altering the ARP packet payload: source and destination
+ hardware and network addresses.
+config IP_NF_TARGET_ROUTE
-+ tristate 'ROUTE target support'
-+ depends on IP_NF_MANGLE
-+ help
-+ This option adds a `ROUTE' target, which enables you to setup unusual
-+ routes. For example, the ROUTE lets you route a received packet through
-+ an interface or towards a host, even if the regular destination of the
-+ packet is the router itself. The ROUTE target is also able to change the
-+ incoming interface of a packet.
-+
-+ The target can be or not a final target. It has to be used inside the
-+ mangle table.
-+
-+ If you want to compile it as a module, say M here and read
-+ Documentation/modules.txt. The module will be called ipt_ROUTE.o.
-+ If unsure, say `N'.
-+
- config IP_NF_TARGET_NETMAP
- tristate "NETMAP target support"
- depends on IP_NF_NAT
-diff -urN linux-2.6.19.old/net/ipv4/netfilter/Makefile linux-2.6.19.dev/net/ipv4/netfilter/Makefile
---- linux-2.6.19.old/net/ipv4/netfilter/Makefile 2006-12-14 03:13:49.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/netfilter/Makefile 2006-12-14 03:13:49.000000000 +0100
-@@ -74,6 +74,7 @@
- obj-$(CONFIG_IP_NF_TARGET_IMQ) += ipt_IMQ.o
++ tristate 'ROUTE target support'
++ depends on IP_NF_MANGLE
++ help
++ This option adds a `ROUTE' target, which enables you to setup unusual
++ routes. For example, the ROUTE lets you route a received packet through
++ an interface or towards a host, even if the regular destination of the
++ packet is the router itself. The ROUTE target is also able to change the
++ incoming interface of a packet.
++
++ The target can be or not a final target. It has to be used inside the
++ mangle table.
++
++ If you want to compile it as a module, say M here and read
++ Documentation/modules.txt. The module will be called ipt_ROUTE.o.
++ If unsure, say `N'.
++
+ endmenu
+
+diff -Nur linux-2.6.21.1/net/ipv4/netfilter/Makefile linux-2.6.21.1-owrt/net/ipv4/netfilter/Makefile
+--- linux-2.6.21.1/net/ipv4/netfilter/Makefile 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1-owrt/net/ipv4/netfilter/Makefile 2007-05-23 20:32:22.000000000 +0200
+@@ -98,6 +98,7 @@
+ obj-$(CONFIG_IP_NF_TARGET_ECN) += ipt_ECN.o
obj-$(CONFIG_IP_NF_TARGET_MASQUERADE) += ipt_MASQUERADE.o
obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o
+obj-$(CONFIG_IP_NF_TARGET_ROUTE) += ipt_ROUTE.o
obj-$(CONFIG_IP_NF_TARGET_NETMAP) += ipt_NETMAP.o
obj-$(CONFIG_IP_NF_TARGET_SAME) += ipt_SAME.o
obj-$(CONFIG_IP_NF_NAT_SNMP_BASIC) += ip_nat_snmp_basic.o
-diff -urN linux-2.6.19.old/net/ipv6/ipv6_syms.c linux-2.6.19.dev/net/ipv6/ipv6_syms.c
---- linux-2.6.19.old/net/ipv6/ipv6_syms.c 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv6/ipv6_syms.c 2006-12-14 03:13:49.000000000 +0100
-@@ -11,6 +11,7 @@
+diff -Nur linux-2.6.21.1/net/ipv6/ipv6_syms.c linux-2.6.21.1-owrt/net/ipv6/ipv6_syms.c
+--- linux-2.6.21.1/net/ipv6/ipv6_syms.c 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1-owrt/net/ipv6/ipv6_syms.c 2007-05-23 20:32:22.000000000 +0200
+@@ -10,6 +10,7 @@
EXPORT_SYMBOL(icmpv6_statistics);
EXPORT_SYMBOL(icmpv6_err_convert);
EXPORT_SYMBOL(ndisc_mc_map);
@@ -560,10 +587,10 @@ diff -urN linux-2.6.19.old/net/ipv6/ipv6_syms.c linux-2.6.19.dev/net/ipv6/ipv6_s
EXPORT_SYMBOL(register_inet6addr_notifier);
EXPORT_SYMBOL(unregister_inet6addr_notifier);
EXPORT_SYMBOL(ip6_route_output);
-diff -urN linux-2.6.19.old/net/ipv6/netfilter/ip6t_ROUTE.c linux-2.6.19.dev/net/ipv6/netfilter/ip6t_ROUTE.c
---- linux-2.6.19.old/net/ipv6/netfilter/ip6t_ROUTE.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv6/netfilter/ip6t_ROUTE.c 2006-12-14 03:13:49.000000000 +0100
-@@ -0,0 +1,302 @@
+diff -Nur linux-2.6.21.1/net/ipv6/netfilter/ip6t_ROUTE.c linux-2.6.21.1-owrt/net/ipv6/netfilter/ip6t_ROUTE.c
+--- linux-2.6.21.1/net/ipv6/netfilter/ip6t_ROUTE.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/net/ipv6/netfilter/ip6t_ROUTE.c 2007-05-23 20:32:22.000000000 +0200
+@@ -0,0 +1,330 @@
+/*
+ * This implements the ROUTE v6 target, which enables you to setup unusual
+ * routes not supported by the standard kernel routing table.
@@ -581,6 +608,7 @@ diff -urN linux-2.6.19.old/net/ipv6/netfilter/ip6t_ROUTE.c linux-2.6.19.dev/net/
+#include <linux/netfilter_ipv6/ip6_tables.h>
+#include <linux/netfilter_ipv6/ip6t_ROUTE.h>
+#include <linux/netdevice.h>
++#include <linux/version.h>
+#include <net/ipv6.h>
+#include <net/ndisc.h>
+#include <net/ip6_route.h>
@@ -593,85 +621,85 @@ diff -urN linux-2.6.19.old/net/ipv6/netfilter/ip6t_ROUTE.c linux-2.6.19.dev/net/
+#endif
+
+#define NIP6(addr) \
-+ ntohs((addr).s6_addr16[0]), \
-+ ntohs((addr).s6_addr16[1]), \
-+ ntohs((addr).s6_addr16[2]), \
-+ ntohs((addr).s6_addr16[3]), \
-+ ntohs((addr).s6_addr16[4]), \
-+ ntohs((addr).s6_addr16[5]), \
-+ ntohs((addr).s6_addr16[6]), \
-+ ntohs((addr).s6_addr16[7])
++ ntohs((addr).s6_addr16[0]), \
++ ntohs((addr).s6_addr16[1]), \
++ ntohs((addr).s6_addr16[2]), \
++ ntohs((addr).s6_addr16[3]), \
++ ntohs((addr).s6_addr16[4]), \
++ ntohs((addr).s6_addr16[5]), \
++ ntohs((addr).s6_addr16[6]), \
++ ntohs((addr).s6_addr16[7])
+
+/* Route the packet according to the routing keys specified in
+ * route_info. Keys are :
-+ * - ifindex :
-+ * 0 if no oif preferred,
++ * - ifindex :
++ * 0 if no oif preferred,
+ * otherwise set to the index of the desired oif
+ * - route_info->gw :
+ * 0 if no gateway specified,
+ * otherwise set to the next host to which the pkt must be routed
-+ * If success, skb->dev is the output device to which the packet must
++ * If success, skb->dev is the output device to which the packet must
+ * be sent and skb->dst is not NULL
+ *
-+ * RETURN: 1 if the packet was succesfully routed to the
++ * RETURN: 1 if the packet was succesfully routed to the
+ * destination desired
+ * 0 if the kernel routing table could not route the packet
+ * according to the keys specified
+ */
-+static int
++static int
+route6(struct sk_buff *skb,
+ unsigned int ifindex,
+ const struct ip6t_route_target_info *route_info)
+{
-+ struct rt6_info *rt = NULL;
-+ struct ipv6hdr *ipv6h = skb->nh.ipv6h;
-+ struct in6_addr *gw = (struct in6_addr*)&route_info->gw;
-+
-+ DEBUGP("ip6t_ROUTE: called with: ");
-+ DEBUGP("DST=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ", NIP6(ipv6h->daddr));
-+ DEBUGP("GATEWAY=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ", NIP6(*gw));
-+ DEBUGP("OUT=%s\n", route_info->oif);
-+
-+ if (ipv6_addr_any(gw))
-+ rt = rt6_lookup(&ipv6h->daddr, &ipv6h->saddr, ifindex, 1);
-+ else
-+ rt = rt6_lookup(gw, &ipv6h->saddr, ifindex, 1);
-+
-+ if (!rt)
-+ goto no_route;
-+
-+ DEBUGP("ip6t_ROUTE: routing gives: ");
-+ DEBUGP("DST=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ", NIP6(rt->rt6i_dst.addr));
-+ DEBUGP("GATEWAY=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ", NIP6(rt->rt6i_gateway));
-+ DEBUGP("OUT=%s\n", rt->rt6i_dev->name);
-+
-+ if (ifindex && rt->rt6i_dev->ifindex!=ifindex)
-+ goto wrong_route;
-+
-+ if (!rt->rt6i_nexthop) {
-+ DEBUGP("ip6t_ROUTE: discovering neighbour\n");
-+ rt->rt6i_nexthop = ndisc_get_neigh(rt->rt6i_dev, &rt->rt6i_dst.addr);
-+ }
-+
-+ /* Drop old route. */
-+ dst_release(skb->dst);
-+ skb->dst = &rt->u.dst;
-+ skb->dev = rt->rt6i_dev;
-+ return 1;
++ struct rt6_info *rt = NULL;
++ struct ipv6hdr *ipv6h = skb->nh.ipv6h;
++ struct in6_addr *gw = (struct in6_addr*)&route_info->gw;
++
++ DEBUGP("ip6t_ROUTE: called with: ");
++ DEBUGP("DST=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ", NIP6(ipv6h->daddr));
++ DEBUGP("GATEWAY=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ", NIP6(*gw));
++ DEBUGP("OUT=%s\n", route_info->oif);
++
++ if (ipv6_addr_any(gw))
++ rt = rt6_lookup(&ipv6h->daddr, &ipv6h->saddr, ifindex, 1);
++ else
++ rt = rt6_lookup(gw, &ipv6h->saddr, ifindex, 1);
++
++ if (!rt)
++ goto no_route;
++
++ DEBUGP("ip6t_ROUTE: routing gives: ");
++ DEBUGP("DST=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ", NIP6(rt->rt6i_dst.addr));
++ DEBUGP("GATEWAY=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ", NIP6(rt->rt6i_gateway));
++ DEBUGP("OUT=%s\n", rt->rt6i_dev->name);
++
++ if (ifindex && rt->rt6i_dev->ifindex!=ifindex)
++ goto wrong_route;
++
++ if (!rt->rt6i_nexthop) {
++ DEBUGP("ip6t_ROUTE: discovering neighbour\n");
++ rt->rt6i_nexthop = ndisc_get_neigh(rt->rt6i_dev, &rt->rt6i_dst.addr);
++ }
++
++ /* Drop old route. */
++ dst_release(skb->dst);
++ skb->dst = &rt->u.dst;
++ skb->dev = rt->rt6i_dev;
++ return 1;
+
+ wrong_route:
-+ dst_release(&rt->u.dst);
++ dst_release(&rt->u.dst);
+ no_route:
-+ if (!net_ratelimit())
-+ return 0;
-+
-+ printk("ip6t_ROUTE: no explicit route found ");
-+ if (ifindex)
-+ printk("via interface %s ", route_info->oif);
-+ if (!ipv6_addr_any(gw))
-+ printk("via gateway %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x", NIP6(*gw));
-+ printk("\n");
-+ return 0;
++ if (!net_ratelimit())
++ return 0;
++
++ printk("ip6t_ROUTE: no explicit route found ");
++ if (ifindex)
++ printk("via interface %s ", route_info->oif);
++ if (!ipv6_addr_any(gw))
++ printk("via gateway %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x", NIP6(*gw));
++ printk("\n");
++ return 0;
+}
+
+
@@ -683,220 +711,246 @@ diff -urN linux-2.6.19.old/net/ipv6/netfilter/ip6t_ROUTE.c linux-2.6.19.dev/net/
+ */
+static void ip_direct_send(struct sk_buff *skb)
+{
-+ struct dst_entry *dst = skb->dst;
-+ struct hh_cache *hh = dst->hh;
-+
-+ if (hh) {
-+ read_lock_bh(&hh->hh_lock);
-+ memcpy(skb->data - 16, hh->hh_data, 16);
-+ read_unlock_bh(&hh->hh_lock);
-+ skb_push(skb, hh->hh_len);
-+ hh->hh_output(skb);
-+ } else if (dst->neighbour)
-+ dst->neighbour->output(skb);
-+ else {
-+ if (net_ratelimit())
-+ DEBUGP(KERN_DEBUG "ip6t_ROUTE: no hdr & no neighbour cache!\n");
-+ kfree_skb(skb);
-+ }
++ struct dst_entry *dst = skb->dst;
++ struct hh_cache *hh = dst->hh;
++
++ if (hh) {
++ read_lock_bh(&hh->hh_lock);
++ memcpy(skb->data - 16, hh->hh_data, 16);
++ read_unlock_bh(&hh->hh_lock);
++ skb_push(skb, hh->hh_len);
++ hh->hh_output(skb);
++ } else if (dst->neighbour)
++ dst->neighbour->output(skb);
++ else {
++ if (net_ratelimit())
++ DEBUGP(KERN_DEBUG "ip6t_ROUTE: no hdr & no neighbour cache!\n");
++ kfree_skb(skb);
++ }
+}
+
+
-+static unsigned int
++static unsigned int
+route6_oif(const struct ip6t_route_target_info *route_info,
-+ struct sk_buff *skb)
++ struct sk_buff *skb)
+{
-+ unsigned int ifindex = 0;
-+ struct net_device *dev_out = NULL;
-+
-+ /* The user set the interface name to use.
-+ * Getting the current interface index.
-+ */
-+ if ((dev_out = dev_get_by_name(route_info->oif))) {
-+ ifindex = dev_out->ifindex;
-+ } else {
-+ /* Unknown interface name : packet dropped */
-+ if (net_ratelimit())
-+ DEBUGP("ip6t_ROUTE: oif interface %s not found\n", route_info->oif);
-+
-+ if (route_info->flags & IP6T_ROUTE_CONTINUE)
-+ return IP6T_CONTINUE;
-+ else
-+ return NF_DROP;
-+ }
-+
-+ /* Trying the standard way of routing packets */
-+ if (route6(skb, ifindex, route_info)) {
-+ dev_put(dev_out);
-+ if (route_info->flags & IP6T_ROUTE_CONTINUE)
-+ return IP6T_CONTINUE;
-+
-+ ip_direct_send(skb);
-+ return NF_STOLEN;
-+ } else
-+ return NF_DROP;
++ unsigned int ifindex = 0;
++ struct net_device *dev_out = NULL;
++
++ /* The user set the interface name to use.
++ * Getting the current interface index.
++ */
++ if ((dev_out = dev_get_by_name(route_info->oif))) {
++ ifindex = dev_out->ifindex;
++ } else {
++ /* Unknown interface name : packet dropped */
++ if (net_ratelimit())
++ DEBUGP("ip6t_ROUTE: oif interface %s not found\n", route_info->oif);
++
++ if (route_info->flags & IP6T_ROUTE_CONTINUE)
++ return IP6T_CONTINUE;
++ else
++ return NF_DROP;
++ }
++
++ /* Trying the standard way of routing packets */
++ if (route6(skb, ifindex, route_info)) {
++ dev_put(dev_out);
++ if (route_info->flags & IP6T_ROUTE_CONTINUE)
++ return IP6T_CONTINUE;
++
++ ip_direct_send(skb);
++ return NF_STOLEN;
++ } else
++ return NF_DROP;
+}
+
+
-+static unsigned int
++static unsigned int
+route6_gw(const struct ip6t_route_target_info *route_info,
-+ struct sk_buff *skb)
++ struct sk_buff *skb)
+{
-+ if (route6(skb, 0, route_info)) {
-+ if (route_info->flags & IP6T_ROUTE_CONTINUE)
-+ return IP6T_CONTINUE;
-+
-+ ip_direct_send(skb);
-+ return NF_STOLEN;
-+ } else
-+ return NF_DROP;
++ if (route6(skb, 0, route_info)) {
++ if (route_info->flags & IP6T_ROUTE_CONTINUE)
++ return IP6T_CONTINUE;
++
++ ip_direct_send(skb);
++ return NF_STOLEN;
++ } else
++ return NF_DROP;
+}
+
+
-+static unsigned int
++static unsigned int
+ip6t_route_target(struct sk_buff **pskb,
-+ const struct net_device *in,
-+ const struct net_device *out,
-+ unsigned int hooknum,
-+ const struct xt_target *target,
-+ const void *targinfo)
++ const struct net_device *in,
++ const struct net_device *out,
++ unsigned int hooknum,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
++ const struct xt_target *target,
++#endif
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
++ const void *targinfo,
++ void *userinfo)
++#else
++ const void *targinfo)
++#endif
+{
-+ const struct ip6t_route_target_info *route_info = targinfo;
-+ struct sk_buff *skb = *pskb;
-+ struct in6_addr *gw = (struct in6_addr*)&route_info->gw;
-+ unsigned int res;
-+
-+ if (route_info->flags & IP6T_ROUTE_CONTINUE)
-+ goto do_it;
-+
-+ /* If we are at PREROUTING or INPUT hook
-+ * the TTL isn't decreased by the IP stack
-+ */
-+ if (hooknum == NF_IP6_PRE_ROUTING ||
-+ hooknum == NF_IP6_LOCAL_IN) {
-+
-+ struct ipv6hdr *ipv6h = skb->nh.ipv6h;
-+
-+ if (ipv6h->hop_limit <= 1) {
-+ /* Force OUTPUT device used as source address */
-+ skb->dev = skb->dst->dev;
-+
-+ icmpv6_send(skb, ICMPV6_TIME_EXCEED,
-+ ICMPV6_EXC_HOPLIMIT, 0, skb->dev);
-+
-+ return NF_DROP;
-+ }
-+
-+ ipv6h->hop_limit--;
-+ }
-+
-+ if ((route_info->flags & IP6T_ROUTE_TEE)) {
-+ /*
-+ * Copy the *pskb, and route the copy. Will later return
-+ * IP6T_CONTINUE for the original skb, which should continue
-+ * on its way as if nothing happened. The copy should be
-+ * independantly delivered to the ROUTE --gw.
-+ */
-+ skb = skb_copy(*pskb, GFP_ATOMIC);
-+ if (!skb) {
-+ if (net_ratelimit())
-+ DEBUGP(KERN_DEBUG "ip6t_ROUTE: copy failed!\n");
-+ return IP6T_CONTINUE;
-+ }
-+ }
++ const struct ip6t_route_target_info *route_info = targinfo;
++ struct sk_buff *skb = *pskb;
++ struct in6_addr *gw = (struct in6_addr*)&route_info->gw;
++ unsigned int res;
++
++ if (route_info->flags & IP6T_ROUTE_CONTINUE)
++ goto do_it;
++
++ /* If we are at PREROUTING or INPUT hook
++ * the TTL isn't decreased by the IP stack
++ */
++ if (hooknum == NF_IP6_PRE_ROUTING ||
++ hooknum == NF_IP6_LOCAL_IN) {
++
++ struct ipv6hdr *ipv6h = skb->nh.ipv6h;
++
++ if (ipv6h->hop_limit <= 1) {
++ /* Force OUTPUT device used as source address */
++ skb->dev = skb->dst->dev;
++
++ icmpv6_send(skb, ICMPV6_TIME_EXCEED,
++ ICMPV6_EXC_HOPLIMIT, 0, skb->dev);
++
++ return NF_DROP;
++ }
++
++ ipv6h->hop_limit--;
++ }
++
++ if ((route_info->flags & IP6T_ROUTE_TEE)) {
++ /*
++ * Copy the *pskb, and route the copy. Will later return
++ * IP6T_CONTINUE for the original skb, which should continue
++ * on its way as if nothing happened. The copy should be
++ * independantly delivered to the ROUTE --gw.
++ */
++ skb = skb_copy(*pskb, GFP_ATOMIC);
++ if (!skb) {
++ if (net_ratelimit())
++ DEBUGP(KERN_DEBUG "ip6t_ROUTE: copy failed!\n");
++ return IP6T_CONTINUE;
++ }
++ }
+
+do_it:
-+ if (route_info->oif[0]) {
-+ res = route6_oif(route_info, skb);
-+ } else if (!ipv6_addr_any(gw)) {
-+ res = route6_gw(route_info, skb);
-+ } else {
-+ if (net_ratelimit())
-+ DEBUGP(KERN_DEBUG "ip6t_ROUTE: no parameter !\n");
-+ res = IP6T_CONTINUE;
-+ }
-+
-+ if ((route_info->flags & IP6T_ROUTE_TEE))
-+ res = IP6T_CONTINUE;
-+
-+ return res;
++ if (route_info->oif[0]) {
++ res = route6_oif(route_info, skb);
++ } else if (!ipv6_addr_any(gw)) {
++ res = route6_gw(route_info, skb);
++ } else {
++ if (net_ratelimit())
++ DEBUGP(KERN_DEBUG "ip6t_ROUTE: no parameter !\n");
++ res = IP6T_CONTINUE;
++ }
++
++ if ((route_info->flags & IP6T_ROUTE_TEE))
++ res = IP6T_CONTINUE;
++
++ return res;
+}
+
+
-+static int
++static int
+ip6t_route_checkentry(const char *tablename,
-+ const void *e,
-+ const struct xt_target *target,
-+ void *targinfo,
-+ unsigned int hook_mask)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
++ const void *entry,
++#else
++ const struct ip6t_entry *entry
++#endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
++ const struct xt_target *target,
++#endif
++ void *targinfo,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
++ unsigned int targinfosize,
++#endif
++ unsigned int hook_mask)
+{
-+ if (strcmp(tablename, "mangle") != 0) {
-+ printk("ip6t_ROUTE: can only be called from \"mangle\" table.\n");
-+ return 0;
-+ }
++ if (strcmp(tablename, "mangle") != 0) {
++ printk("ip6t_ROUTE: can only be called from \"mangle\" table.\n");
++ return 0;
++ }
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
++ if (targinfosize != IP6T_ALIGN(sizeof(struct ip6t_route_target_info))) {
++ printk(KERN_WARNING "ip6t_ROUTE: targinfosize %u != %Zu\n",
++ targinfosize,
++ IP6T_ALIGN(sizeof(struct ip6t_route_target_info)));
++ return 0;
++ }
++#endif
+
-+ return 1;
++ return 1;
+}
+
+
+static struct ip6t_target ip6t_route_reg = {
-+ .name = "ROUTE",
-+ .target = ip6t_route_target,
-+ .targetsize = sizeof(struct ip6t_route_target_info),
-+ .checkentry = ip6t_route_checkentry,
-+ .me = THIS_MODULE
++ .name = "ROUTE",
++ .target = ip6t_route_target,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
++ .targetsize = sizeof(struct ip6t_route_target_info),
++#endif
++ .checkentry = ip6t_route_checkentry,
++ .me = THIS_MODULE
+};
+
+
+static int __init init(void)
+{
-+ printk(KERN_DEBUG "registering ipv6 ROUTE target\n");
-+ if (ip6t_register_target(&ip6t_route_reg))
-+ return -EINVAL;
++ printk(KERN_DEBUG "registering ipv6 ROUTE target\n");
++ if (ip6t_register_target(&ip6t_route_reg))
++ return -EINVAL;
+
-+ return 0;
++ return 0;
+}
+
+
+static void __exit fini(void)
+{
-+ ip6t_unregister_target(&ip6t_route_reg);
++ ip6t_unregister_target(&ip6t_route_reg);
+}
+
+module_init(init);
+module_exit(fini);
+MODULE_LICENSE("GPL");
-diff -urN linux-2.6.19.old/net/ipv6/netfilter/Kconfig linux-2.6.19.dev/net/ipv6/netfilter/Kconfig
---- linux-2.6.19.old/net/ipv6/netfilter/Kconfig 2006-12-14 03:13:49.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv6/netfilter/Kconfig 2006-12-14 03:13:49.000000000 +0100
-@@ -162,6 +162,19 @@
-
- To compile it as a module, choose M here. If unsure, say N.
+diff -Nur linux-2.6.21.1/net/ipv6/netfilter/Kconfig linux-2.6.21.1-owrt/net/ipv6/netfilter/Kconfig
+--- linux-2.6.21.1/net/ipv6/netfilter/Kconfig 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1-owrt/net/ipv6/netfilter/Kconfig 2007-05-23 20:32:22.000000000 +0200
+@@ -200,5 +200,18 @@
+ If you want to compile it as a module, say M here and read
+ <file:Documentation/modules.txt>. If unsure, say `N'.
+config IP6_NF_TARGET_ROUTE
-+ tristate "ROUTE target support"
-+ depends on IP6_NF_MANGLE
-+ help
-+ This option adds a `ROUTE' target, which enables you to setup unusual
-+ routes. The ROUTE target is also able to change the incoming interface
-+ of a packet.
-+
-+ The target can be or not a final target. It has to be used inside the
-+ mangle table.
-+
-+ Not working as a module.
-+
- config IP6_NF_MANGLE
- tristate "Packet mangling"
- depends on IP6_NF_IPTABLES
-diff -urN linux-2.6.19.old/net/ipv6/netfilter/Makefile linux-2.6.19.dev/net/ipv6/netfilter/Makefile
---- linux-2.6.19.old/net/ipv6/netfilter/Makefile 2006-12-14 03:13:49.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv6/netfilter/Makefile 2006-12-14 03:13:49.000000000 +0100
-@@ -20,6 +20,7 @@
++ tristate 'ROUTE target support'
++ depends on IP6_NF_MANGLE
++ help
++ This option adds a `ROUTE' target, which enables you to setup unusual
++ routes. The ROUTE target is also able to change the incoming interface
++ of a packet.
++
++ The target can be or not a final target. It has to be used inside the
++ mangle table.
++
++ Not working as a module.
++
+ endmenu
+
+diff -Nur linux-2.6.21.1/net/ipv6/netfilter/Makefile linux-2.6.21.1-owrt/net/ipv6/netfilter/Makefile
+--- linux-2.6.21.1/net/ipv6/netfilter/Makefile 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1-owrt/net/ipv6/netfilter/Makefile 2007-05-23 20:32:22.000000000 +0200
+@@ -19,6 +19,7 @@
obj-$(CONFIG_IP6_NF_RAW) += ip6table_raw.o
obj-$(CONFIG_IP6_NF_MATCH_HL) += ip6t_hl.o
obj-$(CONFIG_IP6_NF_TARGET_REJECT) += ip6t_REJECT.o
+obj-$(CONFIG_IP6_NF_TARGET_ROUTE) += ip6t_ROUTE.o
+ obj-$(CONFIG_IP6_NF_MATCH_MH) += ip6t_mh.o
# objects for l3 independent conntrack
- nf_conntrack_ipv6-objs := nf_conntrack_l3proto_ipv6.o nf_conntrack_proto_icmpv6.o nf_conntrack_reasm.o
diff --git a/target/linux/generic-2.6/patches/170-netfilter_chaostables.patch b/target/linux/generic-2.6/patches/170-netfilter_chaostables.patch
index 46d48a5d08..aa665211b8 100644
--- a/target/linux/generic-2.6/patches/170-netfilter_chaostables.patch
+++ b/target/linux/generic-2.6/patches/170-netfilter_chaostables.patch
@@ -1,6 +1,33 @@
-diff -ruN linux-2.6.19.1.orig/include/linux/netfilter/xt_CHAOS.h linux-2.6.19.1/include/linux/netfilter/xt_CHAOS.h
---- linux-2.6.19.1.orig/include/linux/netfilter/xt_CHAOS.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.1/include/linux/netfilter/xt_CHAOS.h 2007-01-11 13:28:07.656144799 +0100
+diff -Nur linux-2.6.21.1/include/linux/netfilter/oot_conntrack.h linux-2.6.21.1-owrt/include/linux/netfilter/oot_conntrack.h
+--- linux-2.6.21.1/include/linux/netfilter/oot_conntrack.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/netfilter/oot_conntrack.h 2007-05-14 14:18:54.000000000 +0200
+@@ -0,0 +1,5 @@
++#if defined(CONFIG_IP_NF_CONNTRACK) || defined(CONFIG_IP_NF_CONNTRACK_MODULE)
++# include <linux/netfilter_ipv4/ip_conntrack.h>
++#else /* linux-2.6.20+ */
++# include <net/netfilter/nf_nat_rule.h>
++#endif
+diff -Nur linux-2.6.21.1/include/linux/netfilter/oot_trans.h linux-2.6.21.1-owrt/include/linux/netfilter/oot_trans.h
+--- linux-2.6.21.1/include/linux/netfilter/oot_trans.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/netfilter/oot_trans.h 2007-05-14 14:18:54.000000000 +0200
+@@ -0,0 +1,14 @@
++/* Out of tree workarounds */
++#include <linux/version.h>
++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)
++# define HAVE_MATCHINFOSIZE 1
++# define HAVE_TARGUSERINFO 1
++# define HAVE_TARGINFOSIZE 1
++#endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
++# define nfmark mark
++#endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 21)
++# define tcp_v4_check(tcph, tcph_sz, s, d, csp) \
++ tcp_v4_check((tcph_sz), (s), (d), (csp))
++#endif
+diff -Nur linux-2.6.21.1/include/linux/netfilter/xt_CHAOS.h linux-2.6.21.1-owrt/include/linux/netfilter/xt_CHAOS.h
+--- linux-2.6.21.1/include/linux/netfilter/xt_CHAOS.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/netfilter/xt_CHAOS.h 2007-05-14 14:18:54.000000000 +0200
@@ -0,0 +1,14 @@
+#ifndef _LINUX_XT_CHAOS_H
+#define _LINUX_XT_CHAOS_H 1
@@ -16,9 +43,9 @@ diff -ruN linux-2.6.19.1.orig/include/linux/netfilter/xt_CHAOS.h linux-2.6.19.1/
+};
+
+#endif /* _LINUX_XT_CHAOS_H */
-diff -ruN linux-2.6.19.1.orig/include/linux/netfilter/xt_portscan.h linux-2.6.19.1/include/linux/netfilter/xt_portscan.h
---- linux-2.6.19.1.orig/include/linux/netfilter/xt_portscan.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.1/include/linux/netfilter/xt_portscan.h 2007-01-11 13:28:07.656144799 +0100
+diff -Nur linux-2.6.21.1/include/linux/netfilter/xt_portscan.h linux-2.6.21.1-owrt/include/linux/netfilter/xt_portscan.h
+--- linux-2.6.21.1/include/linux/netfilter/xt_portscan.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/include/linux/netfilter/xt_portscan.h 2007-05-14 14:18:54.000000000 +0200
@@ -0,0 +1,8 @@
+#ifndef _LINUX_XT_PORTSCAN_H
+#define _LINUX_XT_PORTSCAN_H 1
@@ -28,10 +55,10 @@ diff -ruN linux-2.6.19.1.orig/include/linux/netfilter/xt_portscan.h linux-2.6.19
+};
+
+#endif /* _LINUX_XT_PORTSCAN_H */
-diff -ruN linux-2.6.19.1.orig/net/netfilter/find_match.c linux-2.6.19.1/net/netfilter/find_match.c
---- linux-2.6.19.1.orig/net/netfilter/find_match.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.1/net/netfilter/find_match.c 2007-01-11 13:28:12.191994379 +0100
-@@ -0,0 +1,37 @@
+diff -Nur linux-2.6.21.1/net/netfilter/find_match.c linux-2.6.21.1-owrt/net/netfilter/find_match.c
+--- linux-2.6.21.1/net/netfilter/find_match.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/net/netfilter/find_match.c 2007-05-14 14:18:54.000000000 +0200
+@@ -0,0 +1,39 @@
+/*
+ xt_request_find_match
+ by Jan Engelhardt <jengelh [at] gmx de>, 2006 - 2007
@@ -42,7 +69,6 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/find_match.c linux-2.6.19.1/net/netf
+ it under the terms of the GNU General Public License version 2 as
+ published by the Free Software Foundation.
+*/
-+
+#include <linux/err.h>
+#include <linux/netfilter_arp.h>
+#include <linux/socket.h>
@@ -52,7 +78,7 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/find_match.c linux-2.6.19.1/net/netf
+ * Yeah this code is sub-optimal, but the function is missing in
+ * mainline so far. -jengelh
+ */
-+static struct xt_match *xt_request_find_match(int af, const char *name,
++static struct xt_match *xt_request_find_match_lo(int af, const char *name,
+ u8 revision)
+{
+ static const char *const xt_prefix[] = {
@@ -69,10 +95,13 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/find_match.c linux-2.6.19.1/net/netf
+
+ return match;
+}
-diff -ruN linux-2.6.19.1.orig/net/netfilter/Kconfig linux-2.6.19.1/net/netfilter/Kconfig
---- linux-2.6.19.1.orig/net/netfilter/Kconfig 2007-01-11 13:27:24.445577700 +0100
-+++ linux-2.6.19.1/net/netfilter/Kconfig 2007-01-11 13:28:09.092097179 +0100
-@@ -122,6 +122,14 @@
++
++/* In case it goes into mainline, let this out-of-tree package compile */
++#define xt_request_find_match xt_request_find_match_lo
+diff -Nur linux-2.6.21.1/net/netfilter/Kconfig linux-2.6.21.1-owrt/net/netfilter/Kconfig
+--- linux-2.6.21.1/net/netfilter/Kconfig 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1-owrt/net/netfilter/Kconfig 2007-05-14 14:30:47.000000000 +0200
+@@ -287,6 +287,14 @@
# alphabetically ordered list of targets
@@ -87,7 +116,7 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/Kconfig linux-2.6.19.1/net/netfilter
config NETFILTER_XT_TARGET_CLASSIFY
tristate '"CLASSIFY" target support'
depends on NETFILTER_XTABLES
-@@ -148,6 +156,14 @@
+@@ -315,6 +323,14 @@
<file:Documentation/modules.txt>. The module will be called
ipt_CONNMARK.o. If unsure, say `N'.
@@ -102,7 +131,7 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/Kconfig linux-2.6.19.1/net/netfilter
config NETFILTER_XT_TARGET_DSCP
tristate '"DSCP" target support'
depends on NETFILTER_XTABLES
-@@ -355,6 +371,14 @@
+@@ -563,6 +579,14 @@
To compile it as a module, choose M here. If unsure, say N.
@@ -117,10 +146,10 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/Kconfig linux-2.6.19.1/net/netfilter
config NETFILTER_XT_MATCH_MULTIPORT
tristate "Multiple port match support"
depends on NETFILTER_XTABLES
-diff -ruN linux-2.6.19.1.orig/net/netfilter/Makefile linux-2.6.19.1/net/netfilter/Makefile
---- linux-2.6.19.1.orig/net/netfilter/Makefile 2007-01-11 13:27:24.445577700 +0100
-+++ linux-2.6.19.1/net/netfilter/Makefile 2007-01-11 13:28:07.656144799 +0100
-@@ -23,8 +23,10 @@
+diff -Nur linux-2.6.21.1/net/netfilter/Makefile linux-2.6.21.1-owrt/net/netfilter/Makefile
+--- linux-2.6.21.1/net/netfilter/Makefile 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1-owrt/net/netfilter/Makefile 2007-05-14 14:30:47.000000000 +0200
+@@ -37,8 +37,10 @@
obj-$(CONFIG_NETFILTER_XTABLES) += x_tables.o xt_tcpudp.o
# targets
@@ -131,7 +160,7 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/Makefile linux-2.6.19.1/net/netfilte
obj-$(CONFIG_NETFILTER_XT_TARGET_DSCP) += xt_DSCP.o
obj-$(CONFIG_NETFILTER_XT_TARGET_MARK) += xt_MARK.o
obj-$(CONFIG_NETFILTER_XT_TARGET_NFQUEUE) += xt_NFQUEUE.o
-@@ -47,6 +49,7 @@
+@@ -63,6 +65,7 @@
obj-$(CONFIG_NETFILTER_XT_MATCH_MARK) += xt_mark.o
obj-$(CONFIG_NETFILTER_XT_MATCH_MULTIPORT) += xt_multiport.o
obj-$(CONFIG_NETFILTER_XT_MATCH_POLICY) += xt_policy.o
@@ -139,16 +168,17 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/Makefile linux-2.6.19.1/net/netfilte
obj-$(CONFIG_NETFILTER_XT_MATCH_PKTTYPE) += xt_pkttype.o
obj-$(CONFIG_NETFILTER_XT_MATCH_QUOTA) += xt_quota.o
obj-$(CONFIG_NETFILTER_XT_MATCH_REALM) += xt_realm.o
-diff -ruN linux-2.6.19.1.orig/net/netfilter/xt_CHAOS.c linux-2.6.19.1/net/netfilter/xt_CHAOS.c
---- linux-2.6.19.1.orig/net/netfilter/xt_CHAOS.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.1/net/netfilter/xt_CHAOS.c 2007-01-11 13:28:14.407920893 +0100
-@@ -0,0 +1,180 @@
+diff -Nur linux-2.6.21.1/net/netfilter/xt_CHAOS.c linux-2.6.21.1-owrt/net/netfilter/xt_CHAOS.c
+--- linux-2.6.21.1/net/netfilter/xt_CHAOS.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/net/netfilter/xt_CHAOS.c 2007-05-14 14:36:58.000000000 +0200
+@@ -0,0 +1,204 @@
+/*
-+ CHAOS target for netfilter
++ CHAOS target for netfilter
+
-+ Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2006 - 2007
-+ released under the terms of the GNU General Public
-+ License version 2.x and only versions 2.x.
++ Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2006 - 2007
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License version 2 as
++ published by the Free Software Foundation.
+*/
+#include <linux/icmp.h>
+#include <linux/in.h>
@@ -162,14 +192,9 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/xt_CHAOS.c linux-2.6.19.1/net/netfil
+#include <net/ip.h>
+#include <linux/netfilter/xt_CHAOS.h>
+#include "find_match.c"
++#include <linux/netfilter/oot_trans.h>
+#define PFX KBUILD_MODNAME ": "
+
-+/* Out of tree workarounds */
-+#include <linux/version.h>
-+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)
-+# define HAVE_TARGUSERINFO 1
-+#endif
-+
+/* Module parameters */
+static unsigned int reject_percentage = ~0U * .01;
+static unsigned int delude_percentage = ~0U * .0101;
@@ -180,6 +205,8 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/xt_CHAOS.c linux-2.6.19.1/net/netfil
+static struct xt_match *xm_tcp;
+static struct xt_target *xt_delude, *xt_reject, *xt_tarpit;
+
++static int have_delude, have_tarpit;
++
+/* Static data for other matches/targets */
+static const struct ipt_reject_info reject_params = {
+ .with = ICMP_HOST_UNREACH,
@@ -226,7 +253,7 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/xt_CHAOS.c linux-2.6.19.1/net/netfil
+ /* Equivalent to:
+ * -A chaos -m statistic --mode random --probability \
+ * $reject_percentage -j REJECT --reject-with host-unreach;
-+ * -A chaos -m statistic --mode random --probability \
++ * -A chaos -p tcp -m statistic --mode random --probability \
+ * $delude_percentage -j DELUDE;
+ * -A chaos -j DROP;
+ */
@@ -249,9 +276,31 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/xt_CHAOS.c linux-2.6.19.1/net/netfil
+ return NF_DROP;
+}
+
++static int xt_chaos_checkentry(const char *tablename, const void *entry,
++ const struct xt_target *target, void *targinfo,
++#ifdef HAVE_TARGINFOSIZE
++ unsigned int targinfosize,
++#endif
++ unsigned int hook_mask)
++{
++ const struct xt_chaos_info *info = targinfo;
++ if(info->variant == XTCHAOS_DELUDE && !have_delude) {
++ printk(KERN_WARNING PFX "Error: Cannot use --delude when "
++ "DELUDE module not available\n");
++ return 0;
++ }
++ if(info->variant == XTCHAOS_TARPIT && !have_tarpit) {
++ printk(KERN_WARNING PFX "Error: Cannot use --tarpit when "
++ "TARPIT module not available\n");
++ return 0;
++ }
++ return 1;
++}
++
+static struct xt_target xt_chaos_info = {
+ .name = "CHAOS",
+ .target = xt_chaos_target,
++ .checkentry = xt_chaos_checkentry,
+ .table = "filter",
+ .targetsize = sizeof(struct xt_chaos_info),
+ .hooks = (1 << NF_IP_LOCAL_IN) | (1 << NF_IP_FORWARD) |
@@ -266,41 +315,43 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/xt_CHAOS.c linux-2.6.19.1/net/netfil
+
+ xm_tcp = xt_request_find_match(AF_INET, "tcp", 0);
+ if(xm_tcp == NULL) {
-+ printk(KERN_WARNING PFX "Could not find \"tcp\" match\n");
++ printk(KERN_WARNING PFX "Error: Could not find or load "
++ "\"tcp\" match\n");
+ return -EINVAL;
+ }
+
+ xt_reject = xt_request_find_target(AF_INET, "REJECT", 0);
+ if(xt_reject == NULL) {
-+ printk(KERN_WARNING PFX "Could not find \"REJECT\" target\n");
++ printk(KERN_WARNING PFX "Error: Could not find or load "
++ "\"REJECT\" target\n");
+ goto out2;
+ }
+
-+ xt_tarpit = xt_request_find_target(AF_INET, "TARPIT", 0);
-+ if(xt_tarpit == NULL) {
-+ printk(KERN_WARNING PFX "Could not find \"TARPIT\" target\n");
-+ goto out3;
-+ }
++ xt_tarpit = xt_request_find_target(AF_INET, "TARPIT", 0);
++ have_tarpit = xt_tarpit != NULL;
++ if(!have_tarpit)
++ printk(KERN_WARNING PFX "Warning: Could not find or load "
++ "\"TARPIT\" target\n");
+
-+ xt_delude = xt_request_find_target(AF_INET, "DELUDE", 0);
-+ if(xt_delude == NULL) {
-+ printk(KERN_WARNING PFX "Could not find \"DELUDE\" target\n");
-+ goto out4;
-+ }
++ xt_delude = xt_request_find_target(AF_INET, "DELUDE", 0);
++ have_delude = xt_delude != NULL;
++ if(!have_delude)
++ printk(KERN_WARNING PFX "Warning: Could not find or load "
++ "\"DELUDE\" target\n");
+
+ if((ret = xt_register_target(&xt_chaos_info)) != 0) {
+ printk(KERN_WARNING PFX "xt_register_target returned "
+ "error %d\n", ret);
-+ goto out5;
++ goto out3;
+ }
+
+ return 0;
+
-+ out5:
-+ module_put(xt_delude->me);
-+ out4:
-+ module_put(xt_tarpit->me);
+ out3:
++ if(have_delude)
++ module_put(xt_delude->me);
++ if(have_tarpit)
++ module_put(xt_tarpit->me);
+ module_put(xt_reject->me);
+ out2:
+ module_put(xm_tcp->me);
@@ -312,8 +363,10 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/xt_CHAOS.c linux-2.6.19.1/net/netfil
+ xt_unregister_target(&xt_chaos_info);
+ module_put(xm_tcp->me);
+ module_put(xt_reject->me);
-+ module_put(xt_delude->me);
-+ module_put(xt_tarpit->me);
++ if(have_delude)
++ module_put(xt_delude->me);
++ if(have_tarpit)
++ module_put(xt_tarpit->me);
+ return;
+}
+
@@ -323,26 +376,28 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/xt_CHAOS.c linux-2.6.19.1/net/netfil
+MODULE_DESCRIPTION("netfilter CHAOS target");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("ipt_CHAOS");
-diff -ruN linux-2.6.19.1.orig/net/netfilter/xt_DELUDE.c linux-2.6.19.1/net/netfilter/xt_DELUDE.c
---- linux-2.6.19.1.orig/net/netfilter/xt_DELUDE.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.1/net/netfilter/xt_DELUDE.c 2007-01-11 13:28:07.656144799 +0100
-@@ -0,0 +1,265 @@
+diff -Nur linux-2.6.21.1/net/netfilter/xt_DELUDE.c linux-2.6.21.1-owrt/net/netfilter/xt_DELUDE.c
+--- linux-2.6.21.1/net/netfilter/xt_DELUDE.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/net/netfilter/xt_DELUDE.c 2007-05-14 14:53:12.000000000 +0200
+@@ -0,0 +1,288 @@
+/*
-+ DELUDE target
-+ Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2007
++ DELUDE target
++ Copyright © Jan Engelhardt <jengelh [at] gmx de>, 2007
+
-+ Based upon linux-2.6.18.5/net/ipv4/netfilter/ipt_REJECT.c:
-+ (C) 1999-2001 Paul `Rusty' Russell
-+ (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org>
++ Based upon linux-2.6.18.5/net/ipv4/netfilter/ipt_REJECT.c:
++ (C) 1999-2001 Paul `Rusty' Russell
++ (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org>
+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License version 2 as
-+ published by the Free Software Foundation.
-+*/
++ xt_DELUDE acts like REJECT, but does reply with SYN-ACK on SYN.
+
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License version 2 as
++ published by the Free Software Foundation.
++*/
+#include <linux/module.h>
+#include <linux/skbuff.h>
+#include <linux/ip.h>
++#include <linux/random.h>
+#include <linux/tcp.h>
+#include <linux/udp.h>
+#include <linux/icmp.h>
@@ -353,20 +408,11 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/xt_DELUDE.c linux-2.6.19.1/net/netfi
+#include <net/dst.h>
+#include <linux/netfilter_ipv4/ip_tables.h>
+#ifdef CONFIG_BRIDGE_NETFILTER
-+#include <linux/netfilter_bridge.h>
++# include <linux/netfilter_bridge.h>
+#endif
++#include <linux/netfilter/oot_trans.h>
+#define PFX KBUILD_MODNAME ": "
+
-+/* Out of tree workarounds */
-+#include <linux/version.h>
-+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)
-+# define HAVE_TARGINFOSIZE 1
-+# define HAVE_TARGUSERINFO 1
-+#endif
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
-+# define nfmark mark
-+#endif
-+
+static inline struct rtable *route_reverse(struct sk_buff *skb,
+ struct tcphdr *tcph, int hook)
+{
@@ -430,10 +476,10 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/xt_DELUDE.c linux-2.6.19.1/net/netfi
+ struct sk_buff *nskb;
+ struct iphdr *iph = oldskb->nh.iph;
+ struct tcphdr _otcph, *oth, *tcph;
-+ struct rtable *rt;
-+ u_int16_t tmp_port;
-+ u_int32_t tmp_addr;
-+ int hh_len;
++ __be16 tmp_port;
++ __be32 tmp_addr;
++ int needs_ack;
++ unsigned int addr_type;
+
+ /* IP header checks: fragment. */
+ if (oldskb->nh.iph->frag_off & htons(IP_OFFSET))
@@ -442,39 +488,33 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/xt_DELUDE.c linux-2.6.19.1/net/netfi
+ oth = skb_header_pointer(oldskb, oldskb->nh.iph->ihl * 4,
+ sizeof(_otcph), &_otcph);
+ if (oth == NULL)
-+ return;
++ return;
+
-+ /* DELUDE only answers SYN. */
-+ if(!oth->syn || oth->ack || oth->fin || oth->rst)
++ /* No RST for RST. */
++ if (oth->rst)
+ return;
+
+ /* Check checksum */
+ if (nf_ip_checksum(oldskb, hook, iph->ihl * 4, IPPROTO_TCP))
+ return;
+
-+ if ((rt = route_reverse(oldskb, oth, hook)) == NULL)
-+ return;
-+
-+ hh_len = LL_RESERVED_SPACE(rt->u.dst.dev);
-+
+ /* We need a linear, writeable skb. We also need to expand
+ headroom in case hh_len of incoming interface < hh_len of
+ outgoing interface */
-+ nskb = skb_copy_expand(oldskb, hh_len, skb_tailroom(oldskb),
++ nskb = skb_copy_expand(oldskb, LL_MAX_HEADER, skb_tailroom(oldskb),
+ GFP_ATOMIC);
-+ if (!nskb) {
-+ dst_release(&rt->u.dst);
++ if (!nskb)
+ return;
-+ }
-+
-+ dst_release(nskb->dst);
-+ nskb->dst = &rt->u.dst;
+
+ /* This packet will not be the same as the other: clear nf fields */
+ nf_reset(nskb);
+ nskb->nfmark = 0;
+ skb_init_secmark(nskb);
+
++ skb_shinfo(nskb)->gso_size = 0;
++ skb_shinfo(nskb)->gso_segs = 0;
++ skb_shinfo(nskb)->gso_type = 0;
++
+ tcph = (struct tcphdr *)((u_int32_t*)nskb->nh.iph + nskb->nh.iph->ihl);
+
+ /* Swap source and dest */
@@ -490,12 +530,34 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/xt_DELUDE.c linux-2.6.19.1/net/netfi
+ skb_trim(nskb, nskb->nh.iph->ihl*4 + sizeof(struct tcphdr));
+ nskb->nh.iph->tot_len = htons(nskb->len);
+
-+ tcph->seq = oth->ack_seq;
-+ tcph->ack_seq = 0;
++ if(oth->syn && !oth->ack && !oth->rst && !oth->fin) {
++ /* DELUDE essential part */
++ tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin +
++ oldskb->len - oldskb->nh.iph->ihl * 4 -
++ (oth->doff << 2));
++ tcph->seq = htonl(secure_tcp_sequence_number(
++ nskb->nh.iph->saddr, nskb->nh.iph->daddr,
++ tcph->source, tcph->dest));
++ tcph->ack = 1;
++ } else {
++ if(!tcph->ack) {
++ needs_ack = 1;
++ tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin
++ + oldskb->len - oldskb->nh.iph->ihl*4
++ - (oth->doff<<2));
++ tcph->seq = 0;
++ } else {
++ needs_ack = 0;
++ tcph->seq = oth->ack_seq;
++ tcph->ack_seq = 0;
++ }
++
++ /* Reset flags */
++ ((u_int8_t *)tcph)[13] = 0;
++ tcph->rst = 1;
++ tcph->ack = needs_ack;
++ }
+
-+ /* Reset flags */
-+ ((u_int8_t *)tcph)[13] = 0;
-+ tcph->syn = tcph->ack = 1;
+
+ tcph->window = 0;
+ tcph->urg_ptr = 0;
@@ -508,12 +570,26 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/xt_DELUDE.c linux-2.6.19.1/net/netfi
+ csum_partial((char *)tcph,
+ sizeof(struct tcphdr), 0));
+
-+ /* Adjust IP TTL, DF */
-+ nskb->nh.iph->ttl = dst_metric(nskb->dst, RTAX_HOPLIMIT);
+ /* Set DF, id = 0 */
+ nskb->nh.iph->frag_off = htons(IP_DF);
+ nskb->nh.iph->id = 0;
+
++ addr_type = RTN_UNSPEC;
++ if (hook != NF_IP_FORWARD
++#ifdef CONFIG_BRIDGE_NETFILTER
++ || (nskb->nf_bridge && nskb->nf_bridge->mask & BRNF_BRIDGED)
++#endif
++ )
++ addr_type = RTN_LOCAL;
++
++ if (ip_route_me_harder(&nskb, addr_type))
++ goto free_nskb;
++
++ nskb->ip_summed = CHECKSUM_NONE;
++
++ /* Adjust IP TTL */
++ nskb->nh.iph->ttl = dst_metric(nskb->dst, RTAX_HOPLIMIT);
++
+ /* Adjust IP checksum */
+ nskb->nh.iph->check = 0;
+ nskb->nh.iph->check = ip_fast_csum((unsigned char *)nskb->nh.iph,
@@ -531,7 +607,6 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/xt_DELUDE.c linux-2.6.19.1/net/netfi
+
+ free_nskb:
+ kfree_skb(nskb);
-+ return;
+}
+
+static unsigned int xt_delude_target(struct sk_buff **pskb,
@@ -589,19 +664,21 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/xt_DELUDE.c linux-2.6.19.1/net/netfi
+
+module_init(xt_delude_init);
+module_exit(xt_delude_exit);
-+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Jan Engelhardt <jengelh@gmx.de>");
+MODULE_DESCRIPTION("netfilter DELUDE target");
-diff -ruN linux-2.6.19.1.orig/net/netfilter/xt_portscan.c linux-2.6.19.1/net/netfilter/xt_portscan.c
---- linux-2.6.19.1.orig/net/netfilter/xt_portscan.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.1/net/netfilter/xt_portscan.c 2007-01-11 13:28:14.407920893 +0100
-@@ -0,0 +1,282 @@
++MODULE_LICENSE("GPL");
++MODULE_ALIAS("ipt_DELUDE");
+diff -Nur linux-2.6.21.1/net/netfilter/xt_portscan.c linux-2.6.21.1-owrt/net/netfilter/xt_portscan.c
+--- linux-2.6.21.1/net/netfilter/xt_portscan.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/net/netfilter/xt_portscan.c 2007-05-14 14:37:35.000000000 +0200
+@@ -0,0 +1,272 @@
+/*
-+ portscan match for netfilter
++ portscan match for netfilter
+
-+ Written by Jan Engelhardt, 2006 - 2007
-+ released under the terms of the GNU General Public
-+ License version 2.x and only versions 2.x.
++ Written by Jan Engelhardt, 2006 - 2007
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License version 2 as
++ published by the Free Software Foundation.
+*/
+#include <linux/in.h>
+#include <linux/ip.h>
@@ -614,22 +691,11 @@ diff -ruN linux-2.6.19.1.orig/net/netfilter/xt_portscan.c linux-2.6.19.1/net/net
+#include <linux/version.h>
+#include <linux/netfilter/x_tables.h>
+#include <linux/netfilter/xt_tcpudp.h>
-+#if defined(CONFIG_IP_NF_CONNTRACK) || defined(CONFIG_IP_NF_CONNTRACK_MODULE)
-+# include <linux/netfilter_ipv4/ip_conntrack.h>
-+#else /* linux-2.6.20+ */
-+# include <net/netfilter/nf_nat_rule.h>
-+#endif
++#include <linux/netfilter/oot_conntrack.h>
+#include <linux/netfilter/xt_portscan.h>
++#include <linux/netfilter/oot_trans.h>
+#define PFX KBUILD_MODNAME ": "
+
-+/* Out of tree workarounds */
-+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)
-+# define HAVE_MATCHINFOSIZE 1
-+#endif
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
-+# define nfmark mark
-+#endif
-+
+enum {
+ TCP_FLAGS_ALL3 = TCP_FLAG_FIN | TCP_FLAG_RST | TCP_FLAG_SYN,
+ TCP_FLAGS_ALL4 = TCP_FLAGS_ALL3 | TCP_FLAG_ACK,
diff --git a/target/linux/generic-2.6/patches/200-sched_esfq.patch b/target/linux/generic-2.6/patches/200-sched_esfq.patch
index 6830b833ad..dba20cff28 100644
--- a/target/linux/generic-2.6/patches/200-sched_esfq.patch
+++ b/target/linux/generic-2.6/patches/200-sched_esfq.patch
@@ -1,7 +1,7 @@
-diff -urN linux-2.6.19.old/include/linux/pkt_sched.h linux-2.6.19.dev/include/linux/pkt_sched.h
---- linux-2.6.19.old/include/linux/pkt_sched.h 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/pkt_sched.h 2006-12-14 03:13:51.000000000 +0100
-@@ -146,8 +146,35 @@
+diff -Naur linux-2.6.20.orig/include/linux/pkt_sched.h linux-2.6.20/include/linux/pkt_sched.h
+--- linux-2.6.20.orig/include/linux/pkt_sched.h 2007-02-04 10:44:54.000000000 -0800
++++ linux-2.6.20/include/linux/pkt_sched.h 2007-02-14 23:58:41.000000000 -0800
+@@ -146,8 +146,40 @@
*
* The only reason for this is efficiency, it is possible
* to change these parameters in compile time.
@@ -22,6 +22,11 @@ diff -urN linux-2.6.19.old/include/linux/pkt_sched.h linux-2.6.19.dev/include/li
+ TCA_SFQ_HASH_DSTDIR,
+ TCA_SFQ_HASH_SRCDIR,
+ TCA_SFQ_HASH_FWMARKDIR,
++ /* conntrack */
++ TCA_SFQ_HASH_CTORIGDST,
++ TCA_SFQ_HASH_CTORIGSRC,
++ TCA_SFQ_HASH_CTREPLDST,
++ TCA_SFQ_HASH_CTREPLSRC,
+};
+
+struct tc_esfq_qopt
@@ -37,31 +42,29 @@ diff -urN linux-2.6.19.old/include/linux/pkt_sched.h linux-2.6.19.dev/include/li
/* RED section */
enum
-diff -urN linux-2.6.19.old/net/sched/Kconfig linux-2.6.19.dev/net/sched/Kconfig
---- linux-2.6.19.old/net/sched/Kconfig 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/net/sched/Kconfig 2006-12-14 03:13:51.000000000 +0100
-@@ -185,6 +185,28 @@
+diff -Naur linux-2.6.20.orig/net/sched/Kconfig linux-2.6.20/net/sched/Kconfig
+--- linux-2.6.20.orig/net/sched/Kconfig 2007-02-04 10:44:54.000000000 -0800
++++ linux-2.6.20/net/sched/Kconfig 2007-02-14 23:58:41.000000000 -0800
+@@ -189,6 +189,26 @@
To compile this code as a module, choose M here: the
module will be called sch_sfq.
+config NET_SCH_ESFQ
-+ tristate "ESFQ queue"
-+ depends on NET_SCHED
++ tristate "Enhanced Stochastic Fairness Queueing (ESFQ)"
+ ---help---
+ Say Y here if you want to use the Enhanced Stochastic Fairness
+ Queueing (ESFQ) packet scheduling algorithm for some of your network
+ devices or as a leaf discipline for a classful qdisc such as HTB or
+ CBQ (see the top of <file:net/sched/sch_esfq.c> for details and
+ references to the SFQ algorithm).
-+
++
+ This is an enchanced SFQ version which allows you to control some
-+ hardcoded values in the SFQ scheduler: queue depth, hash table size,
-+ and queues limit.
-+
-+ ESFQ also adds control to the hash function used to identify packet
-+ flows. The original SFQ hashes by individual flow (TCP session or UDP
-+ stream); ESFQ can hash by src or dst IP as well, which can be more
-+ fair to users in some networking situations.
++ hardcoded values in the SFQ scheduler.
++
++ ESFQ also adds control of the hash function used to identify packet
++ flows. The original SFQ discipline hashes by connection; ESFQ add
++ several other hashing methods, such as by src IP or by dst IP, which
++ can be more fair to users in some networking situations.
+
+ To compile this code as a module, choose M here: the
+ module will be called sch_esfq.
@@ -69,10 +72,10 @@ diff -urN linux-2.6.19.old/net/sched/Kconfig linux-2.6.19.dev/net/sched/Kconfig
config NET_SCH_TEQL
tristate "True Link Equalizer (TEQL)"
---help---
-diff -urN linux-2.6.19.old/net/sched/Makefile linux-2.6.19.dev/net/sched/Makefile
---- linux-2.6.19.old/net/sched/Makefile 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/net/sched/Makefile 2006-12-14 03:13:51.000000000 +0100
-@@ -23,6 +23,7 @@
+diff -Naur linux-2.6.20.orig/net/sched/Makefile linux-2.6.20/net/sched/Makefile
+--- linux-2.6.20.orig/net/sched/Makefile 2007-02-04 10:44:54.000000000 -0800
++++ linux-2.6.20/net/sched/Makefile 2007-02-14 23:58:41.000000000 -0800
+@@ -24,6 +24,7 @@
obj-$(CONFIG_NET_SCH_INGRESS) += sch_ingress.o
obj-$(CONFIG_NET_SCH_DSMARK) += sch_dsmark.o
obj-$(CONFIG_NET_SCH_SFQ) += sch_sfq.o
@@ -80,10 +83,10 @@ diff -urN linux-2.6.19.old/net/sched/Makefile linux-2.6.19.dev/net/sched/Makefil
obj-$(CONFIG_NET_SCH_TBF) += sch_tbf.o
obj-$(CONFIG_NET_SCH_TEQL) += sch_teql.o
obj-$(CONFIG_NET_SCH_PRIO) += sch_prio.o
-diff -urN linux-2.6.19.old/net/sched/sch_esfq.c linux-2.6.19.dev/net/sched/sch_esfq.c
---- linux-2.6.19.old/net/sched/sch_esfq.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.19.dev/net/sched/sch_esfq.c 2006-12-14 03:13:51.000000000 +0100
-@@ -0,0 +1,644 @@
+diff -Naur linux-2.6.20.orig/net/sched/sch_esfq.c linux-2.6.20/net/sched/sch_esfq.c
+--- linux-2.6.20.orig/net/sched/sch_esfq.c 1969-12-31 16:00:00.000000000 -0800
++++ linux-2.6.20/net/sched/sch_esfq.c 2007-02-15 00:19:56.000000000 -0800
+@@ -0,0 +1,704 @@
+/*
+ * net/sched/sch_esfq.c Extended Stochastic Fairness Queueing discipline.
+ *
@@ -103,12 +106,12 @@ diff -urN linux-2.6.19.old/net/sched/sch_esfq.c linux-2.6.19.dev/net/sched/sch_e
+ *
+ * Corey Hickey, <bugfood-c@fatooh.org>
+ * Maintenance of the Linux 2.6 port.
-+ * Added fwmark hash (thanks to Robert Kurjata)
++ * Added fwmark hash (thanks to Robert Kurjata).
+ * Added direct hashing for src, dst, and fwmark.
++ * Added usage of jhash.
+ *
+ */
+
-+#include <linux/autoconf.h>
+#include <linux/module.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
@@ -135,12 +138,16 @@ diff -urN linux-2.6.19.old/net/sched/sch_esfq.c linux-2.6.19.dev/net/sched/sch_e
+#include <linux/skbuff.h>
+#include <net/sock.h>
+#include <net/pkt_sched.h>
++#include <linux/jhash.h>
+
++#ifdef CONFIG_NF_CONNTRACK_ENABLED
++#include <net/netfilter/nf_conntrack.h>
++#endif
+
+/* Stochastic Fairness Queuing algorithm.
+ For more comments look at sch_sfq.c.
+ The difference is that you can change limit, depth,
-+ hash table size and choose 7 hash types.
++ hash table size and choose alternate hash types.
+
+ classic: same as in sch_sfq.c
+ dst: destination IP address
@@ -149,9 +156,11 @@ diff -urN linux-2.6.19.old/net/sched/sch_esfq.c linux-2.6.19.dev/net/sched/sch_e
+ dst_direct:
+ src_direct:
+ fwmark_direct: direct hashing of the above sources
++ ctorigdst: original destination IP address
++ ctorigsrc: original source IP address
++ ctrepldst: reply destination IP address
++ ctreplsrc: reply source IP
+
-+ TODO:
-+ make sfq_change work.
+*/
+
+
@@ -190,20 +199,24 @@ diff -urN linux-2.6.19.old/net/sched/sch_esfq.c linux-2.6.19.dev/net/sched/sch_e
+ unsigned dyn_range; /* saved range */
+};
+
-+static __inline__ unsigned esfq_hash_u32(struct esfq_sched_data *q,u32 h)
++/* This contains the info we will hash. */
++struct esfq_packet_info
+{
-+ int pert = q->perturbation;
-+
-+ if (pert)
-+ h = (h<<pert) ^ (h>>(0x1F - pert));
-+
-+ h = ntohl(h) * 2654435761UL;
-+ return h & (q->hash_divisor-1);
-+}
++ u32 proto; /* protocol or port */
++ u32 src; /* source from packet header */
++ u32 dst; /* destination from packet header */
++ u32 ctorigsrc; /* original source from conntrack */
++ u32 ctorigdst; /* original destination from conntrack */
++ u32 ctreplsrc; /* reply source from conntrack */
++ u32 ctrepldst; /* reply destination from conntrack */
++ u32 mark; /* netfilter mark (fwmark) */
++};
+
+/* Hash input values directly into the "nearest" slot, taking into account the
+ * range of input values seen. This is most useful when the hash table is at
-+ * least as large as the range of possible values. */
++ * least as large as the range of possible values.
++ * Note: this functionality was added before the change to using jhash, and may
++ * no longer be useful. */
+static __inline__ unsigned esfq_hash_direct(struct esfq_sched_data *q, u32 h)
+{
+ /* adjust minimum and maximum */
@@ -224,83 +237,128 @@ diff -urN linux-2.6.19.old/net/sched/sch_esfq.c linux-2.6.19.dev/net/sched/sch_e
+ return (h - q->dyn_min) * (q->hash_divisor - 1) / q->dyn_range;
+}
+
-+static __inline__ unsigned esfq_fold_hash_classic(struct esfq_sched_data *q, u32 h, u32 h1)
++static __inline__ unsigned esfq_jhash_1word(struct esfq_sched_data *q,u32 a)
+{
-+ int pert = q->perturbation;
++ return jhash_1word(a, q->perturbation) & (q->hash_divisor-1);
++}
+
-+ /* Have we any rotation primitives? If not, WHY? */
-+ h ^= (h1<<pert) ^ (h1>>(0x1F - pert));
-+ h ^= h>>10;
-+ return h & (q->hash_divisor-1);
++static __inline__ unsigned esfq_jhash_2words(struct esfq_sched_data *q, u32 a, u32 b)
++{
++ return jhash_2words(a, b, q->perturbation) & (q->hash_divisor-1);
+}
+
-+static unsigned esfq_hash(struct esfq_sched_data *q, struct sk_buff *skb)
++static __inline__ unsigned esfq_jhash_3words(struct esfq_sched_data *q, u32 a, u32 b, u32 c)
+{
-+ u32 h, h2;
-+ u32 hs;
-+ u32 nfm;
++ return jhash_3words(a, b, c, q->perturbation) & (q->hash_divisor-1);
++}
+
++
++static unsigned esfq_hash(struct esfq_sched_data *q, struct sk_buff *skb)
++{
++ struct esfq_packet_info info;
++#ifdef CONFIG_NF_CONNTRACK_ENABLED
++ enum ip_conntrack_info ctinfo;
++ struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
++#endif
++
+ switch (skb->protocol) {
+ case __constant_htons(ETH_P_IP):
+ {
+ struct iphdr *iph = skb->nh.iph;
-+ h = iph->daddr;
-+ hs = iph->saddr;
-+ nfm = skb->nfmark;
-+ h2 = hs^iph->protocol;
++ info.dst = iph->daddr;
++ info.src = iph->saddr;
+ if (!(iph->frag_off&htons(IP_MF|IP_OFFSET)) &&
+ (iph->protocol == IPPROTO_TCP ||
+ iph->protocol == IPPROTO_UDP ||
+ iph->protocol == IPPROTO_SCTP ||
+ iph->protocol == IPPROTO_DCCP ||
+ iph->protocol == IPPROTO_ESP))
-+ h2 ^= *(((u32*)iph) + iph->ihl);
++ info.proto = *(((u32*)iph) + iph->ihl);
++ else
++ info.proto = iph->protocol;
+ break;
+ }
+ case __constant_htons(ETH_P_IPV6):
+ {
+ struct ipv6hdr *iph = skb->nh.ipv6h;
-+ h = iph->daddr.s6_addr32[3];
-+ hs = iph->saddr.s6_addr32[3];
-+ nfm = skb->nfmark;
-+ h2 = hs^iph->nexthdr;
++ /* Hash ipv6 addresses into a u32. This isn't ideal,
++ * but the code is simple. */
++ info.dst = jhash2(iph->daddr.s6_addr32, 4, q->perturbation);
++ info.src = jhash2(iph->saddr.s6_addr32, 4, q->perturbation);
+ if (iph->nexthdr == IPPROTO_TCP ||
+ iph->nexthdr == IPPROTO_UDP ||
+ iph->nexthdr == IPPROTO_SCTP ||
+ iph->nexthdr == IPPROTO_DCCP ||
+ iph->nexthdr == IPPROTO_ESP)
-+ h2 ^= *(u32*)&iph[1];
++ info.proto = *(u32*)&iph[1];
++ else
++ info.proto = iph->nexthdr;
+ break;
+ }
+ default:
-+ h = (u32)(unsigned long)skb->dst;
-+ hs = (u32)(unsigned long)skb->sk;
-+ nfm = skb->nfmark;
-+ h2 = hs^skb->protocol;
++ info.dst = (u32)(unsigned long)skb->dst;
++ info.src = (u32)(unsigned long)skb->sk;
++ info.proto = skb->protocol;
++ }
++
++ info.mark = skb->mark;
++
++#ifdef CONFIG_NF_CONNTRACK_ENABLED
++ /* defaults if there is no conntrack info */
++ info.ctorigsrc = info.src;
++ info.ctorigdst = info.dst;
++ info.ctreplsrc = info.dst;
++ info.ctrepldst = info.src;
++ /* collect conntrack info */
++ if (ct && ct != &nf_conntrack_untracked) {
++ if (skb->protocol == __constant_htons(ETH_P_IP)) {
++ info.ctorigsrc = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip;
++ info.ctorigdst = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3.ip;
++ info.ctreplsrc = ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3.ip;
++ info.ctrepldst = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip;
++ }
++ else if (skb->protocol == __constant_htons(ETH_P_IPV6)) {
++ /* Again, hash ipv6 addresses into a single u32. */
++ info.ctorigsrc = jhash2(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip6, 4, q->perturbation);
++ info.ctorigdst = jhash2(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3.ip6, 4, q->perturbation);
++ info.ctreplsrc = jhash2(ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3.ip6, 4, q->perturbation);
++ info.ctrepldst = jhash2(ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip6, 4, q->perturbation);
++ }
++
+ }
++#endif
++
+ switch(q->hash_kind)
+ {
+ case TCA_SFQ_HASH_CLASSIC:
-+ return esfq_fold_hash_classic(q, h, h2);
++ return esfq_jhash_3words(q, info.dst, info.src, info.proto);
+ case TCA_SFQ_HASH_DST:
-+ return esfq_hash_u32(q,h);
++ return esfq_jhash_1word(q, info.dst);
+ case TCA_SFQ_HASH_DSTDIR:
-+ return esfq_hash_direct(q, ntohl(h));
++ return esfq_hash_direct(q, ntohl(info.dst));
+ case TCA_SFQ_HASH_SRC:
-+ return esfq_hash_u32(q,hs);
++ return esfq_jhash_1word(q, info.src);
+ case TCA_SFQ_HASH_SRCDIR:
-+ return esfq_hash_direct(q, ntohl(hs));
-+#ifdef CONFIG_NETFILTER
++ return esfq_hash_direct(q, ntohl(info.src));
+ case TCA_SFQ_HASH_FWMARK:
-+ return esfq_hash_u32(q,nfm);
++ return esfq_jhash_1word(q, info.mark);
+ case TCA_SFQ_HASH_FWMARKDIR:
-+ return esfq_hash_direct(q,nfm);
++ return esfq_hash_direct(q, info.mark);
++#ifdef CONFIG_NF_CONNTRACK_ENABLED
++ case TCA_SFQ_HASH_CTORIGDST:
++ return esfq_jhash_1word(q, info.ctorigdst);
++ case TCA_SFQ_HASH_CTORIGSRC:
++ return esfq_jhash_1word(q, info.ctorigsrc);
++ case TCA_SFQ_HASH_CTREPLDST:
++ return esfq_jhash_1word(q, info.ctrepldst);
++ case TCA_SFQ_HASH_CTREPLSRC:
++ return esfq_jhash_1word(q, info.ctreplsrc);
+#endif
+ default:
+ if (net_ratelimit())
+ printk(KERN_WARNING "ESFQ: Unknown hash method. Falling back to classic.\n");
+ }
-+ return esfq_fold_hash_classic(q, h, h2);
++ return esfq_jhash_3words(q, info.dst, info.src, info.proto);
+}
+
+static inline void esfq_link(struct esfq_sched_data *q, esfq_index x)
@@ -365,6 +423,7 @@ diff -urN linux-2.6.19.old/net/sched/sch_esfq.c linux-2.6.19.dev/net/sched/sch_e
+ esfq_dec(q, x);
+ sch->q.qlen--;
+ sch->qstats.drops++;
++ sch->qstats.backlog -= len;
+ return len;
+ }
+
@@ -381,6 +440,7 @@ diff -urN linux-2.6.19.old/net/sched/sch_esfq.c linux-2.6.19.dev/net/sched/sch_e
+ sch->q.qlen--;
+ q->ht[q->hash[d]] = q->depth;
+ sch->qstats.drops++;
++ sch->qstats.backlog -= len;
+ return len;
+ }
+
@@ -400,6 +460,7 @@ diff -urN linux-2.6.19.old/net/sched/sch_esfq.c linux-2.6.19.dev/net/sched/sch_e
+ q->ht[hash] = x = q->dep[depth].next;
+ q->hash[x] = hash;
+ }
++ sch->qstats.backlog += skb->len;
+ __skb_queue_tail(&q->qs[x], skb);
+ esfq_inc(q, x);
+ if (q->qs[x].qlen == 1) { /* The flow is new */
@@ -436,6 +497,7 @@ diff -urN linux-2.6.19.old/net/sched/sch_esfq.c linux-2.6.19.dev/net/sched/sch_e
+ q->ht[hash] = x = q->dep[depth].next;
+ q->hash[x] = hash;
+ }
++ sch->qstats.backlog += skb->len;
+ __skb_queue_head(&q->qs[x], skb);
+ esfq_inc(q, x);
+ if (q->qs[x].qlen == 1) { /* The flow is new */
@@ -480,6 +542,7 @@ diff -urN linux-2.6.19.old/net/sched/sch_esfq.c linux-2.6.19.dev/net/sched/sch_e
+ skb = __skb_dequeue(&q->qs[a]);
+ esfq_dec(q, a);
+ sch->q.qlen--;
++ sch->qstats.backlog -= skb->len;
+
+ /* Is the slot empty? */
+ if (q->qs[a].qlen == 0) {
@@ -542,7 +605,7 @@ diff -urN linux-2.6.19.old/net/sched/sch_esfq.c linux-2.6.19.dev/net/sched/sch_e
+
+ if (ctl->hash_kind) {
+ q->hash_kind = ctl->hash_kind;
-+ if (q->hash_kind != TCA_SFQ_HASH_CLASSIC)
++ if (q->hash_kind != TCA_SFQ_HASH_CLASSIC)
+ q->perturb_period = 0;
+ }
+
@@ -566,7 +629,7 @@ diff -urN linux-2.6.19.old/net/sched/sch_esfq.c linux-2.6.19.dev/net/sched/sch_e
+{
+ struct esfq_sched_data *q = qdisc_priv(sch);
+ struct tc_esfq_qopt *ctl;
-+ esfq_index p = ~0UL/2;
++ esfq_index p = ~0U/2;
+ int i;
+
+ if (opt && opt->rta_len < RTA_LENGTH(sizeof(*ctl)))
diff --git a/target/linux/generic-2.6/patches/201-multiple_default_gateways.patch b/target/linux/generic-2.6/patches/201-multiple_default_gateways.patch
index 4a3e327288..8b6612f4cf 100644
--- a/target/linux/generic-2.6/patches/201-multiple_default_gateways.patch
+++ b/target/linux/generic-2.6/patches/201-multiple_default_gateways.patch
@@ -1,7 +1,7 @@
-diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_nat.h linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_nat.h
---- linux-2.6.19.old/include/linux/netfilter_ipv4/ip_nat.h 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_nat.h 2006-12-14 03:13:53.000000000 +0100
-@@ -63,6 +63,13 @@
+diff -urN linux-2.6.21.1/include/linux/netfilter_ipv4/ip_nat.h linux-2.6.21.1.new/include/linux/netfilter_ipv4/ip_nat.h
+--- linux-2.6.21.1/include/linux/netfilter_ipv4/ip_nat.h 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1.new/include/linux/netfilter_ipv4/ip_nat.h 2007-05-14 12:57:39.000000000 +0200
+@@ -64,6 +64,13 @@
struct ip_conntrack;
@@ -15,9 +15,9 @@ diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_nat.h linux-2.6.19.de
/* Set up the info structure to map into this range. */
extern unsigned int ip_nat_setup_info(struct ip_conntrack *conntrack,
const struct ip_nat_range *range,
-diff -urN linux-2.6.19.old/include/linux/rtnetlink.h linux-2.6.19.dev/include/linux/rtnetlink.h
---- linux-2.6.19.old/include/linux/rtnetlink.h 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/include/linux/rtnetlink.h 2006-12-14 03:13:53.000000000 +0100
+diff -urN linux-2.6.21.1/include/linux/rtnetlink.h linux-2.6.21.1.new/include/linux/rtnetlink.h
+--- linux-2.6.21.1/include/linux/rtnetlink.h 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1.new/include/linux/rtnetlink.h 2007-05-14 12:57:39.000000000 +0200
@@ -293,6 +293,8 @@
#define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */
#define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */
@@ -27,916 +27,31 @@ diff -urN linux-2.6.19.old/include/linux/rtnetlink.h linux-2.6.19.dev/include/li
/* Macros to handle hexthops */
-diff -urN linux-2.6.19.old/include/net/flow.h linux-2.6.19.dev/include/net/flow.h
---- linux-2.6.19.old/include/net/flow.h 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/include/net/flow.h 2006-12-14 03:13:53.000000000 +0100
+diff -urN linux-2.6.21.1/include/net/flow.h linux-2.6.21.1.new/include/net/flow.h
+--- linux-2.6.21.1/include/net/flow.h 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1.new/include/net/flow.h 2007-05-14 13:00:27.000000000 +0200
@@ -19,6 +19,8 @@
+ struct {
__be32 daddr;
__be32 saddr;
- __u32 fwmark;
+ __u32 lsrc;
+ __u32 gw;
__u8 tos;
__u8 scope;
} ip4_u;
-@@ -48,6 +50,8 @@
+@@ -43,6 +45,8 @@
+ #define fl6_flowlabel nl_u.ip6_u.flowlabel
#define fl4_dst nl_u.ip4_u.daddr
#define fl4_src nl_u.ip4_u.saddr
- #define fl4_fwmark nl_u.ip4_u.fwmark
-+#define fl4_lsrc nl_u.ip4_u.lsrc
++#define fl4_lsrc nl_u.ip4_u.lsrc
+#define fl4_gw nl_u.ip4_u.gw
#define fl4_tos nl_u.ip4_u.tos
#define fl4_scope nl_u.ip4_u.scope
-diff -urN linux-2.6.19.old/include/net/ip_fib.h linux-2.6.19.dev/include/net/ip_fib.h
---- linux-2.6.19.old/include/net/ip_fib.h 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/include/net/ip_fib.h 2006-12-14 03:13:53.000000000 +0100
-@@ -196,7 +196,8 @@
-
- static inline void fib_select_default(const struct flowi *flp, struct fib_result *res)
- {
-- if (FIB_RES_GW(*res) && FIB_RES_NH(*res).nh_scope == RT_SCOPE_LINK)
-+ if ((FIB_RES_GW(*res) && FIB_RES_NH(*res).nh_scope == RT_SCOPE_LINK) ||
-+ FIB_RES_NH(*res).nh_scope == RT_SCOPE_HOST)
- ip_fib_main_table->tb_select_default(ip_fib_main_table, flp, res);
- }
-
-@@ -212,6 +213,8 @@
-
- #endif /* CONFIG_IP_MULTIPLE_TABLES */
-
-+extern int fib_result_table(struct fib_result *res);
-+
- /* Exported by fib_frontend.c */
- extern struct nla_policy rtm_ipv4_policy[];
- extern void ip_fib_init(void);
-@@ -284,4 +287,6 @@
- extern void fib_proc_exit(void);
- #endif
-
-+extern rwlock_t fib_nhflags_lock;
-+
- #endif /* _NET_FIB_H */
-diff -urN linux-2.6.19.old/include/net/route.h linux-2.6.19.dev/include/net/route.h
---- linux-2.6.19.old/include/net/route.h 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/include/net/route.h 2006-12-14 03:13:53.000000000 +0100
-@@ -117,6 +117,7 @@
- extern int ip_route_output_key(struct rtable **, struct flowi *flp);
- extern int ip_route_output_flow(struct rtable **rp, struct flowi *flp, struct sock *sk, int flags);
- extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin);
-+extern int ip_route_input_lookup(struct sk_buff*, u32 dst, u32 src, u8 tos, struct net_device *devin, u32 lsrc);
- extern unsigned short ip_rt_frag_needed(struct iphdr *iph, unsigned short new_mtu);
- extern void ip_rt_send_redirect(struct sk_buff *skb);
-
-diff -urN linux-2.6.19.old/net/ipv4/fib_frontend.c linux-2.6.19.dev/net/ipv4/fib_frontend.c
---- linux-2.6.19.old/net/ipv4/fib_frontend.c 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/fib_frontend.c 2006-12-14 03:13:53.000000000 +0100
-@@ -58,6 +58,8 @@
- #define FIB_TABLE_HASHSZ 1
- static struct hlist_head fib_table_hash[FIB_TABLE_HASHSZ];
-
-+#define FIB_RES_TABLE(r) (RT_TABLE_MAIN)
-+
- #else
-
- #define FIB_TABLE_HASHSZ 256
-@@ -100,6 +102,9 @@
- rcu_read_unlock();
- return NULL;
- }
-+
-+#define FIB_RES_TABLE(r) (fib_result_table(r))
-+
- #endif /* CONFIG_IP_MULTIPLE_TABLES */
-
- static void fib_flush(void)
-@@ -190,6 +195,9 @@
- .tos = tos } },
- .iif = oif };
- struct fib_result res;
-+ int table;
-+ unsigned char prefixlen;
-+ unsigned char scope;
- int no_addr, rpf;
- int ret;
-
-@@ -211,31 +219,35 @@
- goto e_inval_res;
- *spec_dst = FIB_RES_PREFSRC(res);
- fib_combine_itag(itag, &res);
--#ifdef CONFIG_IP_ROUTE_MULTIPATH
-- if (FIB_RES_DEV(res) == dev || res.fi->fib_nhs > 1)
--#else
- if (FIB_RES_DEV(res) == dev)
--#endif
- {
- ret = FIB_RES_NH(res).nh_scope >= RT_SCOPE_HOST;
- fib_res_put(&res);
- return ret;
- }
-+ table = FIB_RES_TABLE(&res);
-+ prefixlen = res.prefixlen;
-+ scope = res.scope;
- fib_res_put(&res);
- if (no_addr)
- goto last_resort;
-- if (rpf)
-- goto e_inval;
- fl.oif = dev->ifindex;
-
- ret = 0;
- if (fib_lookup(&fl, &res) == 0) {
-- if (res.type == RTN_UNICAST) {
-+ if (res.type == RTN_UNICAST &&
-+ ((table == FIB_RES_TABLE(&res) &&
-+ res.prefixlen >= prefixlen && res.scope >= scope) ||
-+ !rpf)) {
- *spec_dst = FIB_RES_PREFSRC(res);
- ret = FIB_RES_NH(res).nh_scope >= RT_SCOPE_HOST;
-+ fib_res_put(&res);
-+ return ret;
- }
- fib_res_put(&res);
- }
-+ if (rpf)
-+ goto e_inval;
- return ret;
-
- last_resort:
-@@ -836,9 +848,7 @@
- switch (event) {
- case NETDEV_UP:
- fib_add_ifaddr(ifa);
--#ifdef CONFIG_IP_ROUTE_MULTIPATH
- fib_sync_up(ifa->ifa_dev->dev);
--#endif
- rt_cache_flush(-1);
- break;
- case NETDEV_DOWN:
-@@ -874,9 +884,7 @@
- for_ifa(in_dev) {
- fib_add_ifaddr(ifa);
- } endfor_ifa(in_dev);
--#ifdef CONFIG_IP_ROUTE_MULTIPATH
- fib_sync_up(dev);
--#endif
- rt_cache_flush(-1);
- break;
- case NETDEV_DOWN:
-diff -urN linux-2.6.19.old/net/ipv4/fib_hash.c linux-2.6.19.dev/net/ipv4/fib_hash.c
---- linux-2.6.19.old/net/ipv4/fib_hash.c 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/fib_hash.c 2006-12-14 03:13:53.000000000 +0100
-@@ -275,30 +275,38 @@
- return err;
- }
-
--static int fn_hash_last_dflt=-1;
--
- static void
- fn_hash_select_default(struct fib_table *tb, const struct flowi *flp, struct fib_result *res)
- {
-- int order, last_idx;
-+ int order, last_idx, last_dflt, last_nhsel;
-+ struct fib_alias *first_fa = NULL;
-+ struct hlist_head *head;
- struct hlist_node *node;
- struct fib_node *f;
- struct fib_info *fi = NULL;
- struct fib_info *last_resort;
- struct fn_hash *t = (struct fn_hash*)tb->tb_data;
-- struct fn_zone *fz = t->fn_zones[0];
-+ struct fn_zone *fz = t->fn_zones[res->prefixlen];
-+ u32 k;
-
- if (fz == NULL)
- return;
-
-+ k = fz_key(flp->fl4_dst, fz);
-+ last_dflt = -2;
-+ last_nhsel = 0;
- last_idx = -1;
- last_resort = NULL;
- order = -1;
-
- read_lock(&fib_hash_lock);
-- hlist_for_each_entry(f, node, &fz->fz_hash[0], fn_hash) {
-+ head = &fz->fz_hash[fn_hash(k, fz)];
-+ hlist_for_each_entry(f, node, head, fn_hash) {
- struct fib_alias *fa;
-
-+ if (f->fn_key != k)
-+ continue;
-+
- list_for_each_entry(fa, &f->fn_alias, fa_list) {
- struct fib_info *next_fi = fa->fa_info;
-
-@@ -306,41 +314,52 @@
- fa->fa_type != RTN_UNICAST)
- continue;
-
-+ if (fa->fa_tos &&
-+ fa->fa_tos != flp->fl4_tos)
-+ continue;
- if (next_fi->fib_priority > res->fi->fib_priority)
- break;
-- if (!next_fi->fib_nh[0].nh_gw ||
-- next_fi->fib_nh[0].nh_scope != RT_SCOPE_LINK)
-- continue;
- fa->fa_state |= FA_S_ACCESSED;
-
-- if (fi == NULL) {
-- if (next_fi != res->fi)
-- break;
-- } else if (!fib_detect_death(fi, order, &last_resort,
-- &last_idx, &fn_hash_last_dflt)) {
-+ if (!first_fa) {
-+ last_dflt = fa->fa_last_dflt;
-+ first_fa = fa;
-+ }
-+ if (fi && !fib_detect_death(fi, order, &last_resort,
-+ &last_idx, &last_dflt, &last_nhsel, flp)) {
- if (res->fi)
- fib_info_put(res->fi);
- res->fi = fi;
- atomic_inc(&fi->fib_clntref);
-- fn_hash_last_dflt = order;
-+ first_fa->fa_last_dflt = order;
- goto out;
- }
- fi = next_fi;
- order++;
- }
-+ break;
- }
-
- if (order <= 0 || fi == NULL) {
-- fn_hash_last_dflt = -1;
-+ if (fi && fi->fib_nhs > 1 &&
-+ fib_detect_death(fi, order, &last_resort, &last_idx,
-+ &last_dflt, &last_nhsel, flp) &&
-+ last_resort == fi) {
-+ read_lock_bh(&fib_nhflags_lock);
-+ fi->fib_nh[last_nhsel].nh_flags &= ~RTNH_F_SUSPECT;
-+ read_unlock_bh(&fib_nhflags_lock);
-+ }
-+ if (first_fa) first_fa->fa_last_dflt = -1;
- goto out;
- }
-
-- if (!fib_detect_death(fi, order, &last_resort, &last_idx, &fn_hash_last_dflt)) {
-+ if (!fib_detect_death(fi, order, &last_resort, &last_idx,
-+ &last_dflt, &last_nhsel, flp)) {
- if (res->fi)
- fib_info_put(res->fi);
- res->fi = fi;
- atomic_inc(&fi->fib_clntref);
-- fn_hash_last_dflt = order;
-+ first_fa->fa_last_dflt = order;
- goto out;
- }
-
-@@ -350,8 +369,11 @@
- res->fi = last_resort;
- if (last_resort)
- atomic_inc(&last_resort->fib_clntref);
-+ read_lock_bh(&fib_nhflags_lock);
-+ last_resort->fib_nh[last_nhsel].nh_flags &= ~RTNH_F_SUSPECT;
-+ read_unlock_bh(&fib_nhflags_lock);
-+ first_fa->fa_last_dflt = last_idx;
- }
-- fn_hash_last_dflt = last_idx;
- out:
- read_unlock(&fib_hash_lock);
- }
-@@ -447,6 +469,7 @@
- write_lock_bh(&fib_hash_lock);
- fi_drop = fa->fa_info;
- fa->fa_info = fi;
-+ fa->fa_last_dflt = -1;
- fa->fa_type = cfg->fc_type;
- fa->fa_scope = cfg->fc_scope;
- state = fa->fa_state;
-@@ -506,6 +529,7 @@
- new_fa->fa_type = cfg->fc_type;
- new_fa->fa_scope = cfg->fc_scope;
- new_fa->fa_state = 0;
-+ new_fa->fa_last_dflt = -1;
-
- /*
- * Insert new entry to the list.
-diff -urN linux-2.6.19.old/net/ipv4/fib_lookup.h linux-2.6.19.dev/net/ipv4/fib_lookup.h
---- linux-2.6.19.old/net/ipv4/fib_lookup.h 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/fib_lookup.h 2006-12-14 03:13:53.000000000 +0100
-@@ -9,6 +9,7 @@
- struct list_head fa_list;
- struct rcu_head rcu;
- struct fib_info *fa_info;
-+ int fa_last_dflt;
- u8 fa_tos;
- u8 fa_type;
- u8 fa_scope;
-@@ -35,6 +36,7 @@
- u8 tos, u32 prio);
- extern int fib_detect_death(struct fib_info *fi, int order,
- struct fib_info **last_resort,
-- int *last_idx, int *dflt);
-+ int *last_idx, int *dflt, int *last_nhsel,
-+ const struct flowi *flp);
-
- #endif /* _FIB_LOOKUP_H */
-diff -urN linux-2.6.19.old/net/ipv4/fib_rules.c linux-2.6.19.dev/net/ipv4/fib_rules.c
---- linux-2.6.19.old/net/ipv4/fib_rules.c 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/fib_rules.c 2006-12-14 03:13:53.000000000 +0100
-@@ -89,6 +89,11 @@
- }
- #endif
-
-+int fib_result_table(struct fib_result *res)
-+{
-+ return res->r->table;
-+}
-+
- int fib_lookup(struct flowi *flp, struct fib_result *res)
- {
- struct fib_lookup_arg arg = {
-@@ -140,7 +145,8 @@
- void fib_select_default(const struct flowi *flp, struct fib_result *res)
- {
- if (res->r && res->r->action == FR_ACT_TO_TBL &&
-- FIB_RES_GW(*res) && FIB_RES_NH(*res).nh_scope == RT_SCOPE_LINK) {
-+ ((FIB_RES_GW(*res) && FIB_RES_NH(*res).nh_scope == RT_SCOPE_LINK) ||
-+ FIB_RES_NH(*res).nh_scope == RT_SCOPE_HOST)) {
- struct fib_table *tb;
- if ((tb = fib_get_table(res->r->table)) != NULL)
- tb->tb_select_default(tb, flp, res);
-diff -urN linux-2.6.19.old/net/ipv4/fib_semantics.c linux-2.6.19.dev/net/ipv4/fib_semantics.c
---- linux-2.6.19.old/net/ipv4/fib_semantics.c 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/fib_semantics.c 2006-12-14 03:13:53.000000000 +0100
-@@ -55,6 +55,7 @@
- static struct hlist_head *fib_info_laddrhash;
- static unsigned int fib_hash_size;
- static unsigned int fib_info_cnt;
-+rwlock_t fib_nhflags_lock = RW_LOCK_UNLOCKED;
-
- #define DEVINDEX_HASHBITS 8
- #define DEVINDEX_HASHSIZE (1U << DEVINDEX_HASHBITS)
-@@ -190,7 +191,7 @@
- #ifdef CONFIG_NET_CLS_ROUTE
- nh->nh_tclassid != onh->nh_tclassid ||
- #endif
-- ((nh->nh_flags^onh->nh_flags)&~RTNH_F_DEAD))
-+ ((nh->nh_flags^onh->nh_flags)&~RTNH_F_BADSTATE))
- return -1;
- onh++;
- } endfor_nexthops(fi);
-@@ -227,7 +228,7 @@
- nfi->fib_priority == fi->fib_priority &&
- memcmp(nfi->fib_metrics, fi->fib_metrics,
- sizeof(fi->fib_metrics)) == 0 &&
-- ((nfi->fib_flags^fi->fib_flags)&~RTNH_F_DEAD) == 0 &&
-+ ((nfi->fib_flags^fi->fib_flags)&~RTNH_F_BADSTATE) == 0 &&
- (nfi->fib_nhs == 0 || nh_comp(fi, nfi) == 0))
- return fi;
- }
-@@ -319,26 +320,70 @@
- }
-
- int fib_detect_death(struct fib_info *fi, int order,
-- struct fib_info **last_resort, int *last_idx, int *dflt)
-+ struct fib_info **last_resort, int *last_idx, int *dflt,
-+ int *last_nhsel, const struct flowi *flp)
- {
- struct neighbour *n;
-- int state = NUD_NONE;
-+ int nhsel;
-+ int state;
-+ struct fib_nh * nh;
-+ u32 dst;
-+ int flag, dead = 1;
-+
-+ /* change_nexthops(fi) { */
-+ for (nhsel = 0, nh = fi->fib_nh; nhsel < fi->fib_nhs; nh++, nhsel++) {
-+ if (flp->oif && flp->oif != nh->nh_oif)
-+ continue;
-+ if (flp->fl4_gw && flp->fl4_gw != nh->nh_gw && nh->nh_gw &&
-+ nh->nh_scope == RT_SCOPE_LINK)
-+ continue;
-+ if (nh->nh_flags & RTNH_F_DEAD)
-+ continue;
-
-- n = neigh_lookup(&arp_tbl, &fi->fib_nh[0].nh_gw, fi->fib_dev);
-- if (n) {
-- state = n->nud_state;
-- neigh_release(n);
-- }
-- if (state==NUD_REACHABLE)
-- return 0;
-- if ((state&NUD_VALID) && order != *dflt)
-- return 0;
-- if ((state&NUD_VALID) ||
-- (*last_idx<0 && order > *dflt)) {
-- *last_resort = fi;
-- *last_idx = order;
-+ flag = 0;
-+ if (nh->nh_dev->flags & IFF_NOARP) {
-+ dead = 0;
-+ goto setfl;
-+ }
-+
-+ dst = nh->nh_gw;
-+ if (!nh->nh_gw || nh->nh_scope != RT_SCOPE_LINK)
-+ dst = flp->fl4_dst;
-+
-+ state = NUD_NONE;
-+ n = neigh_lookup(&arp_tbl, &dst, nh->nh_dev);
-+ if (n) {
-+ state = n->nud_state;
-+ neigh_release(n);
-+ }
-+ if (state==NUD_REACHABLE ||
-+ ((state&NUD_VALID) && order != *dflt)) {
-+ dead = 0;
-+ goto setfl;
-+ }
-+ if (!(state&NUD_VALID))
-+ flag = 1;
-+ if (!dead)
-+ goto setfl;
-+ if ((state&NUD_VALID) ||
-+ (*last_idx<0 && order >= *dflt)) {
-+ *last_resort = fi;
-+ *last_idx = order;
-+ *last_nhsel = nhsel;
-+ }
-+
-+ setfl:
-+
-+ read_lock_bh(&fib_nhflags_lock);
-+ if (flag)
-+ nh->nh_flags |= RTNH_F_SUSPECT;
-+ else
-+ nh->nh_flags &= ~RTNH_F_SUSPECT;
-+ read_unlock_bh(&fib_nhflags_lock);
- }
-- return 1;
-+ /* } endfor_nexthops(fi) */
-+
-+ return dead;
- }
-
- #ifdef CONFIG_IP_ROUTE_MULTIPATH
-@@ -508,8 +553,11 @@
- return -EINVAL;
- if ((dev = __dev_get_by_index(nh->nh_oif)) == NULL)
- return -ENODEV;
-- if (!(dev->flags&IFF_UP))
-- return -ENETDOWN;
-+ if (!(dev->flags&IFF_UP)) {
-+ if (fi->fib_protocol != RTPROT_STATIC)
-+ return -ENETDOWN;
-+ nh->nh_flags |= RTNH_F_DEAD;
-+ }
- nh->nh_dev = dev;
- dev_hold(dev);
- nh->nh_scope = RT_SCOPE_LINK;
-@@ -529,24 +577,48 @@
- /* It is not necessary, but requires a bit of thinking */
- if (fl.fl4_scope < RT_SCOPE_LINK)
- fl.fl4_scope = RT_SCOPE_LINK;
-- if ((err = fib_lookup(&fl, &res)) != 0)
-- return err;
-+ err = fib_lookup(&fl, &res);
- }
-- err = -EINVAL;
-- if (res.type != RTN_UNICAST && res.type != RTN_LOCAL)
-- goto out;
-- nh->nh_scope = res.scope;
-- nh->nh_oif = FIB_RES_OIF(res);
-- if ((nh->nh_dev = FIB_RES_DEV(res)) == NULL)
-- goto out;
-- dev_hold(nh->nh_dev);
-- err = -ENETDOWN;
-- if (!(nh->nh_dev->flags & IFF_UP))
-- goto out;
-- err = 0;
-+ if (err) {
-+ struct in_device *in_dev;
-+
-+ if (err != -ENETUNREACH ||
-+ fi->fib_protocol != RTPROT_STATIC)
-+ return err;
-+
-+ in_dev = inetdev_by_index(nh->nh_oif);
-+ if (in_dev == NULL ||
-+ in_dev->dev->flags & IFF_UP) {
-+ if (in_dev)
-+ in_dev_put(in_dev);
-+ return err;
-+ }
-+ nh->nh_flags |= RTNH_F_DEAD;
-+ nh->nh_scope = RT_SCOPE_LINK;
-+ nh->nh_dev = in_dev->dev;
-+ dev_hold(nh->nh_dev);
-+ in_dev_put(in_dev);
-+ } else {
-+ err = -EINVAL;
-+ if (res.type != RTN_UNICAST && res.type != RTN_LOCAL)
-+ goto out;
-+ nh->nh_scope = res.scope;
-+ nh->nh_oif = FIB_RES_OIF(res);
-+ if ((nh->nh_dev = FIB_RES_DEV(res)) == NULL)
-+ goto out;
-+ dev_hold(nh->nh_dev);
-+ if (!(nh->nh_dev->flags & IFF_UP)) {
-+ if (fi->fib_protocol != RTPROT_STATIC) {
-+ err = -ENETDOWN;
-+ goto out;
-+ }
-+ nh->nh_flags |= RTNH_F_DEAD;
-+ }
-+ err = 0;
- out:
-- fib_res_put(&res);
-- return err;
-+ fib_res_put(&res);
-+ return err;
-+ }
- } else {
- struct in_device *in_dev;
-
-@@ -557,8 +629,11 @@
- if (in_dev == NULL)
- return -ENODEV;
- if (!(in_dev->dev->flags&IFF_UP)) {
-- in_dev_put(in_dev);
-- return -ENETDOWN;
-+ if (fi->fib_protocol != RTPROT_STATIC) {
-+ in_dev_put(in_dev);
-+ return -ENETDOWN;
-+ }
-+ nh->nh_flags |= RTNH_F_DEAD;
- }
- nh->nh_dev = in_dev->dev;
- dev_hold(nh->nh_dev);
-@@ -881,8 +956,12 @@
- for_nexthops(fi) {
- if (nh->nh_flags&RTNH_F_DEAD)
- continue;
-- if (!flp->oif || flp->oif == nh->nh_oif)
-- break;
-+ if (flp->oif && flp->oif != nh->nh_oif)
-+ continue;
-+ if (flp->fl4_gw && flp->fl4_gw != nh->nh_gw &&
-+ nh->nh_gw && nh->nh_scope == RT_SCOPE_LINK)
-+ continue;
-+ break;
- }
- #ifdef CONFIG_IP_ROUTE_MULTIPATH
- if (nhsel < fi->fib_nhs) {
-@@ -1056,18 +1135,29 @@
- prev_fi = fi;
- dead = 0;
- change_nexthops(fi) {
-- if (nh->nh_flags&RTNH_F_DEAD)
-- dead++;
-- else if (nh->nh_dev == dev &&
-- nh->nh_scope != scope) {
-- nh->nh_flags |= RTNH_F_DEAD;
-+ if (nh->nh_flags&RTNH_F_DEAD) {
-+ if (fi->fib_protocol!=RTPROT_STATIC ||
-+ nh->nh_dev == NULL ||
-+ __in_dev_get_rtnl(nh->nh_dev) == NULL ||
-+ nh->nh_dev->flags&IFF_UP)
-+ dead++;
-+ } else if (nh->nh_dev == dev &&
-+ nh->nh_scope != scope) {
-+ write_lock_bh(&fib_nhflags_lock);
- #ifdef CONFIG_IP_ROUTE_MULTIPATH
-- spin_lock_bh(&fib_multipath_lock);
-+ spin_lock(&fib_multipath_lock);
-+ nh->nh_flags |= RTNH_F_DEAD;
- fi->fib_power -= nh->nh_power;
- nh->nh_power = 0;
-- spin_unlock_bh(&fib_multipath_lock);
-+ spin_unlock(&fib_multipath_lock);
-+#else
-+ nh->nh_flags |= RTNH_F_DEAD;
- #endif
-- dead++;
-+ write_unlock_bh(&fib_nhflags_lock);
-+ if (fi->fib_protocol!=RTPROT_STATIC ||
-+ force ||
-+ __in_dev_get_rtnl(dev) == NULL)
-+ dead++;
- }
- #ifdef CONFIG_IP_ROUTE_MULTIPATH
- if (force > 1 && nh->nh_dev == dev) {
-@@ -1086,11 +1176,8 @@
- return ret;
- }
-
--#ifdef CONFIG_IP_ROUTE_MULTIPATH
--
- /*
-- Dead device goes up. We wake up dead nexthops.
-- It takes sense only on multipath routes.
-+ Dead device goes up or new address is added. We wake up dead nexthops.
- */
-
- int fib_sync_up(struct net_device *dev)
-@@ -1100,8 +1187,10 @@
- struct hlist_head *head;
- struct hlist_node *node;
- struct fib_nh *nh;
-- int ret;
-+ struct fib_result res;
-+ int ret, rep;
-
-+repeat:
- if (!(dev->flags&IFF_UP))
- return 0;
-
-@@ -1109,6 +1198,7 @@
- hash = fib_devindex_hashfn(dev->ifindex);
- head = &fib_info_devhash[hash];
- ret = 0;
-+ rep = 0;
-
- hlist_for_each_entry(nh, node, head, nh_hash) {
- struct fib_info *fi = nh->nh_parent;
-@@ -1121,19 +1211,37 @@
- prev_fi = fi;
- alive = 0;
- change_nexthops(fi) {
-- if (!(nh->nh_flags&RTNH_F_DEAD)) {
-- alive++;
-+ if (!(nh->nh_flags&RTNH_F_DEAD))
- continue;
-- }
- if (nh->nh_dev == NULL || !(nh->nh_dev->flags&IFF_UP))
- continue;
- if (nh->nh_dev != dev || !__in_dev_get_rtnl(dev))
- continue;
-+ if (nh->nh_gw && fi->fib_protocol == RTPROT_STATIC) {
-+ struct flowi fl = {
-+ .nl_u = { .ip4_u =
-+ { .daddr = nh->nh_gw,
-+ .scope = nh->nh_scope } },
-+ .oif = nh->nh_oif,
-+ };
-+ if (fib_lookup(&fl, &res) != 0)
-+ continue;
-+ if (res.type != RTN_UNICAST &&
-+ res.type != RTN_LOCAL) {
-+ fib_res_put(&res);
-+ continue;
-+ }
-+ nh->nh_scope = res.scope;
-+ fib_res_put(&res);
-+ rep = 1;
-+ }
- alive++;
-+#ifdef CONFIG_IP_ROUTE_MULTIPATH
- spin_lock_bh(&fib_multipath_lock);
- nh->nh_power = 0;
- nh->nh_flags &= ~RTNH_F_DEAD;
- spin_unlock_bh(&fib_multipath_lock);
-+#endif
- } endfor_nexthops(fi)
-
- if (alive > 0) {
-@@ -1141,10 +1249,14 @@
- ret++;
- }
- }
-+ if (rep)
-+ goto repeat;
-
- return ret;
- }
-
-+#ifdef CONFIG_IP_ROUTE_MULTIPATH
-+
- /*
- The algorithm is suboptimal, but it provides really
- fair weighted route distribution.
-@@ -1153,24 +1265,45 @@
- void fib_select_multipath(const struct flowi *flp, struct fib_result *res)
- {
- struct fib_info *fi = res->fi;
-- int w;
-+ int w, alive;
-
- spin_lock_bh(&fib_multipath_lock);
-+ if (flp->oif) {
-+ int sel = -1;
-+ w = -1;
-+ change_nexthops(fi) {
-+ if (flp->oif != nh->nh_oif)
-+ continue;
-+ if (flp->fl4_gw && flp->fl4_gw != nh->nh_gw &&
-+ nh->nh_gw && nh->nh_scope == RT_SCOPE_LINK)
-+ continue;
-+ if (!(nh->nh_flags&RTNH_F_BADSTATE)) {
-+ if (nh->nh_power > w) {
-+ w = nh->nh_power;
-+ sel = nhsel;
-+ }
-+ }
-+ } endfor_nexthops(fi);
-+ if (sel >= 0) {
-+ spin_unlock_bh(&fib_multipath_lock);
-+ res->nh_sel = sel;
-+ return;
-+ }
-+ goto last_resort;
-+ }
-+
-+repeat:
- if (fi->fib_power <= 0) {
- int power = 0;
- change_nexthops(fi) {
-- if (!(nh->nh_flags&RTNH_F_DEAD)) {
-+ if (!(nh->nh_flags&RTNH_F_BADSTATE)) {
- power += nh->nh_weight;
- nh->nh_power = nh->nh_weight;
- }
- } endfor_nexthops(fi);
- fi->fib_power = power;
-- if (power <= 0) {
-- spin_unlock_bh(&fib_multipath_lock);
-- /* Race condition: route has just become dead. */
-- res->nh_sel = 0;
-- return;
-- }
-+ if (power <= 0)
-+ goto last_resort;
- }
-
-
-@@ -1180,20 +1313,40 @@
-
- w = jiffies % fi->fib_power;
-
-+ alive = 0;
- change_nexthops(fi) {
-- if (!(nh->nh_flags&RTNH_F_DEAD) && nh->nh_power) {
-+ if (!(nh->nh_flags&RTNH_F_BADSTATE) && nh->nh_power) {
- if ((w -= nh->nh_power) <= 0) {
- nh->nh_power--;
- fi->fib_power--;
-- res->nh_sel = nhsel;
- spin_unlock_bh(&fib_multipath_lock);
-+ res->nh_sel = nhsel;
- return;
- }
-+ alive = 1;
-+ }
-+ } endfor_nexthops(fi);
-+ if (alive) {
-+ fi->fib_power = 0;
-+ goto repeat;
-+ }
-+
-+last_resort:
-+
-+ for_nexthops(fi) {
-+ if (!(nh->nh_flags&RTNH_F_DEAD)) {
-+ if (flp->oif && flp->oif != nh->nh_oif)
-+ continue;
-+ if (flp->fl4_gw && flp->fl4_gw != nh->nh_gw &&
-+ nh->nh_gw && nh->nh_scope == RT_SCOPE_LINK)
-+ continue;
-+ spin_unlock_bh(&fib_multipath_lock);
-+ res->nh_sel = nhsel;
-+ return;
- }
- } endfor_nexthops(fi);
-
- /* Race condition: route has just become dead. */
-- res->nh_sel = 0;
- spin_unlock_bh(&fib_multipath_lock);
- }
- #endif
-diff -urN linux-2.6.19.old/net/ipv4/netfilter/ip_nat_core.c linux-2.6.19.dev/net/ipv4/netfilter/ip_nat_core.c
---- linux-2.6.19.old/net/ipv4/netfilter/ip_nat_core.c 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/netfilter/ip_nat_core.c 2006-12-14 03:13:53.000000000 +0100
-@@ -573,6 +573,53 @@
- EXPORT_SYMBOL_GPL(ip_nat_port_range_to_nfattr);
- #endif
-
-+unsigned int
-+ip_nat_route_input(unsigned int hooknum,
-+ struct sk_buff **pskb,
-+ const struct net_device *in,
-+ const struct net_device *out,
-+ int (*okfn)(struct sk_buff *))
-+{
-+ struct sk_buff *skb = *pskb;
-+ struct iphdr *iph;
-+ struct ip_conntrack *conn;
-+ enum ip_conntrack_info ctinfo;
-+ enum ip_conntrack_dir dir;
-+ unsigned long statusbit;
-+ u32 saddr;
-+
-+ if (!(conn = ip_conntrack_get(skb, &ctinfo)))
-+ return NF_ACCEPT;
-+
-+ if (!(conn->status & IPS_NAT_DONE_MASK))
-+ return NF_ACCEPT;
-+ dir = CTINFO2DIR(ctinfo);
-+ statusbit = IPS_SRC_NAT;
-+ if (dir == IP_CT_DIR_REPLY)
-+ statusbit ^= IPS_NAT_MASK;
-+ if (!(conn->status & statusbit))
-+ return NF_ACCEPT;
-+
-+ if (skb->dst)
-+ return NF_ACCEPT;
-+
-+ if (skb->len < sizeof(struct iphdr))
-+ return NF_ACCEPT;
-+
-+ /* use daddr in other direction as masquerade address (lsrc) */
-+ iph = skb->nh.iph;
-+ saddr = conn->tuplehash[!dir].tuple.dst.ip;
-+ if (saddr == iph->saddr)
-+ return NF_ACCEPT;
-+
-+ if (ip_route_input_lookup(skb, iph->daddr, iph->saddr, iph->tos,
-+ skb->dev, saddr))
-+ return NF_DROP;
-+
-+ return NF_ACCEPT;
-+}
-+EXPORT_SYMBOL_GPL(ip_nat_route_input);
-+
- static int __init ip_nat_init(void)
- {
- size_t i;
-diff -urN linux-2.6.19.old/net/ipv4/netfilter/ip_nat_standalone.c linux-2.6.19.dev/net/ipv4/netfilter/ip_nat_standalone.c
---- linux-2.6.19.old/net/ipv4/netfilter/ip_nat_standalone.c 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/netfilter/ip_nat_standalone.c 2006-12-14 03:13:53.000000000 +0100
-@@ -325,6 +325,14 @@
- .hooknum = NF_IP_LOCAL_OUT,
- .priority = NF_IP_PRI_NAT_DST,
- },
-+ /* Before routing, route before mangling */
-+ {
-+ .hook = ip_nat_route_input,
-+ .owner = THIS_MODULE,
-+ .pf = PF_INET,
-+ .hooknum = NF_IP_PRE_ROUTING,
-+ .priority = NF_IP_PRI_LAST-1,
-+ },
- /* After packet filtering, change source */
- {
- .hook = ip_nat_fn,
-diff -urN linux-2.6.19.old/net/ipv4/netfilter/ipt_MASQUERADE.c linux-2.6.19.dev/net/ipv4/netfilter/ipt_MASQUERADE.c
---- linux-2.6.19.old/net/ipv4/netfilter/ipt_MASQUERADE.c 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/netfilter/ipt_MASQUERADE.c 2006-12-14 03:13:53.000000000 +0100
-@@ -85,13 +85,31 @@
- return NF_ACCEPT;
-
- mr = targinfo;
-- rt = (struct rtable *)(*pskb)->dst;
-- newsrc = inet_select_addr(out, rt->rt_gateway, RT_SCOPE_UNIVERSE);
-- if (!newsrc) {
-- printk("MASQUERADE: %s ate my IP address\n", out->name);
-- return NF_DROP;
-+
-+ {
-+ struct flowi fl = { .nl_u = { .ip4_u =
-+ { .daddr = (*pskb)->nh.iph->daddr,
-+ .tos = (RT_TOS((*pskb)->nh.iph->tos) |
-+ RTO_CONN),
-+ .gw = ((struct rtable *) (*pskb)->dst)->rt_gateway,
-+#ifdef CONFIG_IP_ROUTE_FWMARK
-+ .fwmark = (*pskb)->nfmark
-+#endif
-+ } },
-+ .oif = out->ifindex };
-+ if (ip_route_output_key(&rt, &fl) != 0) {
-+ /* Funky routing can do this. */
-+ if (net_ratelimit())
-+ printk("MASQUERADE:"
-+ " No route: Rusty's brain broke!\n");
-+ return NF_DROP;
-+ }
- }
-
-+ newsrc = rt->rt_src;
-+ DEBUGP("newsrc = %u.%u.%u.%u\n", NIPQUAD(newsrc));
-+ ip_rt_put(rt);
-+
- write_lock_bh(&masq_lock);
- ct->nat.masq_index = out->ifindex;
- write_unlock_bh(&masq_lock);
-diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
---- linux-2.6.19.old/net/ipv4/route.c 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/net/ipv4/route.c 2006-12-14 03:13:53.000000000 +0100
-@@ -1211,6 +1211,7 @@
+diff -urN linux-2.6.21.1/net/ipv4/route.c linux-2.6.21.1.new/net/ipv4/route.c
+--- linux-2.6.21.1/net/ipv4/route.c 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1.new/net/ipv4/route.c 2007-05-14 13:09:24.000000000 +0200
+@@ -1208,6 +1208,7 @@
/* Gateway is different ... */
rt->rt_gateway = new_gw;
@@ -944,15 +59,15 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
/* Redirect received -> path was valid */
dst_confirm(&rth->u.dst);
-@@ -1647,6 +1648,7 @@
- rth->fl.fl4_fwmark= skb->nfmark;
- #endif
+@@ -1643,6 +1644,7 @@
+ rth->fl.fl4_tos = tos;
+ rth->fl.mark = skb->mark;
rth->fl.fl4_src = saddr;
+ rth->fl.fl4_lsrc = 0;
rth->rt_src = saddr;
#ifdef CONFIG_NET_CLS_ROUTE
rth->u.dst.tclassid = itag;
-@@ -1657,6 +1659,7 @@
+@@ -1653,6 +1655,7 @@
dev_hold(rth->u.dst.dev);
rth->idev = in_dev_get(rth->u.dst.dev);
rth->fl.oif = 0;
@@ -960,16 +75,16 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
rth->rt_gateway = daddr;
rth->rt_spec_dst= spec_dst;
rth->rt_type = RTN_MULTICAST;
-@@ -1721,7 +1724,7 @@
- struct fib_result* res,
- struct in_device *in_dev,
- __be32 daddr, __be32 saddr, u32 tos,
-- struct rtable **result)
-+ u32 lsrc, struct rtable **result)
+@@ -1716,7 +1719,7 @@
+ static inline int __mkroute_input(struct sk_buff *skb,
+ struct fib_result* res,
+ struct in_device *in_dev,
+- __be32 daddr, __be32 saddr, u32 tos,
++ __be32 daddr, __be32 saddr, u32 tos, u32 lsrc,
+ struct rtable **result)
{
- struct rtable *rth;
-@@ -1755,6 +1758,7 @@
+@@ -1751,6 +1754,7 @@
flags |= RTCF_DIRECTSRC;
if (out_dev == in_dev && err && !(flags & (RTCF_NAT | RTCF_MASQ)) &&
@@ -977,15 +92,15 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
(IN_DEV_SHARED_MEDIA(out_dev) ||
inet_addr_onlink(out_dev, saddr, FIB_RES_GW(*res))))
flags |= RTCF_DOREDIRECT;
-@@ -1794,6 +1798,7 @@
- #endif
+@@ -1788,6 +1792,7 @@
+ rth->fl.mark = skb->mark;
rth->fl.fl4_src = saddr;
rth->rt_src = saddr;
+ rth->fl.fl4_lsrc = lsrc;
rth->rt_gateway = daddr;
rth->rt_iif =
rth->fl.iif = in_dev->dev->ifindex;
-@@ -1801,6 +1806,7 @@
+@@ -1795,6 +1800,7 @@
dev_hold(rth->u.dst.dev);
rth->idev = in_dev_get(rth->u.dst.dev);
rth->fl.oif = 0;
@@ -993,8 +108,8 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
rth->rt_spec_dst= spec_dst;
rth->u.dst.input = ip_forward;
-@@ -1822,19 +1828,21 @@
- struct fib_result* res,
+@@ -1816,19 +1822,21 @@
+ struct fib_result* res,
const struct flowi *fl,
struct in_device *in_dev,
- __be32 daddr, __be32 saddr, u32 tos)
@@ -1018,8 +133,8 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
if (err)
return err;
-@@ -1847,7 +1855,8 @@
- struct fib_result* res,
+@@ -1841,7 +1849,8 @@
+ struct fib_result* res,
const struct flowi *fl,
struct in_device *in_dev,
- __be32 daddr, __be32 saddr, u32 tos)
@@ -1028,16 +143,16 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
{
#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
struct rtable* rth = NULL, *rtres;
-@@ -1863,7 +1872,7 @@
+@@ -1857,7 +1866,7 @@
/* distinguish between multipath and singlepath */
if (hopcount < 2)
return ip_mkroute_input_def(skb, res, fl, in_dev, daddr,
- saddr, tos);
+ saddr, tos, 0);
-
+
/* add all alternatives to the routing cache */
for (hop = 0; hop < hopcount; hop++) {
-@@ -1875,7 +1884,7 @@
+@@ -1869,7 +1878,7 @@
/* create a routing cache entry */
err = __mkroute_input(skb, res, in_dev, daddr, saddr, tos,
@@ -1046,7 +161,7 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
if (err)
return err;
-@@ -1895,7 +1904,7 @@
+@@ -1889,7 +1898,7 @@
skb->dst = &rtres->u.dst;
return err;
#else /* CONFIG_IP_ROUTE_MULTIPATH_CACHED */
@@ -1055,7 +170,7 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
#endif /* CONFIG_IP_ROUTE_MULTIPATH_CACHED */
}
-@@ -1911,20 +1920,20 @@
+@@ -1905,18 +1914,18 @@
*/
static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
@@ -1067,19 +182,17 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
struct flowi fl = { .nl_u = { .ip4_u =
{ .daddr = daddr,
- .saddr = saddr,
-+ .saddr = lsrc? : saddr,
++ .saddr = lsrc ? : saddr,
.tos = tos,
.scope = RT_SCOPE_UNIVERSE,
- #ifdef CONFIG_IP_ROUTE_FWMARK
- .fwmark = skb->nfmark
- #endif
} },
+ .mark = skb->mark,
- .iif = dev->ifindex };
+ .iif = lsrc? loopback_dev.ifindex : dev->ifindex };
unsigned flags = 0;
u32 itag = 0;
struct rtable * rth;
-@@ -1957,6 +1966,12 @@
+@@ -1949,6 +1958,12 @@
if (BADCLASS(daddr) || ZERONET(daddr) || LOOPBACK(daddr))
goto martian_destination;
@@ -1092,7 +205,7 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
/*
* Now we are ready to route packet.
*/
-@@ -1966,6 +1981,10 @@
+@@ -1958,6 +1973,10 @@
goto no_route;
}
free_res = 1;
@@ -1103,7 +216,7 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
RT_CACHE_STAT_INC(in_slow_tot);
-@@ -1990,7 +2009,7 @@
+@@ -1982,7 +2001,7 @@
if (res.type != RTN_UNICAST)
goto martian_destination;
@@ -1112,7 +225,7 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
if (err == -ENOBUFS)
goto e_nobufs;
if (err == -EINVAL)
-@@ -2005,6 +2024,8 @@
+@@ -1997,6 +2016,8 @@
brd_input:
if (skb->protocol != htons(ETH_P_IP))
goto e_inval;
@@ -1121,7 +234,7 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
if (ZERONET(saddr))
spec_dst = inet_select_addr(dev, 0, RT_SCOPE_LINK);
-@@ -2047,6 +2068,7 @@
+@@ -2037,6 +2058,7 @@
rth->u.dst.dev = &loopback_dev;
dev_hold(rth->u.dst.dev);
rth->idev = in_dev_get(rth->u.dst.dev);
@@ -1129,7 +242,7 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
rth->rt_gateway = daddr;
rth->rt_spec_dst= spec_dst;
rth->u.dst.input= ip_local_deliver;
-@@ -2096,8 +2118,9 @@
+@@ -2086,8 +2108,9 @@
goto e_inval;
}
@@ -1141,15 +254,15 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
{
struct rtable * rth;
unsigned hash;
-@@ -2112,6 +2135,7 @@
+@@ -2102,6 +2125,7 @@
if (rth->fl.fl4_dst == daddr &&
rth->fl.fl4_src == saddr &&
rth->fl.iif == iif &&
+ rth->fl.fl4_lsrc == lsrc &&
rth->fl.oif == 0 &&
- #ifdef CONFIG_IP_ROUTE_FWMARK
- rth->fl.fl4_fwmark == skb->nfmark &&
-@@ -2160,7 +2184,19 @@
+ rth->fl.mark == skb->mark &&
+ rth->fl.fl4_tos == tos) {
+@@ -2148,7 +2172,19 @@
rcu_read_unlock();
return -EINVAL;
}
@@ -1170,15 +283,15 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
}
static inline int __mkroute_output(struct rtable **result,
-@@ -2239,6 +2275,7 @@
+@@ -2227,6 +2263,7 @@
rth->fl.fl4_tos = tos;
rth->fl.fl4_src = oldflp->fl4_src;
rth->fl.oif = oldflp->oif;
-+ rth->fl.fl4_gw = oldflp->fl4_gw;
- #ifdef CONFIG_IP_ROUTE_FWMARK
- rth->fl.fl4_fwmark= oldflp->fl4_fwmark;
- #endif
-@@ -2381,6 +2418,7 @@
++ rth->fl.fl4_gw = oldflp->fl4_gw;
+ rth->fl.mark = oldflp->mark;
+ rth->rt_dst = fl->fl4_dst;
+ rth->rt_src = fl->fl4_src;
+@@ -2367,6 +2404,7 @@
struct flowi fl = { .nl_u = { .ip4_u =
{ .daddr = oldflp->fl4_dst,
.saddr = oldflp->fl4_src,
@@ -1186,7 +299,7 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
.tos = tos & IPTOS_RT_MASK,
.scope = ((tos & RTO_ONLINK) ?
RT_SCOPE_LINK :
-@@ -2486,6 +2524,7 @@
+@@ -2470,6 +2508,7 @@
dev_out = &loopback_dev;
dev_hold(dev_out);
fl.oif = loopback_dev.ifindex;
@@ -1194,7 +307,7 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
res.type = RTN_LOCAL;
flags |= RTCF_LOCAL;
goto make_route;
-@@ -2493,7 +2532,7 @@
+@@ -2477,7 +2516,7 @@
if (fib_lookup(&fl, &res)) {
res.fi = NULL;
@@ -1203,7 +316,7 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
/* Apparently, routing tables are wrong. Assume,
that the destination is on link.
-@@ -2533,6 +2572,7 @@
+@@ -2517,6 +2556,7 @@
dev_out = &loopback_dev;
dev_hold(dev_out);
fl.oif = dev_out->ifindex;
@@ -1211,7 +324,7 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
if (res.fi)
fib_info_put(res.fi);
res.fi = NULL;
-@@ -2540,13 +2580,12 @@
+@@ -2524,13 +2564,12 @@
goto make_route;
}
@@ -1228,15 +341,15 @@ diff -urN linux-2.6.19.old/net/ipv4/route.c linux-2.6.19.dev/net/ipv4/route.c
if (!fl.fl4_src)
fl.fl4_src = FIB_RES_PREFSRC(res);
-@@ -2583,6 +2622,7 @@
+@@ -2567,6 +2606,7 @@
rth->fl.fl4_src == flp->fl4_src &&
rth->fl.iif == 0 &&
rth->fl.oif == flp->oif &&
+ rth->fl.fl4_gw == flp->fl4_gw &&
- #ifdef CONFIG_IP_ROUTE_FWMARK
- rth->fl.fl4_fwmark == flp->fl4_fwmark &&
- #endif
-@@ -3221,3 +3261,4 @@
+ rth->fl.mark == flp->mark &&
+ !((rth->fl.fl4_tos ^ flp->fl4_tos) &
+ (IPTOS_RT_MASK | RTO_ONLINK))) {
+@@ -3199,3 +3239,4 @@
EXPORT_SYMBOL(__ip_select_ident);
EXPORT_SYMBOL(ip_route_input);
EXPORT_SYMBOL(ip_route_output_key);
diff --git a/target/linux/generic-2.6/patches/510-Yaffs.patch b/target/linux/generic-2.6/patches/510-Yaffs.patch
index d7b9c976b4..e5ddd22b21 100644
--- a/target/linux/generic-2.6/patches/510-Yaffs.patch
+++ b/target/linux/generic-2.6/patches/510-Yaffs.patch
@@ -1,26 +1,26 @@
-diff -urN linux.old/fs/Kconfig linux.dev/fs/Kconfig
---- linux.old/fs/Kconfig 2006-11-29 22:57:37.000000000 +0100
-+++ linux.dev/fs/Kconfig 2006-12-14 04:21:47.000000000 +0100
-@@ -1202,6 +1202,8 @@
+diff -Nur linux-2.6.21.1/fs/Kconfig linux-2.6.21.1-owrt/fs/Kconfig
+--- linux-2.6.21.1/fs/Kconfig 2007-05-14 10:49:47.000000000 +0200
++++ linux-2.6.21.1-owrt/fs/Kconfig 2007-05-14 11:53:15.000000000 +0200
+@@ -1189,6 +1189,8 @@
To compile the EFS file system support as a module, choose M here: the
module will be called efs.
+source "fs/yaffs2/Kconfig"
+
- config JFFS_FS
- tristate "Journalling Flash File System (JFFS) support"
- depends on MTD && BLOCK
-diff -urN linux.old/fs/Makefile linux.dev/fs/Makefile
---- linux.old/fs/Makefile 2006-11-29 22:57:37.000000000 +0100
-+++ linux.dev/fs/Makefile 2006-12-14 04:21:47.000000000 +0100
-@@ -114,3 +114,4 @@
+ config JFFS2_FS
+ tristate "Journalling Flash File System v2 (JFFS2) support"
+ select CRC32
+diff -Nur linux-2.6.21.1/fs/Makefile linux-2.6.21.1-owrt/fs/Makefile
+--- linux-2.6.21.1/fs/Makefile 2007-05-14 10:49:47.000000000 +0200
++++ linux-2.6.21.1-owrt/fs/Makefile 2007-05-14 11:52:43.000000000 +0200
+@@ -115,3 +115,4 @@
obj-$(CONFIG_DEBUG_FS) += debugfs/
obj-$(CONFIG_OCFS2_FS) += ocfs2/
obj-$(CONFIG_GFS2_FS) += gfs2/
+obj-$(CONFIG_YAFFS_FS) += yaffs2/
-diff -urN linux.old/fs/yaffs2/devextras.h linux.dev/fs/yaffs2/devextras.h
---- linux.old/fs/yaffs2/devextras.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/devextras.h 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/devextras.h linux-2.6.21.1-owrt/fs/yaffs2/devextras.h
+--- linux-2.6.21.1/fs/yaffs2/devextras.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/devextras.h 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,265 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
@@ -287,9 +287,9 @@ diff -urN linux.old/fs/yaffs2/devextras.h linux.dev/fs/yaffs2/devextras.h
+#endif
+
+#endif
-diff -urN linux.old/fs/yaffs2/Kconfig linux.dev/fs/yaffs2/Kconfig
---- linux.old/fs/yaffs2/Kconfig 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/Kconfig 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/Kconfig linux-2.6.21.1-owrt/fs/yaffs2/Kconfig
+--- linux-2.6.21.1/fs/yaffs2/Kconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/Kconfig 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,135 @@
+#
+# YAFFS file system configurations
@@ -426,9 +426,9 @@ diff -urN linux.old/fs/yaffs2/Kconfig linux.dev/fs/yaffs2/Kconfig
+ but makes look-ups faster.
+
+ If unsure, say Y.
-diff -urN linux.old/fs/yaffs2/Makefile linux.dev/fs/yaffs2/Makefile
---- linux.old/fs/yaffs2/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/Makefile 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/Makefile linux-2.6.21.1-owrt/fs/yaffs2/Makefile
+--- linux-2.6.21.1/fs/yaffs2/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/Makefile 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,10 @@
+#
+# Makefile for the linux YAFFS filesystem routines.
@@ -440,9 +440,9 @@ diff -urN linux.old/fs/yaffs2/Makefile linux.dev/fs/yaffs2/Makefile
+yaffs-y += yaffs_packedtags2.o yaffs_nand.o yaffs_qsort.o
+yaffs-y += yaffs_tagscompat.o yaffs_tagsvalidity.o
+yaffs-y += yaffs_mtdif.o yaffs_mtdif2.o
-diff -urN linux.old/fs/yaffs2/moduleconfig.h linux.dev/fs/yaffs2/moduleconfig.h
---- linux.old/fs/yaffs2/moduleconfig.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/moduleconfig.h 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/moduleconfig.h linux-2.6.21.1-owrt/fs/yaffs2/moduleconfig.h
+--- linux-2.6.21.1/fs/yaffs2/moduleconfig.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/moduleconfig.h 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,32 @@
+#ifndef __YAFFS_CONFIG_H__
+#define __YAFFS_CONFIG_H__
@@ -476,9 +476,9 @@ diff -urN linux.old/fs/yaffs2/moduleconfig.h linux.dev/fs/yaffs2/moduleconfig.h
+#endif /* YAFFS_OUT_OF_TREE */
+
+#endif /* __YAFFS_CONFIG_H__ */
-diff -urN linux.old/fs/yaffs2/yaffs_checkptrw.c linux.dev/fs/yaffs2/yaffs_checkptrw.c
---- linux.old/fs/yaffs2/yaffs_checkptrw.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_checkptrw.c 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_checkptrw.c linux-2.6.21.1-owrt/fs/yaffs2/yaffs_checkptrw.c
+--- linux-2.6.21.1/fs/yaffs2/yaffs_checkptrw.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_checkptrw.c 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,384 @@
+/* YAFFS: Yet another FFS. A NAND-flash specific file system.
+ *
@@ -864,9 +864,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_checkptrw.c linux.dev/fs/yaffs2/yaffs_checkp
+
+
+
-diff -urN linux.old/fs/yaffs2/yaffs_checkptrw.h linux.dev/fs/yaffs2/yaffs_checkptrw.h
---- linux.old/fs/yaffs2/yaffs_checkptrw.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_checkptrw.h 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_checkptrw.h linux-2.6.21.1-owrt/fs/yaffs2/yaffs_checkptrw.h
+--- linux-2.6.21.1/fs/yaffs2/yaffs_checkptrw.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_checkptrw.h 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,18 @@
+#ifndef __YAFFS_CHECKPTRW_H__
+#define __YAFFS_CHECKPTRW_H__
@@ -886,9 +886,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_checkptrw.h linux.dev/fs/yaffs2/yaffs_checkp
+
+#endif
+
-diff -urN linux.old/fs/yaffs2/yaffs_ecc.c linux.dev/fs/yaffs2/yaffs_ecc.c
---- linux.old/fs/yaffs2/yaffs_ecc.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_ecc.c 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_ecc.c linux-2.6.21.1-owrt/fs/yaffs2/yaffs_ecc.c
+--- linux-2.6.21.1/fs/yaffs2/yaffs_ecc.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_ecc.c 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,333 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
@@ -1223,9 +1223,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_ecc.c linux.dev/fs/yaffs2/yaffs_ecc.c
+
+}
+
-diff -urN linux.old/fs/yaffs2/yaffs_ecc.h linux.dev/fs/yaffs2/yaffs_ecc.h
---- linux.old/fs/yaffs2/yaffs_ecc.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_ecc.h 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_ecc.h linux-2.6.21.1-owrt/fs/yaffs2/yaffs_ecc.h
+--- linux-2.6.21.1/fs/yaffs2/yaffs_ecc.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_ecc.h 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,44 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
@@ -1271,9 +1271,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_ecc.h linux.dev/fs/yaffs2/yaffs_ecc.h
+ yaffs_ECCOther * read_ecc,
+ const yaffs_ECCOther * test_ecc);
+#endif
-diff -urN linux.old/fs/yaffs2/yaffs_fs.c linux.dev/fs/yaffs2/yaffs_fs.c
---- linux.old/fs/yaffs2/yaffs_fs.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_fs.c 2006-12-14 04:33:02.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_fs.c linux-2.6.21.1-owrt/fs/yaffs2/yaffs_fs.c
+--- linux-2.6.21.1/fs/yaffs2/yaffs_fs.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_fs.c 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,2136 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
@@ -3411,9 +3411,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_fs.c linux.dev/fs/yaffs2/yaffs_fs.c
+MODULE_DESCRIPTION("YAFFS2 - a NAND specific flash file system");
+MODULE_AUTHOR("Charles Manning, Aleph One Ltd., 2002-2006");
+MODULE_LICENSE("GPL");
-diff -urN linux.old/fs/yaffs2/yaffs_guts.c linux.dev/fs/yaffs2/yaffs_guts.c
---- linux.old/fs/yaffs2/yaffs_guts.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_guts.c 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_guts.c linux-2.6.21.1-owrt/fs/yaffs2/yaffs_guts.c
+--- linux-2.6.21.1/fs/yaffs2/yaffs_guts.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_guts.c 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,6675 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
@@ -10090,9 +10090,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_guts.c linux.dev/fs/yaffs2/yaffs_guts.c
+
+ return YAFFS_OK;
+}
-diff -urN linux.old/fs/yaffs2/yaffs_guts.h linux.dev/fs/yaffs2/yaffs_guts.h
---- linux.old/fs/yaffs2/yaffs_guts.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_guts.h 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_guts.h linux-2.6.21.1-owrt/fs/yaffs2/yaffs_guts.h
+--- linux-2.6.21.1/fs/yaffs2/yaffs_guts.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_guts.h 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,893 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
@@ -10987,9 +10987,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_guts.h linux.dev/fs/yaffs2/yaffs_guts.h
+void yaffs_HandleChunkError(yaffs_Device *dev, yaffs_BlockInfo *bi);
+
+#endif
-diff -urN linux.old/fs/yaffs2/yaffsinterface.h linux.dev/fs/yaffs2/yaffsinterface.h
---- linux.old/fs/yaffs2/yaffsinterface.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffsinterface.h 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffsinterface.h linux-2.6.21.1-owrt/fs/yaffs2/yaffsinterface.h
+--- linux-2.6.21.1/fs/yaffs2/yaffsinterface.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffsinterface.h 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,23 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
@@ -11014,9 +11014,9 @@ diff -urN linux.old/fs/yaffs2/yaffsinterface.h linux.dev/fs/yaffs2/yaffsinterfac
+int yaffs_Initialise(unsigned nBlocks);
+
+#endif
-diff -urN linux.old/fs/yaffs2/yaffs_mtdif2.c linux.dev/fs/yaffs2/yaffs_mtdif2.c
---- linux.old/fs/yaffs2/yaffs_mtdif2.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_mtdif2.c 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_mtdif2.c linux-2.6.21.1-owrt/fs/yaffs2/yaffs_mtdif2.c
+--- linux-2.6.21.1/fs/yaffs2/yaffs_mtdif2.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_mtdif2.c 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,234 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
@@ -11252,9 +11252,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_mtdif2.c linux.dev/fs/yaffs2/yaffs_mtdif2.c
+ return YAFFS_FAIL;
+}
+
-diff -urN linux.old/fs/yaffs2/yaffs_mtdif2.h linux.dev/fs/yaffs2/yaffs_mtdif2.h
---- linux.old/fs/yaffs2/yaffs_mtdif2.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_mtdif2.h 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_mtdif2.h linux-2.6.21.1-owrt/fs/yaffs2/yaffs_mtdif2.h
+--- linux-2.6.21.1/fs/yaffs2/yaffs_mtdif2.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_mtdif2.h 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,29 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
@@ -11285,9 +11285,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_mtdif2.h linux.dev/fs/yaffs2/yaffs_mtdif2.h
+ yaffs_BlockState * state, int *sequenceNumber);
+
+#endif
-diff -urN linux.old/fs/yaffs2/yaffs_mtdif.c linux.dev/fs/yaffs2/yaffs_mtdif.c
---- linux.old/fs/yaffs2/yaffs_mtdif.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_mtdif.c 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_mtdif.c linux-2.6.21.1-owrt/fs/yaffs2/yaffs_mtdif.c
+--- linux-2.6.21.1/fs/yaffs2/yaffs_mtdif.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_mtdif.c 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,243 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
@@ -11532,9 +11532,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_mtdif.c linux.dev/fs/yaffs2/yaffs_mtdif.c
+ return YAFFS_OK;
+}
+
-diff -urN linux.old/fs/yaffs2/yaffs_mtdif.h linux.dev/fs/yaffs2/yaffs_mtdif.h
---- linux.old/fs/yaffs2/yaffs_mtdif.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_mtdif.h 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_mtdif.h linux-2.6.21.1-owrt/fs/yaffs2/yaffs_mtdif.h
+--- linux-2.6.21.1/fs/yaffs2/yaffs_mtdif.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_mtdif.h 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,31 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
@@ -11567,9 +11567,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_mtdif.h linux.dev/fs/yaffs2/yaffs_mtdif.h
+int nandmtd_EraseBlockInNAND(yaffs_Device * dev, int blockNumber);
+int nandmtd_InitialiseNAND(yaffs_Device * dev);
+#endif
-diff -urN linux.old/fs/yaffs2/yaffs_nand.c linux.dev/fs/yaffs2/yaffs_nand.c
---- linux.old/fs/yaffs2/yaffs_nand.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_nand.c 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_nand.c linux-2.6.21.1-owrt/fs/yaffs2/yaffs_nand.c
+--- linux-2.6.21.1/fs/yaffs2/yaffs_nand.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_nand.c 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,135 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
@@ -11706,9 +11706,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_nand.c linux.dev/fs/yaffs2/yaffs_nand.c
+
+
+
-diff -urN linux.old/fs/yaffs2/yaffs_nandemul2k.h linux.dev/fs/yaffs2/yaffs_nandemul2k.h
---- linux.old/fs/yaffs2/yaffs_nandemul2k.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_nandemul2k.h 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_nandemul2k.h linux-2.6.21.1-owrt/fs/yaffs2/yaffs_nandemul2k.h
+--- linux-2.6.21.1/fs/yaffs2/yaffs_nandemul2k.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_nandemul2k.h 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,42 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
@@ -11752,9 +11752,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_nandemul2k.h linux.dev/fs/yaffs2/yaffs_nande
+int nandemul2k_GetNumberOfBlocks(void);
+
+#endif
-diff -urN linux.old/fs/yaffs2/yaffs_nand.h linux.dev/fs/yaffs2/yaffs_nand.h
---- linux.old/fs/yaffs2/yaffs_nand.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_nand.h 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_nand.h linux-2.6.21.1-owrt/fs/yaffs2/yaffs_nand.h
+--- linux-2.6.21.1/fs/yaffs2/yaffs_nand.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_nand.h 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,43 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
@@ -11799,9 +11799,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_nand.h linux.dev/fs/yaffs2/yaffs_nand.h
+
+#endif
+
-diff -urN linux.old/fs/yaffs2/yaffs_packedtags1.c linux.dev/fs/yaffs2/yaffs_packedtags1.c
---- linux.old/fs/yaffs2/yaffs_packedtags1.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_packedtags1.c 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_packedtags1.c linux-2.6.21.1-owrt/fs/yaffs2/yaffs_packedtags1.c
+--- linux-2.6.21.1/fs/yaffs2/yaffs_packedtags1.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_packedtags1.c 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,39 @@
+#include "yaffs_packedtags1.h"
+#include "yportenv.h"
@@ -11842,9 +11842,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_packedtags1.c linux.dev/fs/yaffs2/yaffs_pack
+
+ }
+}
-diff -urN linux.old/fs/yaffs2/yaffs_packedtags1.h linux.dev/fs/yaffs2/yaffs_packedtags1.h
---- linux.old/fs/yaffs2/yaffs_packedtags1.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_packedtags1.h 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_packedtags1.h linux-2.6.21.1-owrt/fs/yaffs2/yaffs_packedtags1.h
+--- linux-2.6.21.1/fs/yaffs2/yaffs_packedtags1.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_packedtags1.h 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,22 @@
+// This is used to pack YAFFS1 tags, not YAFFS2 tags.
+
@@ -11868,9 +11868,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_packedtags1.h linux.dev/fs/yaffs2/yaffs_pack
+void yaffs_PackTags1(yaffs_PackedTags1 * pt, const yaffs_ExtendedTags * t);
+void yaffs_UnpackTags1(yaffs_ExtendedTags * t, const yaffs_PackedTags1 * pt);
+#endif
-diff -urN linux.old/fs/yaffs2/yaffs_packedtags2.c linux.dev/fs/yaffs2/yaffs_packedtags2.c
---- linux.old/fs/yaffs2/yaffs_packedtags2.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_packedtags2.c 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_packedtags2.c linux-2.6.21.1-owrt/fs/yaffs2/yaffs_packedtags2.c
+--- linux-2.6.21.1/fs/yaffs2/yaffs_packedtags2.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_packedtags2.c 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,184 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
@@ -12056,9 +12056,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_packedtags2.c linux.dev/fs/yaffs2/yaffs_pack
+ yaffs_DumpTags2(t);
+
+}
-diff -urN linux.old/fs/yaffs2/yaffs_packedtags2.h linux.dev/fs/yaffs2/yaffs_packedtags2.h
---- linux.old/fs/yaffs2/yaffs_packedtags2.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_packedtags2.h 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_packedtags2.h linux-2.6.21.1-owrt/fs/yaffs2/yaffs_packedtags2.h
+--- linux-2.6.21.1/fs/yaffs2/yaffs_packedtags2.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_packedtags2.h 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,23 @@
+/* This is used to pack YAFFS2 tags, not YAFFS1tags. */
+
@@ -12083,9 +12083,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_packedtags2.h linux.dev/fs/yaffs2/yaffs_pack
+void yaffs_PackTags2(yaffs_PackedTags2 * pt, const yaffs_ExtendedTags * t);
+void yaffs_UnpackTags2(yaffs_ExtendedTags * t, yaffs_PackedTags2 * pt);
+#endif
-diff -urN linux.old/fs/yaffs2/yaffs_qsort.c linux.dev/fs/yaffs2/yaffs_qsort.c
---- linux.old/fs/yaffs2/yaffs_qsort.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_qsort.c 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_qsort.c linux-2.6.21.1-owrt/fs/yaffs2/yaffs_qsort.c
+--- linux-2.6.21.1/fs/yaffs2/yaffs_qsort.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_qsort.c 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 1992, 1993
@@ -12243,9 +12243,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_qsort.c linux.dev/fs/yaffs2/yaffs_qsort.c
+ }
+/* qsort(pn - r, r / es, es, cmp);*/
+}
-diff -urN linux.old/fs/yaffs2/yaffs_qsort.h linux.dev/fs/yaffs2/yaffs_qsort.h
---- linux.old/fs/yaffs2/yaffs_qsort.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_qsort.h 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_qsort.h linux-2.6.21.1-owrt/fs/yaffs2/yaffs_qsort.h
+--- linux-2.6.21.1/fs/yaffs2/yaffs_qsort.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_qsort.h 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,23 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
@@ -12270,9 +12270,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_qsort.h linux.dev/fs/yaffs2/yaffs_qsort.h
+ int (*cmp)(const void *, const void *));
+
+#endif
-diff -urN linux.old/fs/yaffs2/yaffs_tagscompat.c linux.dev/fs/yaffs2/yaffs_tagscompat.c
---- linux.old/fs/yaffs2/yaffs_tagscompat.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_tagscompat.c 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_tagscompat.c linux-2.6.21.1-owrt/fs/yaffs2/yaffs_tagscompat.c
+--- linux-2.6.21.1/fs/yaffs2/yaffs_tagscompat.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_tagscompat.c 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,532 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
@@ -12806,9 +12806,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_tagscompat.c linux.dev/fs/yaffs2/yaffs_tagsc
+
+ return YAFFS_OK;
+}
-diff -urN linux.old/fs/yaffs2/yaffs_tagscompat.h linux.dev/fs/yaffs2/yaffs_tagscompat.h
---- linux.old/fs/yaffs2/yaffs_tagscompat.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_tagscompat.h 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_tagscompat.h linux-2.6.21.1-owrt/fs/yaffs2/yaffs_tagscompat.h
+--- linux-2.6.21.1/fs/yaffs2/yaffs_tagscompat.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_tagscompat.h 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,40 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
@@ -12850,9 +12850,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_tagscompat.h linux.dev/fs/yaffs2/yaffs_tagsc
+ state, int *sequenceNumber);
+
+#endif
-diff -urN linux.old/fs/yaffs2/yaffs_tagsvalidity.c linux.dev/fs/yaffs2/yaffs_tagsvalidity.c
---- linux.old/fs/yaffs2/yaffs_tagsvalidity.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_tagsvalidity.c 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_tagsvalidity.c linux-2.6.21.1-owrt/fs/yaffs2/yaffs_tagsvalidity.c
+--- linux-2.6.21.1/fs/yaffs2/yaffs_tagsvalidity.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_tagsvalidity.c 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,31 @@
+
+/*
@@ -12885,9 +12885,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_tagsvalidity.c linux.dev/fs/yaffs2/yaffs_tag
+ tags->validMarker1 == 0x55555555);
+
+}
-diff -urN linux.old/fs/yaffs2/yaffs_tagsvalidity.h linux.dev/fs/yaffs2/yaffs_tagsvalidity.h
---- linux.old/fs/yaffs2/yaffs_tagsvalidity.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yaffs_tagsvalidity.h 2006-12-14 04:21:47.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yaffs_tagsvalidity.h linux-2.6.21.1-owrt/fs/yaffs2/yaffs_tagsvalidity.h
+--- linux-2.6.21.1/fs/yaffs2/yaffs_tagsvalidity.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yaffs_tagsvalidity.h 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,25 @@
+
+/*
@@ -12914,9 +12914,9 @@ diff -urN linux.old/fs/yaffs2/yaffs_tagsvalidity.h linux.dev/fs/yaffs2/yaffs_tag
+void yaffs_InitialiseTags(yaffs_ExtendedTags * tags);
+int yaffs_ValidateTags(yaffs_ExtendedTags * tags);
+#endif
-diff -urN linux.old/fs/yaffs2/yportenv.h linux.dev/fs/yaffs2/yportenv.h
---- linux.old/fs/yaffs2/yportenv.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/fs/yaffs2/yportenv.h 2006-12-14 04:26:06.000000000 +0100
+diff -Nur linux-2.6.21.1/fs/yaffs2/yportenv.h linux-2.6.21.1-owrt/fs/yaffs2/yportenv.h
+--- linux-2.6.21.1/fs/yaffs2/yportenv.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/fs/yaffs2/yportenv.h 2007-05-14 11:52:43.000000000 +0200
@@ -0,0 +1,165 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
diff --git a/target/linux/generic-2.6/patches/600-x86_lzma.patch b/target/linux/generic-2.6/patches/600-x86_lzma.patch
index 1a948839b0..b84a03cf09 100644
--- a/target/linux/generic-2.6/patches/600-x86_lzma.patch
+++ b/target/linux/generic-2.6/patches/600-x86_lzma.patch
@@ -1,6 +1,6 @@
-diff -Naur linux-old/arch/i386/boot/compressed/LzmaDecode.c linux-lzma/arch/i386/boot/compressed/LzmaDecode.c
---- linux-old/arch/i386/boot/compressed/LzmaDecode.c 1969-12-31 19:00:00.000000000 -0500
-+++ linux-lzma/arch/i386/boot/compressed/LzmaDecode.c 2005-06-05 00:07:38.000000000 -0400
+diff -Nur linux-2.6.21.1/arch/i386/boot/compressed/LzmaDecode.c linux-2.6.21.1-owrt/arch/i386/boot/compressed/LzmaDecode.c
+--- linux-2.6.21.1/arch/i386/boot/compressed/LzmaDecode.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/arch/i386/boot/compressed/LzmaDecode.c 2007-05-14 11:55:38.000000000 +0200
@@ -0,0 +1,586 @@
+/*
+ LzmaDecode.c
@@ -588,9 +588,9 @@ diff -Naur linux-old/arch/i386/boot/compressed/LzmaDecode.c linux-lzma/arch/i386
+ *outSizeProcessed = nowPos;
+ return LZMA_RESULT_OK;
+}
-diff -Naur linux-old/arch/i386/boot/compressed/LzmaDecode.h linux-lzma/arch/i386/boot/compressed/LzmaDecode.h
---- linux-old/arch/i386/boot/compressed/LzmaDecode.h 1969-12-31 19:00:00.000000000 -0500
-+++ linux-lzma/arch/i386/boot/compressed/LzmaDecode.h 2005-06-05 00:07:39.000000000 -0400
+diff -Nur linux-2.6.21.1/arch/i386/boot/compressed/LzmaDecode.h linux-2.6.21.1-owrt/arch/i386/boot/compressed/LzmaDecode.h
+--- linux-2.6.21.1/arch/i386/boot/compressed/LzmaDecode.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/arch/i386/boot/compressed/LzmaDecode.h 2007-05-14 11:55:38.000000000 +0200
@@ -0,0 +1,100 @@
+/*
+ LzmaDecode.h
@@ -692,52 +692,9 @@ diff -Naur linux-old/arch/i386/boot/compressed/LzmaDecode.h linux-lzma/arch/i386
+ UInt32 *outSizeProcessed);
+
+#endif
-diff -Naur linux-old/arch/i386/boot/compressed/Makefile linux-lzma/arch/i386/boot/compressed/Makefile
---- linux-old/arch/i386/boot/compressed/Makefile 2005-06-04 21:53:40.000000000 -0400
-+++ linux-lzma/arch/i386/boot/compressed/Makefile 2005-06-05 00:25:23.000000000 -0400
-@@ -2,24 +2,33 @@
- # linux/arch/i386/boot/compressed/Makefile
- #
- # create a compressed vmlinux image from the original vmlinux
-+# patched by Ming-Ching Tiew <mctiew@yahoo.com> for kernel 2.6
-+# requires program 'lzma' from LZMA SDK ( http://www.7-zip.org/ ) to work
-+# $ mkdir lzma
-+# $ cd lzma
-+# $ tar tvjf ../lzma417.tar.bz2
-+# $ cd SRC/7zip/Compress/LZMA_Alone
-+# $ dos2unix makefile
-+# $ make
-+# $ su
-+# # cp lzma /usr/bin
- #
--
--targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o
-+targets := vmlinux vmlinux.bin vmlinux.bin.lzma head.o lzma_misc.o piggy.o
- EXTRA_AFLAGS := -traditional
-
- LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup_32
-
--$(obj)/vmlinux: $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o FORCE
-+$(obj)/vmlinux: $(obj)/head.o $(obj)/lzma_misc.o $(obj)/piggy.o FORCE
- $(call if_changed,ld)
- @:
-
- $(obj)/vmlinux.bin: vmlinux FORCE
- $(call if_changed,objcopy)
-
--$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
-- $(call if_changed,gzip)
-+$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
-+ $(call if_changed,lzma)
-
- LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T
-
--$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
-+$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.lzma FORCE
- $(call if_changed,ld)
-diff -Naur linux-old/arch/i386/boot/compressed/lzma_misc.c linux-lzma/arch/i386/boot/compressed/lzma_misc.c
---- linux-old/arch/i386/boot/compressed/lzma_misc.c 1969-12-31 19:00:00.000000000 -0500
-+++ linux-lzma/arch/i386/boot/compressed/lzma_misc.c 2005-06-04 21:33:48.000000000 -0400
+diff -Nur linux-2.6.21.1/arch/i386/boot/compressed/lzma_misc.c linux-2.6.21.1-owrt/arch/i386/boot/compressed/lzma_misc.c
+--- linux-2.6.21.1/arch/i386/boot/compressed/lzma_misc.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.21.1-owrt/arch/i386/boot/compressed/lzma_misc.c 2007-05-14 11:55:38.000000000 +0200
@@ -0,0 +1,412 @@
+/*
+ * lzma_misc.c
@@ -1151,9 +1108,50 @@ diff -Naur linux-old/arch/i386/boot/compressed/lzma_misc.c linux-lzma/arch/i386/
+ if (high_loaded) close_output_buffer_if_we_run_high(mv);
+ return high_loaded;
+}
-diff -urN linux-2.6.19.2/scripts/Makefile.lib linux-2.6.19.2.new/scripts/Makefile.lib
---- linux-2.6.19.2/scripts/Makefile.lib 2007-01-10 20:10:37.000000000 +0100
-+++ linux-2.6.19.2.new/scripts/Makefile.lib 2007-04-15 23:51:54.000000000 +0200
+diff -Nur linux-2.6.21.1/arch/i386/boot/compressed/Makefile linux-2.6.21.1-owrt/arch/i386/boot/compressed/Makefile
+--- linux-2.6.21.1/arch/i386/boot/compressed/Makefile 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1-owrt/arch/i386/boot/compressed/Makefile 2007-05-14 12:01:25.000000000 +0200
+@@ -4,7 +4,7 @@
+ # create a compressed vmlinux image from the original vmlinux
+ #
+
+-targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o \
++targets := vmlinux vmlinux.bin vmlinux.bin.lzma head.o lzma_misc.o piggy.o \
+ vmlinux.bin.all vmlinux.relocs
+ EXTRA_AFLAGS := -traditional
+
+@@ -12,7 +12,7 @@
+ CFLAGS_misc.o += -fPIC
+ hostprogs-y := relocs
+
+-$(obj)/vmlinux: $(src)/vmlinux.lds $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o FORCE
++$(obj)/vmlinux: $(src)/vmlinux.lds $(obj)/head.o $(obj)/lzma_misc.o $(obj)/piggy.o FORCE
+ $(call if_changed,ld)
+ @:
+
+@@ -32,14 +32,14 @@
+ $(call if_changed,relocbin)
+
+ ifdef CONFIG_RELOCATABLE
+-$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE
+- $(call if_changed,gzip)
++$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin.all FORCE
++ $(call if_changed,lzma)
+ else
+-$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
+- $(call if_changed,gzip)
++$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
++ $(call if_changed,lzma)
+ endif
+
+ LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T
+
+-$(obj)/piggy.o: $(src)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
++$(obj)/piggy.o: $(src)/vmlinux.scr $(obj)/vmlinux.bin.lzma FORCE
+ $(call if_changed,ld)
+diff -Nur linux-2.6.21.1/scripts/Makefile.lib linux-2.6.21.1-owrt/scripts/Makefile.lib
+--- linux-2.6.21.1/scripts/Makefile.lib 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1-owrt/scripts/Makefile.lib 2007-05-14 11:55:38.000000000 +0200
@@ -162,4 +162,9 @@
quiet_cmd_gzip = GZIP $@
cmd_gzip = gzip -f -9 < $< > $@
diff --git a/target/linux/generic-2.6/patches/700-airprime.patch b/target/linux/generic-2.6/patches/700-airprime.patch
deleted file mode 100644
index 5eafe1da27..0000000000
--- a/target/linux/generic-2.6/patches/700-airprime.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -urN linux-2.6.19.2-old/drivers/usb/serial/airprime.c linux-2.6.19.2-dev/drivers/usb/serial/airprime.c
---- linux-2.6.19.2-old/drivers/usb/serial/airprime.c 2007-05-01 14:11:28.000000000 -0700
-+++ linux-2.6.19.2-dev/drivers/usb/serial/airprime.c 2007-05-01 14:12:03.000000000 -0700
-@@ -20,6 +20,8 @@
- { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */
- { USB_DEVICE(0x1410, 0x1110) }, /* Novatel Wireless Merlin CDMA */
- { USB_DEVICE(0x1410, 0x1100) }, /* ExpressCard34 Qualcomm 3G CDMA */
-+ { USB_DEVICE(0x1410, 0x1130) }, /* Novatel Wireless S720 CDMA/EV-DO */
-+ { USB_DEVICE(0x1410, 0x2110) }, /* Novatel Wireless U720 CDMA/EV-DO */
- { },
- };
- MODULE_DEVICE_TABLE(usb, id_table);
diff --git a/target/linux/generic-2.6/patches/901-asm_bitops_include.patch b/target/linux/generic-2.6/patches/901-asm_bitops_include.patch
deleted file mode 100644
index ec18e9b102..0000000000
--- a/target/linux/generic-2.6/patches/901-asm_bitops_include.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -urN linux-2.6.19.old/include/asm-mips/bitops.h linux-2.6.19.dev/include/asm-mips/bitops.h
---- linux-2.6.19.old/include/asm-mips/bitops.h 2006-11-29 22:57:37.000000000 +0100
-+++ linux-2.6.19.dev/include/asm-mips/bitops.h 2006-12-14 03:14:07.000000000 +0100
-@@ -11,6 +11,7 @@
-
- #include <linux/compiler.h>
- #include <linux/types.h>
-+#include <asm/war.h>
- #include <asm/bug.h>
- #include <asm/byteorder.h> /* sigh ... */
- #include <asm/cpu-features.h>
diff --git a/target/linux/generic-2.6/patches/904-ls_time_locale.patch b/target/linux/generic-2.6/patches/904-ls_time_locale.patch
index cc4a392b8f..2b7d07c2fe 100644
--- a/target/linux/generic-2.6/patches/904-ls_time_locale.patch
+++ b/target/linux/generic-2.6/patches/904-ls_time_locale.patch
@@ -1,24 +1,21 @@
-diff -urN linux-2.6.19.2/scripts/gen_initramfs_list.sh linux-2.6.19.2.new/scripts/gen_initramfs_list.sh
---- linux-2.6.19.2/scripts/gen_initramfs_list.sh 2007-01-10 20:10:37.000000000 +0100
-+++ linux-2.6.19.2.new/scripts/gen_initramfs_list.sh 2007-05-03 16:25:06.000000000 +0200
-@@ -120,9 +120,9 @@
+diff -Nur linux-2.6.21.1/scripts/gen_initramfs_list.sh linux-2.6.21.1-owrt/scripts/gen_initramfs_list.sh
+--- linux-2.6.21.1/scripts/gen_initramfs_list.sh 2007-04-27 23:49:26.000000000 +0200
++++ linux-2.6.21.1-owrt/scripts/gen_initramfs_list.sh 2007-05-14 12:18:02.000000000 +0200
+@@ -125,7 +125,7 @@
+ str="${ftype} ${name} ${location} ${str}"
;;
"nod")
- local dev_type=
-- local maj=$(LC_ALL=C ls -l "${location}" | \
-+ local maj=$(LC_ALL=C ls --time-style=locale -l "${location}" | \
- gawk '{sub(/,/, "", $5); print $5}')
-- local min=$(LC_ALL=C ls -l "${location}" | \
-+ local min=$(LC_ALL=C ls --time-style=locale -l "${location}" | \
- gawk '{print $6}')
-
- if [ -b "${location}" ]; then
-@@ -133,7 +133,7 @@
- str="${ftype} ${name} ${str} ${dev_type} ${maj} ${min}"
+- local dev=`LC_ALL=C ls -l "${location}"`
++ local dev=`LC_ALL=C ls -l --time-style=locale "${location}"`
+ local maj=`field 5 ${dev}`
+ local min=`field 6 ${dev}`
+ maj=${maj%,}
+@@ -135,7 +135,7 @@
+ str="${ftype} ${name} ${str} ${dev} ${maj} ${min}"
;;
"slink")
-- local target=$(LC_ALL=C ls -l "${location}" | \
-+ local target=$(LC_ALL=C ls --time-style=locale -l "${location}" | \
- gawk '{print $11}')
+- local target=`field 11 $(LC_ALL=C ls -l "${location}")`
++ local target=`field 11 $(LC_ALL=C ls -l --time-style=locale "${location}")`
str="${ftype} ${name} ${target} ${str}"
;;
+ *)