1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

Upgrade to Linux 2.6.19

- Includes large parts of the patch from #1021 by dpalffy
- Includes RB532 NAND driver changes by n0-1



git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5789 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd
2006-12-14 16:41:33 +00:00
parent a8131d4638
commit c92885c466
93 changed files with 33484 additions and 19072 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,718 +0,0 @@
diff -ur linux-2.6.15-rc5/drivers/mtd/mtd_blkdevs.c linux-2.6.15-rc5-openwrt/drivers/mtd/mtd_blkdevs.c
--- linux-2.6.15-rc5/drivers/mtd/mtd_blkdevs.c 2005-12-04 06:10:42.000000000 +0100
+++ linux-2.6.15-rc5-openwrt/drivers/mtd/mtd_blkdevs.c 2005-12-15 07:53:20.000000000 +0100
@@ -21,6 +21,9 @@
#include <linux/init.h>
#include <asm/semaphore.h>
#include <asm/uaccess.h>
+#ifdef CONFIG_DEVFS_FS
+#include <linux/devfs_fs_kernel.h>
+#endif
static LIST_HEAD(blktrans_majors);
@@ -302,6 +305,11 @@
snprintf(gd->disk_name, sizeof(gd->disk_name),
"%s%d", tr->name, new->devnum);
+#ifdef CONFIG_DEVFS_FS
+ snprintf(gd->devfs_name, sizeof(gd->devfs_name),
+ "%s/%c", tr->name, (tr->part_bits?'a':'0') + new->devnum);
+#endif
+
/* 2.5 has capacity in units of 512 bytes while still
having BLOCK_SIZE_BITS set to 10. Just to keep us amused. */
set_capacity(gd, (new->size * new->blksize) >> 9);
@@ -418,6 +426,10 @@
return ret;
}
+#ifdef CONFIG_DEVFS_FS
+ devfs_mk_dir(tr->name);
+#endif
+
INIT_LIST_HEAD(&tr->devs);
list_add(&tr->list, &blktrans_majors);
@@ -450,6 +462,10 @@
tr->remove_dev(dev);
}
+#ifdef CONFIG_DEVFS_FS
+ devfs_remove(tr->name);
+#endif
+
blk_cleanup_queue(tr->blkcore_priv->rq);
unregister_blkdev(tr->major, tr->name);
diff -ur linux-2.6.15-rc5/drivers/mtd/mtdchar.c linux-2.6.15-rc5-openwrt/drivers/mtd/mtdchar.c
--- linux-2.6.15-rc5/drivers/mtd/mtdchar.c 2005-12-04 06:10:42.000000000 +0100
+++ linux-2.6.15-rc5-openwrt/drivers/mtd/mtdchar.c 2005-12-15 07:49:15.000000000 +0100
@@ -19,19 +18,33 @@
#include <asm/uaccess.h>
+#ifdef CONFIG_DEVFS_FS
+#include <linux/devfs_fs_kernel.h>
+#else
+#include <linux/device.h>
+
static struct class *mtd_class;
+#endif
static void mtd_notify_add(struct mtd_info* mtd)
{
if (!mtd)
return;
+#ifdef CONFIG_DEVFS_FS
+ devfs_mk_cdev(MKDEV(MTD_CHAR_MAJOR, mtd->index*2),
+ S_IFCHR | S_IRUGO | S_IWUGO, "mtd/%d", mtd->index);
+
+ devfs_mk_cdev(MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1),
+ S_IFCHR | S_IRUGO, "mtd/%dro", mtd->index);
+#else
class_device_create(mtd_class, NULL, MKDEV(MTD_CHAR_MAJOR, mtd->index*2),
NULL, "mtd%d", mtd->index);
class_device_create(mtd_class, NULL,
MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1),
NULL, "mtd%dro", mtd->index);
+#endif
}
static void mtd_notify_remove(struct mtd_info* mtd)
@@ -39,8 +52,13 @@
if (!mtd)
return;
+#ifdef CONFIG_DEVFS_FS
+ devfs_remove("mtd/%d", mtd->index);
+ devfs_remove("mtd/%dro", mtd->index);
+#else
class_device_destroy(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2));
class_device_destroy(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1));
+#endif
}
static struct mtd_notifier notifier = {
@@ -48,6 +66,22 @@
.remove = mtd_notify_remove,
};
+#ifdef CONFIG_DEVFS_FS
+ static inline void mtdchar_devfs_init(void)
+ {
+ devfs_mk_dir("mtd");
+ register_mtd_user(&notifier);
+ }
+ static inline void mtdchar_devfs_exit(void)
+ {
+ unregister_mtd_user(&notifier);
+ devfs_remove("mtd");
+ }
+ #else /* !DEVFS */
+ #define mtdchar_devfs_init() do { } while(0)
+ #define mtdchar_devfs_exit() do { } while(0)
+#endif
+
/*
* We use file->private_data to store a pointer to the MTDdevice.
* Since alighment is at least 32 bits, we have 2 bits free for OTP
@@ -643,6 +677,9 @@
return -EAGAIN;
}
+#ifdef CONFIG_DEVFS_FS
+ mtdchar_devfs_init();
+#else
mtd_class = class_create(THIS_MODULE, "mtd");
if (IS_ERR(mtd_class)) {
@@ -652,13 +689,19 @@
}
register_mtd_user(&notifier);
+#endif
return 0;
}
static void __exit cleanup_mtdchar(void)
{
+
+#ifdef CONFIG_DEVFS_FS
+ mtdchar_devfs_exit();
+#else
unregister_mtd_user(&notifier);
class_destroy(mtd_class);
+#endif
unregister_chrdev(MTD_CHAR_MAJOR, "mtd");
}
diff -ur linux-2.6.15-rc5/fs/Kconfig linux-2.6.15-rc5-openwrt/fs/Kconfig
--- linux-2.6.15-rc5/fs/Kconfig 2005-12-04 06:10:42.000000000 +0100
+++ linux-2.6.15-rc5-openwrt/fs/Kconfig 2005-12-15 07:44:01.000000000 +0100
@@ -772,6 +772,56 @@
help
Exports the dump image of crashed kernel in ELF format.
+config DEVFS_FS
+ bool "/dev file system support (OBSOLETE)"
+ depends on EXPERIMENTAL
+ help
+ This is support for devfs, a virtual file system (like /proc) which
+ provides the file system interface to device drivers, normally found
+ in /dev. Devfs does not depend on major and minor number
+ allocations. Device drivers register entries in /dev which then
+ appear automatically, which means that the system administrator does
+ not have to create character and block special device files in the
+ /dev directory using the mknod command (or MAKEDEV script) anymore.
+
+ This is work in progress. If you want to use this, you *must* read
+ the material in <file:Documentation/filesystems/devfs/>, especially
+ the file README there.
+
+ Note that devfs no longer manages /dev/pts! If you are using UNIX98
+ ptys, you will also need to mount the /dev/pts filesystem (devpts).
+
+ Note that devfs has been obsoleted by udev,
+ <http://www.kernel.org/pub/linux/utils/kernel/hotplug/>.
+ It has been stripped down to a bare minimum and is only provided for
+ legacy installations that use its naming scheme which is
+ unfortunately different from the names normal Linux installations
+ use.
+
+ If unsure, say N.
+
+config DEVFS_MOUNT
+ bool "Automatically mount at boot"
+ depends on DEVFS_FS
+ help
+ This option appears if you have CONFIG_DEVFS_FS enabled. Setting
+ this to 'Y' will make the kernel automatically mount devfs onto /dev
+ when the system is booted, before the init thread is started.
+ You can override this with the "devfs=nomount" boot option.
+
+ If unsure, say N.
+
+config DEVFS_DEBUG
+ bool "Debug devfs"
+ depends on DEVFS_FS
+ help
+ If you say Y here, then the /dev file system code will generate
+ debugging messages. See the file
+ <file:Documentation/filesystems/devfs/boot-options> for more
+ details.
+
+ If unsure, say N.
+
config SYSFS
bool "sysfs file system support" if EMBEDDED
default y
diff -ur linux-2.6.17/drivers/ieee1394/dv1394.c linux-2.6.17-devfs/drivers/ieee1394/dv1394.c
--- linux-2.6.17/drivers/ieee1394/dv1394.c 2006-06-17 18:49:35.000000000 -0700
+++ linux-2.6.17-devfs/drivers/ieee1394/dv1394.c 2006-08-25 11:06:18.000000000 -0700
@@ -73,7 +73,7 @@
- fix all XXX showstoppers
- disable IR/IT DMA interrupts on shutdown
- flush pci writes to the card by issuing a read
- - character device dispatching
+ - devfs and character device dispatching (* needs testing with Linux 2.2.x)
- switch over to the new kernel DMA API (pci_map_*()) (* needs testing on platforms with IOMMU!)
- keep all video_cards in a list (for open() via chardev), set file->private_data = video
- dv1394_poll should indicate POLLIN when receiving buffers are available
@@ -1096,6 +1096,7 @@
init.api_version = DV1394_API_VERSION;
init.n_frames = DV1394_MAX_FRAMES / 4;
+ /* the following are now set via devfs */
init.channel = video->channel;
init.format = video->pal_or_ntsc;
init.cip_n = video->cip_n;
@@ -1790,6 +1791,8 @@
{
struct video_card *video = NULL;
+ /* if the device was opened through devfs, then file->private_data
+ has already been set to video by devfs */
if (file->private_data) {
video = (struct video_card*) file->private_data;
@@ -2208,7 +2211,7 @@
video = kzalloc(sizeof(*video), GFP_KERNEL);
if (!video) {
printk(KERN_ERR "dv1394: cannot allocate video_card\n");
- return -1;
+ goto err;
}
video->ohci = ohci;
@@ -2263,14 +2266,37 @@
list_add_tail(&video->list, &dv1394_cards);
spin_unlock_irqrestore(&dv1394_cards_lock, flags);
+ if (devfs_mk_cdev(MKDEV(IEEE1394_MAJOR,
+ IEEE1394_MINOR_BLOCK_DV1394*16 + video->id),
+ S_IFCHR|S_IRUGO|S_IWUGO,
+ "ieee1394/dv/host%d/%s/%s",
+ (video->id>>2),
+ (video->pal_or_ntsc == DV1394_NTSC ? "NTSC" : "PAL"),
+ (video->mode == MODE_RECEIVE ? "in" : "out")) < 0)
+ goto err_free;
+
debug_printk("dv1394: dv1394_init() OK on ID %d\n", video->id);
+
return 0;
+
+ err_free:
+ kfree(video);
+ err:
+ return -1;
}
static void dv1394_un_init(struct video_card *video)
{
+ char buf[32];
+
/* obviously nobody has the driver open at this point */
do_dv1394_shutdown(video, 1);
+ snprintf(buf, sizeof(buf), "dv/host%d/%s/%s", (video->id >> 2),
+ (video->pal_or_ntsc == DV1394_NTSC ? "NTSC" : "PAL"),
+ (video->mode == MODE_RECEIVE ? "in" : "out")
+ );
+
+ devfs_remove("ieee1394/%s", buf);
kfree(video);
}
@@ -2307,6 +2333,9 @@
class_device_destroy(hpsb_protocol_class,
MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16 + (id<<2)));
+ devfs_remove("ieee1394/dv/host%d/NTSC", id);
+ devfs_remove("ieee1394/dv/host%d/PAL", id);
+ devfs_remove("ieee1394/dv/host%d", id);
}
static void dv1394_add_host (struct hpsb_host *host)
@@ -2323,6 +2352,9 @@
class_device_create(hpsb_protocol_class, NULL, MKDEV(
IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16 + (id<<2)),
NULL, "dv1394-%d", id);
+ devfs_mk_dir("ieee1394/dv/host%d", id);
+ devfs_mk_dir("ieee1394/dv/host%d/NTSC", id);
+ devfs_mk_dir("ieee1394/dv/host%d/PAL", id);
dv1394_init(ohci, DV1394_NTSC, MODE_RECEIVE);
dv1394_init(ohci, DV1394_NTSC, MODE_TRANSMIT);
@@ -2579,8 +2611,10 @@
static void __exit dv1394_exit_module(void)
{
hpsb_unregister_protocol(&dv1394_driver);
+
hpsb_unregister_highlevel(&dv1394_highlevel);
cdev_del(&dv1394_cdev);
+ devfs_remove("ieee1394/dv");
}
static int __init dv1394_init_module(void)
@@ -2596,12 +2630,15 @@
return ret;
}
+ devfs_mk_dir("ieee1394/dv");
+
hpsb_register_highlevel(&dv1394_highlevel);
ret = hpsb_register_protocol(&dv1394_driver);
if (ret) {
printk(KERN_ERR "dv1394: failed to register protocol\n");
hpsb_unregister_highlevel(&dv1394_highlevel);
+ devfs_remove("ieee1394/dv");
cdev_del(&dv1394_cdev);
return ret;
}
diff -ur linux-2.6.17/drivers/ieee1394/ieee1394_core.c linux-2.6.17-devfs/drivers/ieee1394/ieee1394_core.c
--- linux-2.6.17/drivers/ieee1394/ieee1394_core.c 2006-06-17 18:49:35.000000000 -0700
+++ linux-2.6.17-devfs/drivers/ieee1394/ieee1394_core.c 2006-08-25 11:06:18.000000000 -0700
@@ -1078,10 +1078,17 @@
goto exit_release_kernel_thread;
}
+ /* actually this is a non-fatal error */
+ ret = devfs_mk_dir("ieee1394");
+ if (ret < 0) {
+ HPSB_ERR("unable to make devfs dir for device major %d!\n", IEEE1394_MAJOR);
+ goto release_chrdev;
+ }
+
ret = bus_register(&ieee1394_bus_type);
if (ret < 0) {
HPSB_INFO("bus register failed");
- goto release_chrdev;
+ goto release_devfs;
}
for (i = 0; fw_bus_attrs[i]; i++) {
@@ -1092,7 +1099,7 @@
fw_bus_attrs[i--]);
}
bus_unregister(&ieee1394_bus_type);
- goto release_chrdev;
+ goto release_devfs;
}
}
@@ -1145,6 +1152,8 @@
for (i = 0; fw_bus_attrs[i]; i++)
bus_remove_file(&ieee1394_bus_type, fw_bus_attrs[i]);
bus_unregister(&ieee1394_bus_type);
+release_devfs:
+ devfs_remove("ieee1394");
release_chrdev:
unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
exit_release_kernel_thread:
@@ -1182,6 +1191,7 @@
hpsb_cleanup_config_roms();
unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
+ devfs_remove("ieee1394");
}
module_init(ieee1394_init);
diff -ur linux-2.6.17/drivers/ieee1394/ieee1394_core.h linux-2.6.17-devfs/drivers/ieee1394/ieee1394_core.h
--- linux-2.6.17/drivers/ieee1394/ieee1394_core.h 2006-06-17 18:49:35.000000000 -0700
+++ linux-2.6.17-devfs/drivers/ieee1394/ieee1394_core.h 2006-08-25 11:06:18.000000000 -0700
@@ -3,6 +3,7 @@
#define _IEEE1394_CORE_H
#include <linux/slab.h>
+#include <linux/devfs_fs_kernel.h>
#include <asm/atomic.h>
#include <asm/semaphore.h>
#include "hosts.h"
diff -ur linux-2.6.17/drivers/ieee1394/raw1394.c linux-2.6.17-devfs/drivers/ieee1394/raw1394.c
--- linux-2.6.17/drivers/ieee1394/raw1394.c 2006-06-17 18:49:35.000000000 -0700
+++ linux-2.6.17-devfs/drivers/ieee1394/raw1394.c 2006-08-25 11:06:18.000000000 -0700
@@ -41,6 +41,7 @@
#include <linux/cdev.h>
#include <asm/uaccess.h>
#include <asm/atomic.h>
+#include <linux/devfs_fs_kernel.h>
#include <linux/compat.h>
#include "csr1212.h"
@@ -2998,6 +2999,9 @@
goto out_unreg;
}
+ devfs_mk_cdev(MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16),
+ S_IFCHR | S_IRUSR | S_IWUSR, RAW1394_DEVICE_NAME);
+
cdev_init(&raw1394_cdev, &raw1394_fops);
raw1394_cdev.owner = THIS_MODULE;
kobject_set_name(&raw1394_cdev.kobj, RAW1394_DEVICE_NAME);
@@ -3019,6 +3023,7 @@
goto out;
out_dev:
+ devfs_remove(RAW1394_DEVICE_NAME);
class_device_destroy(hpsb_protocol_class,
MKDEV(IEEE1394_MAJOR,
IEEE1394_MINOR_BLOCK_RAW1394 * 16));
@@ -3034,6 +3039,7 @@
MKDEV(IEEE1394_MAJOR,
IEEE1394_MINOR_BLOCK_RAW1394 * 16));
cdev_del(&raw1394_cdev);
+ devfs_remove(RAW1394_DEVICE_NAME);
hpsb_unregister_highlevel(&raw1394_highlevel);
hpsb_unregister_protocol(&raw1394_driver);
}
diff -ur linux-2.6.17/drivers/ieee1394/video1394.c linux-2.6.17-devfs/drivers/ieee1394/video1394.c
--- linux-2.6.17/drivers/ieee1394/video1394.c 2006-06-17 18:49:35.000000000 -0700
+++ linux-2.6.17-devfs/drivers/ieee1394/video1394.c 2006-08-25 11:06:18.000000000 -0700
@@ -42,6 +42,7 @@
#include <linux/poll.h>
#include <linux/smp_lock.h>
#include <linux/delay.h>
+#include <linux/devfs_fs_kernel.h>
#include <linux/bitops.h>
#include <linux/types.h>
#include <linux/vmalloc.h>
@@ -1321,6 +1322,9 @@
class_device_create(hpsb_protocol_class, NULL, MKDEV(
IEEE1394_MAJOR, minor),
NULL, "%s-%d", VIDEO1394_DRIVER_NAME, ohci->host->id);
+ devfs_mk_cdev(MKDEV(IEEE1394_MAJOR, minor),
+ S_IFCHR | S_IRUSR | S_IWUSR,
+ "%s/%d", VIDEO1394_DRIVER_NAME, ohci->host->id);
}
@@ -1328,9 +1332,12 @@
{
struct ti_ohci *ohci = hpsb_get_hostinfo(&video1394_highlevel, host);
- if (ohci)
+ if (ohci) {
class_device_destroy(hpsb_protocol_class, MKDEV(IEEE1394_MAJOR,
IEEE1394_MINOR_BLOCK_VIDEO1394 * 16 + ohci->host->id));
+ devfs_remove("%s/%d", VIDEO1394_DRIVER_NAME, ohci->host->id);
+ }
+
return;
}
@@ -1471,8 +1478,12 @@
static void __exit video1394_exit_module (void)
{
hpsb_unregister_protocol(&video1394_driver);
+
hpsb_unregister_highlevel(&video1394_highlevel);
+
+ devfs_remove(VIDEO1394_DRIVER_NAME);
cdev_del(&video1394_cdev);
+
PRINT_G(KERN_INFO, "Removed " VIDEO1394_DRIVER_NAME " module");
}
@@ -1489,12 +1500,15 @@
return ret;
}
+ devfs_mk_dir(VIDEO1394_DRIVER_NAME);
+
hpsb_register_highlevel(&video1394_highlevel);
ret = hpsb_register_protocol(&video1394_driver);
if (ret) {
PRINT_G(KERN_ERR, "video1394: failed to register protocol");
hpsb_unregister_highlevel(&video1394_highlevel);
+ devfs_remove(VIDEO1394_DRIVER_NAME);
cdev_del(&video1394_cdev);
return ret;
}
diff -ur linux-2.6.17/drivers/scsi/osst.c linux-2.6.17-devfs/drivers/scsi/osst.c
--- linux-2.6.17/drivers/scsi/osst.c 2006-06-17 18:49:35.000000000 -0700
+++ linux-2.6.17-devfs/drivers/scsi/osst.c 2006-08-25 11:06:18.000000000 -0700
@@ -48,6 +48,7 @@
#include <linux/vmalloc.h>
#include <linux/blkdev.h>
#include <linux/moduleparam.h>
+#include <linux/devfs_fs_kernel.h>
#include <linux/delay.h>
#include <linux/jiffies.h>
#include <asm/uaccess.h>
@@ -5721,7 +5722,7 @@
struct st_partstat * STps;
struct osst_buffer * buffer;
struct gendisk * drive;
- int i, dev_num;
+ int i, mode, dev_num;
if (SDp->type != TYPE_TAPE || !osst_supports(SDp))
return -ENODEV;
@@ -5857,6 +5858,18 @@
snprintf(name, 8, "%s%s", "n", tape_name(tpnt));
osst_sysfs_add(MKDEV(OSST_MAJOR, dev_num + 128), dev, tpnt, name);
}
+ for (mode = 0; mode < ST_NBR_MODES; ++mode) {
+ /* Rewind entry */
+ devfs_mk_cdev(MKDEV(OSST_MAJOR, dev_num + (mode << 5)),
+ S_IFCHR | S_IRUGO | S_IWUGO,
+ "%s/ot%s", SDp->devfs_name, osst_formats[mode]);
+
+ /* No-rewind entry */
+ devfs_mk_cdev(MKDEV(OSST_MAJOR, dev_num + (mode << 5) + 128),
+ S_IFCHR | S_IRUGO | S_IWUGO,
+ "%s/ot%sn", SDp->devfs_name, osst_formats[mode]);
+ }
+ drive->number = devfs_register_tape(SDp->devfs_name);
sdev_printk(KERN_INFO, SDp,
"osst :I: Attached OnStream %.5s tape as %s\n",
@@ -5873,7 +5886,7 @@
{
struct scsi_device * SDp = to_scsi_device(dev);
struct osst_tape * tpnt;
- int i;
+ int i, mode;
if ((SDp->type != TYPE_TAPE) || (osst_nr_dev <= 0))
return 0;
@@ -5884,6 +5897,11 @@
osst_sysfs_destroy(MKDEV(OSST_MAJOR, i));
osst_sysfs_destroy(MKDEV(OSST_MAJOR, i+128));
tpnt->device = NULL;
+ for (mode = 0; mode < ST_NBR_MODES; ++mode) {
+ devfs_remove("%s/ot%s", SDp->devfs_name, osst_formats[mode]);
+ devfs_remove("%s/ot%sn", SDp->devfs_name, osst_formats[mode]);
+ }
+ devfs_unregister_tape(tpnt->drive->number);
put_disk(tpnt->drive);
os_scsi_tapes[i] = NULL;
osst_nr_dev--;
diff -ur linux-2.6.17/drivers/scsi/scsi.c linux-2.6.17-devfs/drivers/scsi/scsi.c
--- linux-2.6.17/drivers/scsi/scsi.c 2006-06-17 18:49:35.000000000 -0700
+++ linux-2.6.17-devfs/drivers/scsi/scsi.c 2006-08-25 11:07:42.000000000 -0700
@@ -48,6 +48,7 @@
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/completion.h>
+#include <linux/devfs_fs_kernel.h>
#include <linux/unistd.h>
#include <linux/spinlock.h>
#include <linux/kmod.h>
@@ -1247,6 +1248,7 @@
for_each_possible_cpu(i)
INIT_LIST_HEAD(&per_cpu(scsi_done_q, i));
+ devfs_mk_dir("scsi");
printk(KERN_NOTICE "SCSI subsystem initialized\n");
return 0;
@@ -1271,6 +1273,7 @@
scsi_exit_sysctl();
scsi_exit_hosts();
scsi_exit_devinfo();
+ devfs_remove("scsi");
scsi_exit_procfs();
scsi_exit_queue();
}
diff -ur linux-2.6.17/drivers/scsi/scsi_scan.c linux-2.6.17-devfs/drivers/scsi/scsi_scan.c
--- linux-2.6.17/drivers/scsi/scsi_scan.c 2006-06-17 18:49:35.000000000 -0700
+++ linux-2.6.17-devfs/drivers/scsi/scsi_scan.c 2006-08-25 11:06:18.000000000 -0700
@@ -716,8 +716,12 @@
if (inq_result[7] & 0x10)
sdev->sdtr = 1;
+ sprintf(sdev->devfs_name, "scsi/host%d/bus%d/target%d/lun%d",
+ sdev->host->host_no, sdev->channel,
+ sdev->id, sdev->lun);
+
/*
- * End sysfs code.
+ * End driverfs/devfs code.
*/
if ((sdev->scsi_level >= SCSI_2) && (inq_result[7] & 2) &&
diff -ur linux-2.6.17/drivers/scsi/sd.c linux-2.6.17-devfs/drivers/scsi/sd.c
--- linux-2.6.17/drivers/scsi/sd.c 2006-06-17 18:49:35.000000000 -0700
+++ linux-2.6.17-devfs/drivers/scsi/sd.c 2006-08-25 11:06:18.000000000 -0700
@@ -1683,6 +1683,8 @@
'a' + m1, 'a' + m2, 'a' + m3);
}
+ strcpy(gd->devfs_name, sdp->devfs_name);
+
gd->private_data = &sdkp->driver;
gd->queue = sdkp->device->request_queue;
diff -ur linux-2.6.17/drivers/scsi/sg.c linux-2.6.17-devfs/drivers/scsi/sg.c
--- linux-2.6.17/drivers/scsi/sg.c 2006-06-17 18:49:35.000000000 -0700
+++ linux-2.6.17-devfs/drivers/scsi/sg.c 2006-08-25 11:06:18.000000000 -0700
@@ -44,6 +44,7 @@
#include <linux/poll.h>
#include <linux/smp_lock.h>
#include <linux/moduleparam.h>
+#include <linux/devfs_fs_kernel.h>
#include <linux/cdev.h>
#include <linux/seq_file.h>
#include <linux/blkdev.h>
@@ -1427,10 +1428,14 @@
k = error;
sdp = sg_dev_arr[k];
+ devfs_mk_cdev(MKDEV(SCSI_GENERIC_MAJOR, k),
+ S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP,
+ "%s/generic", scsidp->devfs_name);
error = cdev_add(cdev, MKDEV(SCSI_GENERIC_MAJOR, k), 1);
- if (error)
+ if (error) {
+ devfs_remove("%s/generic", scsidp->devfs_name);
goto out;
-
+ }
sdp->cdev = cdev;
if (sg_sysfs_valid) {
struct class_device * sg_class_member;
@@ -1520,6 +1525,7 @@
class_device_destroy(sg_sysfs_class, MKDEV(SCSI_GENERIC_MAJOR, k));
cdev_del(sdp->cdev);
sdp->cdev = NULL;
+ devfs_remove("%s/generic", scsidp->devfs_name);
put_disk(sdp->disk);
sdp->disk = NULL;
if (NULL == sdp->headfp)
diff -ur linux-2.6.17/drivers/scsi/sr.c linux-2.6.17-devfs/drivers/scsi/sr.c
--- linux-2.6.17/drivers/scsi/sr.c 2006-06-17 18:49:35.000000000 -0700
+++ linux-2.6.17-devfs/drivers/scsi/sr.c 2006-08-25 11:06:18.000000000 -0700
@@ -592,6 +592,8 @@
get_capabilities(cd);
sr_vendor_init(cd);
+ snprintf(disk->devfs_name, sizeof(disk->devfs_name),
+ "%s/cd", sdev->devfs_name);
disk->driverfs_dev = &sdev->sdev_gendev;
set_capacity(disk, cd->capacity);
disk->private_data = &cd->driver;
diff -ur linux-2.6.17/drivers/scsi/st.c linux-2.6.17-devfs/drivers/scsi/st.c
--- linux-2.6.17/drivers/scsi/st.c 2006-06-17 18:49:35.000000000 -0700
+++ linux-2.6.17-devfs/drivers/scsi/st.c 2006-08-25 11:06:18.000000000 -0700
@@ -35,6 +35,7 @@
#include <linux/spinlock.h>
#include <linux/blkdev.h>
#include <linux/moduleparam.h>
+#include <linux/devfs_fs_kernel.h>
#include <linux/cdev.h>
#include <linux/delay.h>
#include <linux/mutex.h>
@@ -4053,8 +4054,23 @@
do_create_class_files(tpnt, dev_num, mode);
}
+ for (mode = 0; mode < ST_NBR_MODES; ++mode) {
+ /* Make sure that the minor numbers corresponding to the four
+ first modes always get the same names */
+ i = mode << (4 - ST_NBR_MODE_BITS);
+ /* Rewind entry */
+ devfs_mk_cdev(MKDEV(SCSI_TAPE_MAJOR, TAPE_MINOR(dev_num, mode, 0)),
+ S_IFCHR | S_IRUGO | S_IWUGO,
+ "%s/mt%s", SDp->devfs_name, st_formats[i]);
+ /* No-rewind entry */
+ devfs_mk_cdev(MKDEV(SCSI_TAPE_MAJOR, TAPE_MINOR(dev_num, mode, 1)),
+ S_IFCHR | S_IRUGO | S_IWUGO,
+ "%s/mt%sn", SDp->devfs_name, st_formats[i]);
+ }
+ disk->number = devfs_register_tape(SDp->devfs_name);
+
sdev_printk(KERN_WARNING, SDp,
"Attached scsi tape %s\n", tape_name(tpnt));
printk(KERN_WARNING "%s: try direct i/o: %s (alignment %d B)\n",
tape_name(tpnt), tpnt->try_dio ? "yes" : "no",
queue_dma_alignment(SDp->request_queue) + 1);
@@ -4106,9 +4122,13 @@
scsi_tapes[i] = NULL;
st_nr_dev--;
write_unlock(&st_dev_arr_lock);
+ devfs_unregister_tape(tpnt->disk->number);
sysfs_remove_link(&tpnt->device->sdev_gendev.kobj,
"tape");
for (mode = 0; mode < ST_NBR_MODES; ++mode) {
+ j = mode << (4 - ST_NBR_MODE_BITS);
+ devfs_remove("%s/mt%s", SDp->devfs_name, st_formats[j]);
+ devfs_remove("%s/mt%sn", SDp->devfs_name, st_formats[j]);
for (j=0; j < 2; j++) {
class_device_destroy(st_sysfs_class,
MKDEV(SCSI_TAPE_MAJOR,
diff -ur linux-2.6.17/include/scsi/scsi_device.h linux-2.6.17-devfs/include/scsi/scsi_device.h
--- linux-2.6.17/include/scsi/scsi_device.h 2006-06-17 18:49:35.000000000 -0700
+++ linux-2.6.17-devfs/include/scsi/scsi_device.h 2006-08-25 11:06:18.000000000 -0700
@@ -74,6 +74,7 @@
unsigned sector_size; /* size in bytes */
void *hostdata; /* available to low-level driver */
+ char devfs_name[256]; /* devfs junk */
char type;
char scsi_level;
char inq_periph_qual; /* PQ from INQUIRY data */

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
diff --new-file -urp linux-2.6.15/fs/Kconfig linux-2.6.15-squashfs3.0/fs/Kconfig
--- linux-2.6.15/fs/Kconfig 2006-03-01 22:37:27.000000000 +0000
+++ linux-2.6.15-squashfs3.0/fs/Kconfig 2006-03-07 21:12:37.000000000 +0000
@@ -1151,6 +1151,71 @@ config CRAMFS
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 @@
If unsure, say N.
@@ -32,7 +32,7 @@ diff --new-file -urp linux-2.6.15/fs/Kconfig linux-2.6.15-squashfs3.0/fs/Kconfig
+
+config SQUASHFS_EMBEDDED
+
+ bool "Additional options for memory-constrained systems"
+ bool "Additional options for memory-constrained systems"
+ depends on SQUASHFS
+ default n
+ help
@@ -72,22 +72,22 @@ diff --new-file -urp linux-2.6.15/fs/Kconfig linux-2.6.15-squashfs3.0/fs/Kconfig
+
config VXFS_FS
tristate "FreeVxFS file system support (VERITAS VxFS(TM) compatible)"
help
diff --new-file -urp linux-2.6.15/fs/Makefile linux-2.6.15-squashfs3.0/fs/Makefile
--- linux-2.6.15/fs/Makefile 2006-03-01 22:37:27.000000000 +0000
+++ linux-2.6.15-squashfs3.0/fs/Makefile 2006-03-07 21:12:37.000000000 +0000
@@ -55,6 +55,7 @@ obj-$(CONFIG_EXT3_FS) += ext3/ # Before
obj-$(CONFIG_JBD) += jbd/
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 @@
obj-$(CONFIG_JBD2) += jbd2/
obj-$(CONFIG_EXT2_FS) += ext2/
obj-$(CONFIG_CRAMFS) += cramfs/
+obj-$(CONFIG_SQUASHFS) += squashfs/
obj-$(CONFIG_RAMFS) += ramfs/
obj-$(CONFIG_HUGETLBFS) += hugetlbfs/
obj-$(CONFIG_CODA_FS) += coda/
diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/fs/squashfs/inode.c
--- linux-2.6.15/fs/squashfs/inode.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15-squashfs3.0/fs/squashfs/inode.c 2006-03-07 21:12:37.000000000 +0000
@@ -0,0 +1,2127 @@
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
@@ -0,0 +1,2124 @@
+/*
+ * Squashfs - a compressed read only filesystem for Linux
+ *
@@ -135,7 +135,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+#include "squashfs.h"
+
+static void squashfs_put_super(struct super_block *);
+static int squashfs_statfs(struct super_block *, struct kstatfs *);
+static int squashfs_statfs(struct dentry *, struct kstatfs *);
+static int squashfs_symlink_readpage(struct file *file, struct page *page);
+static int squashfs_readpage(struct file *file, struct page *page);
+static int squashfs_readpage4K(struct file *file, struct page *page);
@@ -150,8 +150,8 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+static long long read_blocklist(struct inode *inode, int index,
+ int readahead_blks, char *block_list,
+ unsigned short **block_p, unsigned int *bsize);
+static struct super_block *squashfs_get_sb(struct file_system_type *, int,
+ const char *, void *);
+static int squashfs_get_sb(struct file_system_type *, int,
+ const char *, void *, struct vfsmount *);
+
+
+static z_stream stream;
@@ -219,10 +219,10 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ goto out;
+ if (msblk->swap)
+ ((unsigned char *) &temp)[0] = *((unsigned char *)
+ bh->b_data);
+ bh->b_data);
+ else
+ ((unsigned char *) &temp)[1] = *((unsigned char *)
+ bh->b_data);
+ bh->b_data);
+ *c_byte = temp;
+ *offset = 1;
+ } else {
@@ -230,12 +230,12 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ ((unsigned char *) &temp)[1] = *((unsigned char *)
+ (bh->b_data + *offset));
+ ((unsigned char *) &temp)[0] = *((unsigned char *)
+ (bh->b_data + *offset + 1));
+ (bh->b_data + *offset + 1));
+ } else {
+ ((unsigned char *) &temp)[0] = *((unsigned char *)
+ (bh->b_data + *offset));
+ ((unsigned char *) &temp)[1] = *((unsigned char *)
+ (bh->b_data + *offset + 1));
+ (bh->b_data + *offset + 1));
+ }
+ *c_byte = temp;
+ *offset += 2;
@@ -353,7 +353,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ bytes = 0;
+ } else
+ bytes = stream.total_out;
+
+
+ up(&msblk->read_data_mutex);
+ }
+
@@ -385,10 +385,10 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ TRACE("Entered squashfs_get_cached_block [%llx:%x]\n", block, offset);
+
+ while ( 1 ) {
+ for (i = 0; i < SQUASHFS_CACHED_BLKS; i++)
+ for (i = 0; i < SQUASHFS_CACHED_BLKS; i++)
+ if (msblk->block_cache[i].block == block)
+ break;
+
+ break;
+
+ down(&msblk->block_cache_mutex);
+
+ if (i == SQUASHFS_CACHED_BLKS) {
@@ -425,7 +425,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ goto out;
+ }
+ }
+
+
+ msblk->block_cache[i].block = SQUASHFS_USED_BLK;
+ up(&msblk->block_cache_mutex);
+
@@ -564,7 +564,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ }
+ msblk->next_fragment = (msblk->next_fragment + 1) %
+ SQUASHFS_CACHED_FRAGMENTS;
+
+
+ if (msblk->fragment[i].data == NULL)
+ if (!(msblk->fragment[i].data = SQUASHFS_ALLOC
+ (SQUASHFS_FILE_MAX_SIZE))) {
@@ -668,7 +668,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ long long frag_blk;
+ struct squashfs_reg_inode_header *inodep = &id.reg;
+ struct squashfs_reg_inode_header *sinodep = &sid.reg;
+
+
+ if (msblk->swap) {
+ if (!squashfs_get_cached_block(s, (char *)
+ sinodep, block, offset,
@@ -688,7 +688,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ !get_fragment_location(s,
+ inodep->fragment, &frag_blk, &frag_size))
+ goto failed_read;
+
+
+ if((i = squashfs_new_inode(s, inodeb)) == NULL)
+ goto failed_read1;
+
@@ -697,7 +697,6 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ i->i_fop = &generic_ro_fops;
+ i->i_mode |= S_IFREG;
+ i->i_blocks = ((i->i_size - 1) >> 9) + 1;
+ i->i_blksize = PAGE_CACHE_SIZE;
+ SQUASHFS_I(i)->u.s1.fragment_start_block = frag_blk;
+ SQUASHFS_I(i)->u.s1.fragment_size = frag_size;
+ SQUASHFS_I(i)->u.s1.fragment_offset = inodep->offset;
@@ -721,7 +720,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ long long frag_blk;
+ struct squashfs_lreg_inode_header *inodep = &id.lreg;
+ struct squashfs_lreg_inode_header *sinodep = &sid.lreg;
+
+
+ if (msblk->swap) {
+ if (!squashfs_get_cached_block(s, (char *)
+ sinodep, block, offset,
@@ -741,7 +740,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ !get_fragment_location(s,
+ inodep->fragment, &frag_blk, &frag_size))
+ goto failed_read;
+
+
+ if((i = squashfs_new_inode(s, inodeb)) == NULL)
+ goto failed_read1;
+
@@ -750,7 +749,6 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ i->i_fop = &generic_ro_fops;
+ i->i_mode |= S_IFREG;
+ i->i_blocks = ((i->i_size - 1) >> 9) + 1;
+ i->i_blksize = PAGE_CACHE_SIZE;
+ SQUASHFS_I(i)->u.s1.fragment_start_block = frag_blk;
+ SQUASHFS_I(i)->u.s1.fragment_size = frag_size;
+ SQUASHFS_I(i)->u.s1.fragment_offset = inodep->offset;
@@ -853,7 +851,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ &id.symlink;
+ struct squashfs_symlink_inode_header *sinodep =
+ &sid.symlink;
+
+
+ if (msblk->swap) {
+ if (!squashfs_get_cached_block(s, (char *)
+ sinodep, block, offset,
@@ -898,7 +896,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ &next_offset))
+ goto failed_read;
+ SQUASHFS_SWAP_DEV_INODE_HEADER(inodep, sinodep);
+ } else
+ } else
+ if (!squashfs_get_cached_block(s, (char *)
+ inodep, block, offset,
+ sizeof(*inodep), &next_block,
@@ -932,7 +930,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ &next_offset))
+ goto failed_read;
+ SQUASHFS_SWAP_IPC_INODE_HEADER(inodep, sinodep);
+ } else
+ } else
+ if (!squashfs_get_cached_block(s, (char *)
+ inodep, block, offset,
+ sizeof(*inodep), &next_block,
@@ -953,7 +951,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ inodeb->inode_type);
+ goto failed_read1;
+ }
+
+
+ insert_inode_hash(i);
+ return i;
+
@@ -976,7 +974,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ ERROR("Failed to allocate uid/gid table\n");
+ return 0;
+ }
+
+
+ if (SQUASHFS_FRAGMENT_INDEX_BYTES(sblk->fragments) &&
+ !squashfs_read_data(s, (char *)
+ msblk->fragment_index,
@@ -1058,7 +1056,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ memset(s->s_fs_info, 0, sizeof(struct squashfs_sb_info));
+ msblk = s->s_fs_info;
+ sblk = &msblk->sblk;
+
+
+ msblk->devblksize = sb_min_blocksize(s, BLOCK_SIZE);
+ msblk->devblksize_log2 = ffz(~msblk->devblksize);
+
@@ -1067,7 +1065,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ init_MUTEX(&msblk->block_cache_mutex);
+ init_MUTEX(&msblk->fragment_mutex);
+ init_MUTEX(&msblk->meta_index_mutex);
+
+
+ init_waitqueue_head(&msblk->waitq);
+ init_waitqueue_head(&msblk->fragment_wait_queue);
+
@@ -1163,7 +1161,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ goto failed_mount;
+ }
+ msblk->guid = msblk->uid + sblk->no_uids;
+
+
+ if (msblk->swap) {
+ unsigned int suid[sblk->no_uids + sblk->no_guids];
+
@@ -1238,9 +1236,9 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+}
+
+
+static int squashfs_statfs(struct super_block *s, struct kstatfs *buf)
+static int squashfs_statfs(struct dentry *dentry, struct kstatfs *buf)
+{
+ struct squashfs_sb_info *msblk = s->s_fs_info;
+ struct squashfs_sb_info *msblk = dentry->d_inode->i_sb->s_fs_info;
+ struct squashfs_super_block *sblk = &msblk->sblk;
+
+ TRACE("Entered squashfs_statfs\n");
@@ -1402,7 +1400,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ struct squashfs_sb_info *msblk = s->s_fs_info;
+ unsigned int *block_listp;
+ int block = 0;
+
+
+ if (msblk->swap) {
+ char sblock_list[blocks << 2];
+
@@ -1455,7 +1453,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ int cur_offset = SQUASHFS_I(inode)->offset;
+ long long cur_data_block = SQUASHFS_I(inode)->start_block;
+ int i;
+
+
+ index /= SQUASHFS_META_INDEXES * skip;
+
+ while ( offset < index ) {
@@ -1578,7 +1576,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ void *pageaddr;
+ struct squashfs_fragment_cache *fragment = NULL;
+ char *data_ptr = msblk->read_page;
+
+
+ int mask = (1 << (sblk->block_log - PAGE_CACHE_SHIFT)) - 1;
+ int start_index = page->index & ~mask;
+ int end_index = start_index | mask;
@@ -1599,7 +1597,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ goto skip_read;
+
+ down(&msblk->read_page_mutex);
+
+
+ if (!(bytes = squashfs_read_data(inode->i_sb, msblk->read_page,
+ block, bsize, NULL))) {
+ ERROR("Unable to read page, block %llx, size %x\n", block,
@@ -1692,7 +1690,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ long long block;
+ unsigned int bsize, bytes = 0;
+ void *pageaddr;
+
+
+ TRACE("Entered squashfs_readpage4K, page index %lx, start block %llx\n",
+ page->index,
+ SQUASHFS_I(inode)->start_block);
@@ -1749,7 +1747,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+}
+
+
+static int get_dir_index_using_offset(struct super_block *s, long long
+static int get_dir_index_using_offset(struct super_block *s, long long
+ *next_block, unsigned int *next_offset,
+ long long index_start,
+ unsigned int index_offset, int i_count,
@@ -1848,7 +1846,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ return length + 3;
+}
+
+
+
+static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir)
+{
+ struct inode *i = file->f_dentry->d_inode;
@@ -1902,7 +1900,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ /* read directory header */
+ if (msblk->swap) {
+ struct squashfs_dir_header sdirh;
+
+
+ if (!squashfs_get_cached_block(i->i_sb, (char *) &sdirh,
+ next_block, next_offset, sizeof(sdirh),
+ &next_block, &next_offset))
@@ -1928,7 +1926,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ sizeof(sdire), &next_block,
+ &next_offset))
+ goto failed_read;
+
+
+ length += sizeof(sdire);
+ SQUASHFS_SWAP_DIR_ENTRY(dire, &sdire);
+ } else {
@@ -2040,7 +2038,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ sizeof(sdire), &next_block,
+ &next_offset))
+ goto failed_read;
+
+
+ length += sizeof(sdire);
+ SQUASHFS_SWAP_DIR_ENTRY(dire, &sdire);
+ } else {
@@ -2104,7 +2102,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ SQUASHFS_INVALID_BLK)
+ kfree(sbi->block_cache[i].data);
+ if (sbi->fragment)
+ for (i = 0; i < SQUASHFS_CACHED_FRAGMENTS; i++)
+ for (i = 0; i < SQUASHFS_CACHED_FRAGMENTS; i++)
+ SQUASHFS_FREE(sbi->fragment[i].data);
+ kfree(sbi->fragment);
+ kfree(sbi->block_cache);
@@ -2120,10 +2118,11 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+}
+
+
+static struct super_block *squashfs_get_sb(struct file_system_type *fs_type,
+ int flags, const char *dev_name, void *data)
+static int squashfs_get_sb(struct file_system_type *fs_type,
+ int flags, const char *dev_name, void *data,
+ struct vfsmount *mnt)
+{
+ return get_sb_bdev(fs_type, flags, dev_name, data, squashfs_fill_super);
+ return get_sb_bdev(fs_type, flags, dev_name, data, squashfs_fill_super, mnt);
+}
+
+
@@ -2188,7 +2187,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+ SLAB_CTOR_CONSTRUCTOR)
+ inode_init_once(&ei->vfs_inode);
+}
+
+
+
+static int __init init_inodecache(void)
+{
@@ -2204,9 +2203,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+
+static void destroy_inodecache(void)
+{
+ if (kmem_cache_destroy(squashfs_inode_cachep))
+ printk(KERN_INFO "squashfs_inode_cache: not all structures "
+ "were freed\n");
+ kmem_cache_destroy(squashfs_inode_cachep);
+}
+
+
@@ -2215,9 +2212,9 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/inode.c linux-2.6.15-squashfs3.0/f
+MODULE_DESCRIPTION("squashfs, a compressed read-only filesystem");
+MODULE_AUTHOR("Phillip Lougher <phillip@lougher.org.uk>");
+MODULE_LICENSE("GPL");
diff --new-file -urp linux-2.6.15/fs/squashfs/Makefile linux-2.6.15-squashfs3.0/fs/squashfs/Makefile
--- linux-2.6.15/fs/squashfs/Makefile 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15-squashfs3.0/fs/squashfs/Makefile 2006-03-07 21:12:37.000000000 +0000
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
@@ -0,0 +1,7 @@
+#
+# Makefile for the linux squashfs routines.
@@ -2226,9 +2223,9 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/Makefile linux-2.6.15-squashfs3.0/
+obj-$(CONFIG_SQUASHFS) += squashfs.o
+squashfs-y += inode.o
+squashfs-y += squashfs2_0.o
diff --new-file -urp linux-2.6.15/fs/squashfs/squashfs2_0.c linux-2.6.15-squashfs3.0/fs/squashfs/squashfs2_0.c
--- linux-2.6.15/fs/squashfs/squashfs2_0.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15-squashfs3.0/fs/squashfs/squashfs2_0.c 2006-03-07 21:12:37.000000000 +0000
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
@@ -0,0 +1,758 @@
+/*
+ * Squashfs - a compressed read only filesystem for Linux
@@ -2302,7 +2299,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/squashfs2_0.c linux-2.6.15-squashf
+ ERROR("Failed to allocate uid/gid table\n");
+ return 0;
+ }
+
+
+ if (SQUASHFS_FRAGMENT_INDEX_BYTES_2(sblk->fragments) &&
+ !squashfs_read_data(s, (char *)
+ msblk->fragment_index_2,
@@ -2429,7 +2426,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/squashfs2_0.c linux-2.6.15-squashf
+ struct squashfs_reg_inode_header_2 *sinodep = &sid.reg;
+ long long frag_blk;
+ unsigned int frag_size;
+
+
+ if (msblk->swap) {
+ if (!squashfs_get_cached_block(s, (char *)
+ sinodep, block, offset,
@@ -2449,7 +2446,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/squashfs2_0.c linux-2.6.15-squashf
+ !get_fragment_location_2(s,
+ inodep->fragment, &frag_blk, &frag_size))
+ goto failed_read;
+
+
+ if((i = squashfs_new_inode(s, inodeb, ino)) == NULL)
+ goto failed_read1;
+
@@ -2567,7 +2564,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/squashfs2_0.c linux-2.6.15-squashf
+ &id.symlink;
+ struct squashfs_symlink_inode_header_2 *sinodep =
+ &sid.symlink;
+
+
+ if (msblk->swap) {
+ if (!squashfs_get_cached_block(s, (char *)
+ sinodep, block, offset,
@@ -2611,7 +2608,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/squashfs2_0.c linux-2.6.15-squashf
+ &next_offset))
+ goto failed_read;
+ SQUASHFS_SWAP_DEV_INODE_HEADER_2(inodep, sinodep);
+ } else
+ } else
+ if (!squashfs_get_cached_block(s, (char *)
+ inodep, block, offset,
+ sizeof(*inodep), &next_block,
@@ -2647,7 +2644,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/squashfs2_0.c linux-2.6.15-squashf
+ inodeb->inode_type);
+ goto failed_read1;
+ }
+
+
+ insert_inode_hash(i);
+ return i;
+
@@ -2659,7 +2656,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/squashfs2_0.c linux-2.6.15-squashf
+}
+
+
+static int get_dir_index_using_offset(struct super_block *s, long long
+static int get_dir_index_using_offset(struct super_block *s, long long
+ *next_block, unsigned int *next_offset,
+ long long index_start,
+ unsigned int index_offset, int i_count,
@@ -2757,7 +2754,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/squashfs2_0.c linux-2.6.15-squashf
+ return length;
+}
+
+
+
+static int squashfs_readdir_2(struct file *file, void *dirent, filldir_t filldir)
+{
+ struct inode *i = file->f_dentry->d_inode;
@@ -2783,7 +2780,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/squashfs2_0.c linux-2.6.15-squashf
+ /* read directory header */
+ if (msblk->swap) {
+ struct squashfs_dir_header_2 sdirh;
+
+
+ if (!squashfs_get_cached_block(i->i_sb, (char *) &sdirh,
+ next_block, next_offset, sizeof(sdirh),
+ &next_block, &next_offset))
@@ -2809,7 +2806,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/squashfs2_0.c linux-2.6.15-squashf
+ sizeof(sdire), &next_block,
+ &next_offset))
+ goto failed_read;
+
+
+ length += sizeof(sdire);
+ SQUASHFS_SWAP_DIR_ENTRY_2(dire, &sdire);
+ } else {
@@ -2921,7 +2918,7 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/squashfs2_0.c linux-2.6.15-squashf
+ sizeof(sdire), &next_block,
+ &next_offset))
+ goto failed_read;
+
+
+ length += sizeof(sdire);
+ SQUASHFS_SWAP_DIR_ENTRY_2(dire, &sdire);
+ } else {
@@ -2988,9 +2985,9 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/squashfs2_0.c linux-2.6.15-squashf
+
+ return 1;
+}
diff --new-file -urp linux-2.6.15/fs/squashfs/squashfs.h linux-2.6.15-squashfs3.0/fs/squashfs/squashfs.h
--- linux-2.6.15/fs/squashfs/squashfs.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15-squashfs3.0/fs/squashfs/squashfs.h 2006-03-07 21:12:37.000000000 +0000
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
@@ -0,0 +1,86 @@
+/*
+ * Squashfs - a compressed read only filesystem for Linux
@@ -3078,9 +3075,9 @@ diff --new-file -urp linux-2.6.15/fs/squashfs/squashfs.h linux-2.6.15-squashfs3.
+ return 0;
+}
+#endif
diff --new-file -urp linux-2.6.15/include/linux/squashfs_fs.h linux-2.6.15-squashfs3.0/include/linux/squashfs_fs.h
--- linux-2.6.15/include/linux/squashfs_fs.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15-squashfs3.0/include/linux/squashfs_fs.h 2006-03-07 21:12:37.000000000 +0000
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
@@ -0,0 +1,911 @@
+#ifndef SQUASHFS_FS
+#define SQUASHFS_FS
@@ -3119,7 +3116,7 @@ diff --new-file -urp linux-2.6.15/include/linux/squashfs_fs.h linux-2.6.15-squas
+#define SQUASHFS_ALLOC(a) kmalloc(a, GFP_KERNEL)
+#define SQUASHFS_FREE(a) kfree(a)
+#endif
+#define SQUASHFS_CACHED_FRAGMENTS CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE
+#define SQUASHFS_CACHED_FRAGMENTS CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE
+#define SQUASHFS_MAJOR 3
+#define SQUASHFS_MINOR 0
+#define SQUASHFS_MAGIC 0x73717368
@@ -3351,7 +3348,7 @@ diff --new-file -urp linux-2.6.15/include/linux/squashfs_fs.h linux-2.6.15-squas
+ unsigned int nlink;
+ unsigned short rdev;
+} __attribute__ ((packed));
+
+
+struct squashfs_symlink_inode_header {
+ SQUASHFS_BASE_INODE_HEADER;
+ unsigned int nlink;
@@ -3408,7 +3405,7 @@ diff --new-file -urp linux-2.6.15/include/linux/squashfs_fs.h linux-2.6.15-squas
+ struct squashfs_ldir_inode_header ldir;
+ struct squashfs_ipc_inode_header ipc;
+};
+
+
+struct squashfs_dir_entry {
+ unsigned int offset:13;
+ unsigned int type:3;
@@ -3658,7 +3655,7 @@ diff --new-file -urp linux-2.6.15/include/linux/squashfs_fs.h linux-2.6.15-squas
+ unsigned int guid:4; /* index into guid table */
+ unsigned short rdev;
+} __attribute__ ((packed));
+
+
+struct squashfs_symlink_inode_header_1 {
+ unsigned int inode_type:4;
+ unsigned int mode:12; /* protection */
@@ -3775,7 +3772,7 @@ diff --new-file -urp linux-2.6.15/include/linux/squashfs_fs.h linux-2.6.15-squas
+ unsigned int guid:8; /* index into guid table */
+ unsigned short rdev;
+} __attribute__ ((packed));
+
+
+struct squashfs_symlink_inode_header_2 {
+ unsigned int inode_type:4;
+ unsigned int mode:12; /* protection */
@@ -3831,7 +3828,7 @@ diff --new-file -urp linux-2.6.15/include/linux/squashfs_fs.h linux-2.6.15-squas
+ struct squashfs_ldir_inode_header_2 ldir;
+ struct squashfs_ipc_inode_header_2 ipc;
+};
+
+
+struct squashfs_dir_header_2 {
+ unsigned int count:8;
+ unsigned int start_block:24;
@@ -3974,7 +3971,7 @@ diff --new-file -urp linux-2.6.15/include/linux/squashfs_fs.h linux-2.6.15-squas
+#define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, \
+ tbits, b_pos)
+#else
+ /* convert from big endian to little endian */
+ /* convert from big endian to little endian */
+#define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, \
+ tbits, 64 - tbits - b_pos)
+#endif
@@ -3993,9 +3990,9 @@ diff --new-file -urp linux-2.6.15/include/linux/squashfs_fs.h linux-2.6.15-squas
+
+#endif
+#endif
diff --new-file -urp linux-2.6.15/include/linux/squashfs_fs_i.h linux-2.6.15-squashfs3.0/include/linux/squashfs_fs_i.h
--- linux-2.6.15/include/linux/squashfs_fs_i.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15-squashfs3.0/include/linux/squashfs_fs_i.h 2006-03-07 21:12:37.000000000 +0000
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
@@ -0,0 +1,45 @@
+#ifndef SQUASHFS_FS_I
+#define SQUASHFS_FS_I
@@ -4042,9 +4039,9 @@ diff --new-file -urp linux-2.6.15/include/linux/squashfs_fs_i.h linux-2.6.15-squ
+ struct inode vfs_inode;
+};
+#endif
diff --new-file -urp linux-2.6.15/include/linux/squashfs_fs_sb.h linux-2.6.15-squashfs3.0/include/linux/squashfs_fs_sb.h
--- linux-2.6.15/include/linux/squashfs_fs_sb.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15-squashfs3.0/include/linux/squashfs_fs_sb.h 2006-03-07 21:12:37.000000000 +0000
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
@@ -0,0 +1,74 @@
+#ifndef SQUASHFS_FS_SB
+#define SQUASHFS_FS_SB
@@ -4120,9 +4117,9 @@ diff --new-file -urp linux-2.6.15/include/linux/squashfs_fs_sb.h linux-2.6.15-sq
+ int (*read_fragment_index_table)(struct super_block *s);
+};
+#endif
diff --new-file -urp linux-2.6.15/init/do_mounts_rd.c linux-2.6.15-squashfs3.0/init/do_mounts_rd.c
--- linux-2.6.15/init/do_mounts_rd.c 2006-03-01 22:37:27.000000000 +0000
+++ linux-2.6.15-squashfs3.0/init/do_mounts_rd.c 2006-03-07 21:12:37.000000000 +0000
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
@@ -5,6 +5,7 @@
#include <linux/ext2_fs.h>
#include <linux/romfs_fs.h>
@@ -4131,7 +4128,7 @@ diff --new-file -urp linux-2.6.15/init/do_mounts_rd.c linux-2.6.15-squashfs3.0/i
#include <linux/initrd.h>
#include <linux/string.h>
@@ -39,6 +40,7 @@ static int __init crd_load(int in_fd, in
@@ -39,6 +40,7 @@
* numbers could not be found.
*
* We currently check for the following magic numbers:
@@ -4139,7 +4136,7 @@ diff --new-file -urp linux-2.6.15/init/do_mounts_rd.c linux-2.6.15-squashfs3.0/i
* minix
* ext2
* romfs
@@ -53,6 +55,7 @@ identify_ramdisk_image(int fd, int start
@@ -53,6 +55,7 @@
struct ext2_super_block *ext2sb;
struct romfs_super_block *romfsb;
struct cramfs_super *cramfsb;
@@ -4147,7 +4144,7 @@ diff --new-file -urp linux-2.6.15/init/do_mounts_rd.c linux-2.6.15-squashfs3.0/i
int nblocks = -1;
unsigned char *buf;
@@ -64,6 +67,7 @@ identify_ramdisk_image(int fd, int start
@@ -64,6 +67,7 @@
ext2sb = (struct ext2_super_block *) buf;
romfsb = (struct romfs_super_block *) buf;
cramfsb = (struct cramfs_super *) buf;
@@ -4155,7 +4152,7 @@ diff --new-file -urp linux-2.6.15/init/do_mounts_rd.c linux-2.6.15-squashfs3.0/i
memset(buf, 0xe5, size);
/*
@@ -101,6 +105,15 @@ identify_ramdisk_image(int fd, int start
@@ -101,6 +105,15 @@
goto done;
}

View File

@@ -1,6 +1,6 @@
diff -Nur linux-2.6.16/fs/squashfs/inode.c linux-2.6.16-owrt/fs/squashfs/inode.c
--- linux-2.6.16/fs/squashfs/inode.c 2006-03-21 10:55:59.000000000 +0100
+++ linux-2.6.16-owrt/fs/squashfs/inode.c 2006-03-21 12:24:37.000000000 +0100
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 2006-12-14 03:13:20.000000000 +0100
+++ linux-2.6.19.dev/fs/squashfs/inode.c 2006-12-14 03:13:20.000000000 +0100
@@ -4,6 +4,9 @@
* Copyright (c) 2002, 2003, 2004, 2005, 2006
* Phillip Lougher <phillip@lougher.org.uk>
@@ -37,10 +37,10 @@ diff -Nur linux-2.6.16/fs/squashfs/inode.c linux-2.6.16-owrt/fs/squashfs/inode.c
+#endif
+
static void squashfs_put_super(struct super_block *);
static int squashfs_statfs(struct super_block *, struct kstatfs *);
static int squashfs_statfs(struct dentry *, struct kstatfs *);
static int squashfs_symlink_readpage(struct file *file, struct page *page);
@@ -64,7 +81,11 @@
const char *, void *);
const char *, void *, struct vfsmount *);
+#ifdef SQUASHFS_LZMA
@@ -56,8 +56,8 @@ diff -Nur linux-2.6.16/fs/squashfs/inode.c linux-2.6.16-owrt/fs/squashfs/inode.c
int zlib_err;
+#ifdef SQUASHFS_LZMA
+ if ((zlib_err = LzmaDecode(lzma_workspace,
+ LZMA_WORKSPACE_SIZE, LZMA_LC, LZMA_LP, LZMA_PB,
+ if ((zlib_err = LzmaDecode(lzma_workspace,
+ LZMA_WORKSPACE_SIZE, LZMA_LC, LZMA_LP, LZMA_PB,
+ c_buffer, c_byte, buffer, msblk->read_size, &bytes)) != LZMA_RESULT_OK)
+ {
+ ERROR("lzma returned unexpected result 0x%x\n", zlib_err);
@@ -67,15 +67,16 @@ diff -Nur linux-2.6.16/fs/squashfs/inode.c linux-2.6.16-owrt/fs/squashfs/inode.c
stream.next_in = c_buffer;
stream.avail_in = c_byte;
stream.next_out = buffer;
@@ -263,6 +293,7 @@
@@ -263,7 +293,7 @@
bytes = 0;
} else
bytes = stream.total_out;
-
+#endif
up(&msblk->read_data_mutex);
}
@@ -2046,15 +2077,19 @@
@@ -2045,15 +2075,19 @@
printk(KERN_INFO "squashfs: version 3.0 (2006/03/15) "
"Phillip Lougher\n");
@@ -95,7 +96,7 @@ diff -Nur linux-2.6.16/fs/squashfs/inode.c linux-2.6.16-owrt/fs/squashfs/inode.c
destroy_inodecache();
}
@@ -2065,7 +2100,9 @@
@@ -2064,7 +2098,9 @@
static void __exit exit_squashfs_fs(void)
{
@@ -105,28 +106,28 @@ diff -Nur linux-2.6.16/fs/squashfs/inode.c linux-2.6.16-owrt/fs/squashfs/inode.c
unregister_filesystem(&squashfs_fs_type);
destroy_inodecache();
}
diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/LzmaDecode.c
--- linux-2.6.16/fs/squashfs/LzmaDecode.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16-owrt/fs/squashfs/LzmaDecode.c 2006-03-21 10:56:57.000000000 +0100
diff -urN linux-2.6.19.old/fs/squashfs/LzmaDecode.c linux-2.6.19.dev/fs/squashfs/LzmaDecode.c
--- linux-2.6.19.old/fs/squashfs/LzmaDecode.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/squashfs/LzmaDecode.c 2006-12-14 03:13:20.000000000 +0100
@@ -0,0 +1,663 @@
+/*
+ LzmaDecode.c
+ LZMA Decoder
+
+
+ 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
+ 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
+ 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.
+*/
+
@@ -200,7 +201,7 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/Lz
+ rd->Code = (rd->Code << 8) | ReadByte;
+}
+
+#define RC_INIT_VAR UInt32 range = rd->Range; UInt32 code = rd->Code;
+#define RC_INIT_VAR UInt32 range = rd->Range; UInt32 code = rd->Code;
+#define RC_FLUSH_VAR rd->Range = range; rd->Code = code;
+#define RC_NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | ReadByte; }
+
@@ -268,7 +269,7 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/Lz
+ { A1; range -= bound; code -= bound; *prob -= (*prob) >> kNumMoveBits; mi = (mi + mi) + 1; } \
+ RC_NORMALIZE
+
+#define RC_GET_BIT(prob, mi) RC_GET_BIT2(prob, mi, ; , ;)
+#define RC_GET_BIT(prob, mi) RC_GET_BIT2(prob, mi, ; , ;)
+
+int RangeDecoderBitTreeDecode(CProb *probs, int numLevels, CRangeDecoder *rd)
+{
@@ -318,7 +319,7 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/Lz
+}
+
+Byte LzmaLiteralDecode(CProb *probs, CRangeDecoder *rd)
+{
+{
+ int symbol = 1;
+ #ifdef _LZMA_LOC_OPT
+ RC_INIT_VAR
@@ -340,7 +341,7 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/Lz
+}
+
+Byte LzmaLiteralDecodeMatch(CProb *probs, CRangeDecoder *rd, Byte matchByte)
+{
+{
+ int symbol = 1;
+ #ifdef _LZMA_LOC_OPT
+ RC_INIT_VAR
@@ -395,7 +396,7 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/Lz
+#define LenLow (LenChoice2 + 1)
+#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
+#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
+#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
+#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
+
+int LzmaLenDecode(CProb *p, CRangeDecoder *rd, int posState)
+{
@@ -405,7 +406,7 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/Lz
+ if(RangeDecoderBitDecode(p + LenChoice2, rd) == 0)
+ return kLenNumLowSymbols + RangeDecoderBitTreeDecode(p + LenMid +
+ (posState << kLenNumMidBits), kLenNumMidBits, rd);
+ return kLenNumLowSymbols + kLenNumMidSymbols +
+ return kLenNumLowSymbols + kLenNumMidSymbols +
+ RangeDecoderBitTreeDecode(p + LenHigh, kLenNumHighBits, rd);
+}
+
@@ -488,8 +489,8 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/Lz
+ vs->RemainLen = 0;
+ dictionary[dictionarySize - 1] = 0;
+ for (i = 0; i < numProbs; i++)
+ p[i] = kBitModelTotal >> 1;
+ RangeDecoderInit(&vs->RangeDecoder,
+ p[i] = kBitModelTotal >> 1;
+ RangeDecoderInit(&vs->RangeDecoder,
+ #ifdef _LZMA_IN_CB
+ inCallback
+ #else
@@ -499,7 +500,7 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/Lz
+ return LZMA_RESULT_OK;
+}
+
+int LzmaDecode(unsigned char *buffer,
+int LzmaDecode(unsigned char *buffer,
+ unsigned char *outStream, UInt32 outSize,
+ UInt32 *outSizeProcessed)
+{
@@ -569,8 +570,8 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/Lz
+ if (bufferSize < numProbs * sizeof(CProb))
+ return LZMA_RESULT_NOT_ENOUGH_MEM;
+ for (i = 0; i < numProbs; i++)
+ p[i] = kBitModelTotal >> 1;
+ RangeDecoderInit(&rd,
+ p[i] = kBitModelTotal >> 1;
+ RangeDecoderInit(&rd,
+ #ifdef _LZMA_IN_CB
+ inCallback
+ #else
@@ -583,7 +584,7 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/Lz
+ while(nowPos < outSize)
+ {
+ int posState = (int)(
+ (nowPos
+ (nowPos
+ #ifdef _LZMA_OUT_READ
+ + globalPos
+ #endif
@@ -597,9 +598,9 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/Lz
+ return LZMA_RESULT_DATA_ERROR;
+ if (RangeDecoderBitDecode(p + IsMatch + (state << kNumPosBitsMax) + posState, &rd) == 0)
+ {
+ CProb *probs = p + Literal + (LZMA_LIT_SIZE *
+ CProb *probs = p + Literal + (LZMA_LIT_SIZE *
+ (((
+ (nowPos
+ (nowPos
+ #ifdef _LZMA_OUT_READ
+ + globalPos
+ #endif
@@ -632,7 +633,7 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/Lz
+ dictionaryPos = 0;
+ #endif
+ }
+ else
+ else
+ {
+ previousIsMatch = 1;
+ if (RangeDecoderBitDecode(p + IsRep + state, &rd) == 1)
@@ -645,7 +646,7 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/Lz
+ UInt32 pos;
+ #endif
+ if (
+ (nowPos
+ (nowPos
+ #ifdef _LZMA_OUT_READ
+ + globalPos
+ #endif
@@ -673,7 +674,7 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/Lz
+ UInt32 distance;
+ if(RangeDecoderBitDecode(p + IsRepG1 + state, &rd) == 0)
+ distance = rep1;
+ else
+ else
+ {
+ if(RangeDecoderBitDecode(p + IsRepG2 + state, &rd) == 0)
+ distance = rep2;
@@ -699,7 +700,7 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/Lz
+ state = state < 7 ? 7 : 10;
+ len = LzmaLenDecode(p + LenCoder, &rd, posState);
+ posSlot = RangeDecoderBitTreeDecode(p + PosSlot +
+ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
+ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
+ kNumPosSlotBits), kNumPosSlotBits, &rd);
+ if (posSlot >= kStartPosModelIndex)
+ {
@@ -712,7 +713,7 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/Lz
+ }
+ else
+ {
+ rep0 += RangeDecoderDecodeDirectBits(&rd,
+ rep0 += RangeDecoderDecodeDirectBits(&rd,
+ numDirectBits - kNumAlignBits) << kNumAlignBits;
+ rep0 += RangeDecoderReverseBitTreeDecode(p + Align, kNumAlignBits, &rd);
+ }
@@ -727,7 +728,7 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/Lz
+ len = -1;
+ break;
+ }
+ if (rep0 > nowPos
+ if (rep0 > nowPos
+ #ifdef _LZMA_OUT_READ
+ + globalPos
+ #endif
@@ -772,11 +773,11 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.c linux-2.6.16-owrt/fs/squashfs/Lz
+ *outSizeProcessed = nowPos;
+ return LZMA_RESULT_OK;
+}
diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.h linux-2.6.16-owrt/fs/squashfs/LzmaDecode.h
--- linux-2.6.16/fs/squashfs/LzmaDecode.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16-owrt/fs/squashfs/LzmaDecode.h 2006-03-21 10:56:57.000000000 +0100
diff -urN linux-2.6.19.old/fs/squashfs/LzmaDecode.h linux-2.6.19.dev/fs/squashfs/LzmaDecode.h
--- linux-2.6.19.old/fs/squashfs/LzmaDecode.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/squashfs/LzmaDecode.h 2006-12-14 03:13:20.000000000 +0100
@@ -0,0 +1,100 @@
+/*
+/*
+ LzmaDecode.h
+ LZMA Decoder interface
+
@@ -786,14 +787,14 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.h linux-2.6.16-owrt/fs/squashfs/Lz
+ 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
+ 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
+ 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.
+*/
+
@@ -807,7 +808,7 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.h linux-2.6.16-owrt/fs/squashfs/Lz
+/* Use read function for output data */
+
+/* #define _LZMA_PROB32 */
+/* It can increase speed on some 32-bit CPUs,
+/* It can increase speed on some 32-bit CPUs,
+ but memory usage will be doubled in that case */
+
+/* #define _LZMA_LOC_OPT */
@@ -841,10 +842,10 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.h linux-2.6.16-owrt/fs/squashfs/Lz
+#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,
+by default CProb is unsigned short,
+but if specify _LZMA_PROB_32, CProb will be UInt32(unsigned int)
+*/
+
@@ -862,7 +863,7 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.h linux-2.6.16-owrt/fs/squashfs/Lz
+#endif
+
+int LzmaDecode(
+ unsigned char *buffer,
+ unsigned char *buffer,
+ #ifndef _LZMA_OUT_READ
+ UInt32 bufferSize,
+ int lc, int lp, int pb,
@@ -876,9 +877,9 @@ diff -Nur linux-2.6.16/fs/squashfs/LzmaDecode.h linux-2.6.16-owrt/fs/squashfs/Lz
+ UInt32 *outSizeProcessed);
+
+#endif
diff -Nur linux-2.6.16/fs/squashfs/Makefile linux-2.6.16-owrt/fs/squashfs/Makefile
--- linux-2.6.16/fs/squashfs/Makefile 2006-03-21 10:55:59.000000000 +0100
+++ linux-2.6.16-owrt/fs/squashfs/Makefile 2006-03-21 10:57:08.000000000 +0100
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 2006-12-14 03:13:20.000000000 +0100
+++ linux-2.6.19.dev/fs/squashfs/Makefile 2006-12-14 03:13:20.000000000 +0100
@@ -5,3 +5,4 @@
obj-$(CONFIG_SQUASHFS) += squashfs.o
squashfs-y += inode.o

View File

@@ -1,6 +1,7 @@
--- linux-2.6.12.5/Makefile.old 2005-10-23 22:56:29.017270000 +0200
+++ linux-2.6.12.5/Makefile 2005-10-23 22:57:23.226138500 +0200
@@ -533,6 +533,9 @@
diff -urN linux-2.6.19.old/Makefile linux-2.6.19.dev/Makefile
--- linux-2.6.19.old/Makefile 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/Makefile 2006-12-14 03:13:23.000000000 +0100
@@ -513,6 +513,9 @@
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
CHECKFLAGS += $(NOSTDINC_FLAGS)

View File

@@ -1,221 +0,0 @@
diff -ruN linux-2.6.15.1/include/asm-ppc/libgcc.h linux-2.6.15.1-openwrt/include/asm-ppc/libgcc.h
--- linux-2.6.15.1/include/asm-ppc/libgcc.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15.1-openwrt/include/asm-ppc/libgcc.h 2006-02-01 15:47:53.000000000 +0100
@@ -0,0 +1,8 @@
+#ifndef __ASM_LIBGCC_H
+#define __ASM_LIBGCC_H
+
+#undef ARCH_NEEDS_ashldi3
+#undef ARCH_NEEDS_ashrdi3
+#undef ARCH_NEEDS_lshrdi3
+
+#endif /* __ASM_LIBGCC_H */
diff -ruN linux-2.6.15.1/include/asm-i386/libgcc.h linux-2.6.15.1-openwrt/include/asm-i386/libgcc.h
--- linux-2.6.15.1/include/asm-i386/libgcc.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15.1-openwrt/include/asm-i386/libgcc.h 2006-02-01 15:47:53.000000000 +0100
@@ -0,0 +1,8 @@
+#ifndef __ASM_LIBGCC_H
+#define __ASM_LIBGCC_H
+
+#undef ARCH_NEEDS_ashldi3
+#undef ARCH_NEEDS_ashrdi3
+#undef ARCH_NEEDS_lshrdi3
+
+#endif /* __ASM_LIBGCC_H */
diff -ruN linux-2.6.15.1/include/asm-um/libgcc.h linux-2.6.15.1-openwrt/include/asm-i386/libgcc.h
--- linux-2.6.15.1/include/asm-um/libgcc.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15.1-openwrt/include/asm-um/libgcc.h 2006-02-01 15:47:53.000000000 +0100
@@ -0,0 +1,8 @@
+#ifndef __ASM_LIBGCC_H
+#define __ASM_LIBGCC_H
+
+#undef ARCH_NEEDS_ashldi3
+#undef ARCH_NEEDS_ashrdi3
+#undef ARCH_NEEDS_lshrdi3
+
+#endif /* __ASM_LIBGCC_H */
diff -Nur linux-2.6.15.1/include/asm-mips/libgcc.h linux-2.6.15.1-openwrt/include/asm-mips/libgcc.h
--- linux-2.6.15.1/include/asm-mips/libgcc.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15.1-openwrt/include/asm-mips/libgcc.h 2006-01-20 10:32:28.000000000 +0100
@@ -0,0 +1,8 @@
+#ifndef __ASM_LIBGCC_H
+#define __ASM_LIBGCC_H
+
+#define ARCH_NEEDS_ashldi3
+#define ARCH_NEEDS_ashrdi3
+#define ARCH_NEEDS_lshrdi3
+
+#endif /* __ASM_LIBGCC_H */
diff -Nur linux-2.6.15.1/include/linux/libgcc.h linux-2.6.15.1-openwrt/include/linux/libgcc.h
--- linux-2.6.15.1/include/linux/libgcc.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15.1-openwrt/include/linux/libgcc.h 2006-01-20 10:33:38.000000000 +0100
@@ -0,0 +1,32 @@
+#ifndef __LINUX_LIBGCC_H
+#define __LINUX_LIBGCC_H
+
+#include <asm/byteorder.h>
+#include <asm/libgcc.h>
+
+typedef long long DWtype;
+typedef int Wtype;
+typedef unsigned int UWtype;
+typedef int word_type __attribute__ ((mode (__word__)));
+
+#define BITS_PER_UNIT 8
+
+#ifdef __BIG_ENDIAN
+struct DWstruct {
+ Wtype high, low;
+};
+#elif defined(__LITTLE_ENDIAN)
+struct DWstruct {
+ Wtype low, high;
+};
+#else
+#error I feel sick.
+#endif
+
+typedef union
+{
+ struct DWstruct s;
+ DWtype ll;
+} DWunion;
+
+#endif /* __LINUX_LIBGCC_H */
diff -Nur linux-2.6.15.1/lib/ashldi3.c linux-2.6.15.1-openwrt/lib/ashldi3.c
--- linux-2.6.15.1/lib/ashldi3.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15.1-openwrt/lib/ashldi3.c 2006-01-20 10:38:41.000000000 +0100
@@ -0,0 +1,32 @@
+#include <linux/libgcc.h>
+#include <linux/module.h>
+
+#ifdef ARCH_NEEDS_ashldi3
+
+DWtype __ashldi3(DWtype u, word_type b)
+{
+ DWunion uu, w;
+ word_type bm;
+
+ if (b == 0)
+ return u;
+
+ uu.ll = u;
+ bm = (sizeof(Wtype) * BITS_PER_UNIT) - b;
+
+ if (bm <= 0) {
+ w.s.low = 0;
+ w.s.high = (UWtype) uu.s.low << -bm;
+ } else {
+ const UWtype carries = (UWtype) uu.s.low >> bm;
+
+ w.s.low = (UWtype) uu.s.low << b;
+ w.s.high = ((UWtype) uu.s.high << b) | carries;
+ }
+
+ return w.ll;
+}
+
+EXPORT_SYMBOL(__ashldi3);
+
+#endif /* ARCH_NEEDS_ashldi3 */
diff -Nur linux-2.6.15.1/lib/ashrdi3.c linux-2.6.15.1-openwrt/lib/ashrdi3.c
--- linux-2.6.15.1/lib/ashrdi3.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15.1-openwrt/lib/ashrdi3.c 2006-01-20 10:39:29.000000000 +0100
@@ -0,0 +1,36 @@
+#include <linux/libgcc.h>
+#include <linux/module.h>
+
+/* Unless shift functions are defined with full ANSI prototypes,
+ parameter b will be promoted to int if word_type is smaller than an int. */
+#ifdef ARCH_NEEDS_ashrdi3
+
+DWtype __ashrdi3(DWtype u, word_type b)
+{
+ DWunion uu, w;
+ word_type bm;
+
+ if (b == 0)
+ return u;
+
+ uu.ll = u;
+ bm = (sizeof(Wtype) * BITS_PER_UNIT) - b;
+
+ if (bm <= 0) {
+ /* w.s.high = 1..1 or 0..0 */
+ w.s.high =
+ uu.s.high >> (sizeof(Wtype) * BITS_PER_UNIT - 1);
+ w.s.low = uu.s.high >> -bm;
+ } else {
+ const UWtype carries = (UWtype) uu.s.high << bm;
+
+ w.s.high = uu.s.high >> b;
+ w.s.low = ((UWtype) uu.s.low >> b) | carries;
+ }
+
+ return w.ll;
+}
+
+EXPORT_SYMBOL(__ashrdi3);
+
+#endif /* ARCH_NEEDS_ashrdi3 */
diff -Nur linux-2.6.15.1/lib/lshrdi3.c linux-2.6.15.1-openwrt/lib/lshrdi3.c
--- linux-2.6.15.1/lib/lshrdi3.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15.1-openwrt/lib/lshrdi3.c 2006-01-20 10:40:10.000000000 +0100
@@ -0,0 +1,34 @@
+#include <linux/libgcc.h>
+#include <linux/module.h>
+
+/* Unless shift functions are defined with full ANSI prototypes,
+ parameter b will be promoted to int if word_type is smaller than an int. */
+#ifdef ARCH_NEEDS_lshrdi3
+
+DWtype __lshrdi3(DWtype u, word_type b)
+{
+ DWunion uu, w;
+ word_type bm;
+
+ if (b == 0)
+ return u;
+
+ uu.ll = u;
+ bm = (sizeof(Wtype) * BITS_PER_UNIT) - b;
+
+ if (bm <= 0) {
+ w.s.high = 0;
+ w.s.low = (UWtype) uu.s.high >> -bm;
+ } else {
+ const UWtype carries = (UWtype) uu.s.high << bm;
+
+ w.s.high = (UWtype) uu.s.high >> b;
+ w.s.low = ((UWtype) uu.s.low >> b) | carries;
+ }
+
+ return w.ll;
+}
+
+EXPORT_SYMBOL(__lshrdi3);
+
+#endif /* ARCH_NEEDS_lshrdi3 */
diff -Nur linux-2.6.15.1/lib/Makefile linux-2.6.15.1-openwrt/lib/Makefile
--- linux-2.6.15.1/lib/Makefile 2006-01-15 07:16:02.000000000 +0100
+++ linux-2.6.15.1-openwrt/lib/Makefile 2006-01-20 10:34:19.000000000 +0100
@@ -8,6 +8,7 @@
sha1.o
lib-y += kobject.o kref.o kobject_uevent.o klist.o
+obj-y += ashldi3.o ashrdi3.o lshrdi3.o
obj-y += sort.o parser.o halfmd4.o
diff -Nur linux-2.6.15.1/include/asm-arm/libgcc.h linux-2.6.15.1-openwrt/include/asm-arm/libgcc.h
--- linux-2.6.15.1/include/asm-arm/libgcc.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15.1-openwrt/include/asm-arm/libgcc.h 2006-04-12 23:01:18.000000000 +0200
@@ -0,0 +1,8 @@
+#ifndef __ASM_LIBGCC_H
+#define __ASM_LIBGCC_H
+
+#undef ARCH_NEEDS_ashldi3
+#undef ARCH_NEEDS_ashrdi3
+#undef ARCH_NEEDS_lshrdi3
+
+#endif /* __ASM_LIBGCC_H */

View File

@@ -1,6 +1,7 @@
--- linux-2.6.15.1.old/include/asm-mips/system.h 2006-01-28 15:02:54.481032280 +0100
+++ linux-2.6.15.1.dev/include/asm-mips/system.h 2006-01-28 14:47:51.634285848 +0100
@@ -273,7 +273,7 @@
diff -urN linux-2.6.19.old/include/asm-mips/system.h linux-2.6.19.dev/include/asm-mips/system.h
--- linux-2.6.19.old/include/asm-mips/system.h 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/include/asm-mips/system.h 2006-12-14 03:13:28.000000000 +0100
@@ -311,7 +311,7 @@
if something tries to do an invalid xchg(). */
extern void __xchg_called_with_bad_pointer(void);
@@ -8,4 +9,4 @@
+static __always_inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
{
switch (size) {
case 4:
case 4:

View File

@@ -1,25 +1,24 @@
--- linux.old/drivers/mtd/chips/cfi_cmdset_0002.c 2006-10-23 21:14:11.618024794 +0200
+++ linux.dev/drivers/mtd/chips/cfi_cmdset_0002.c 2006-10-24 07:47:52.267007586 +0200
@@ -49,6 +49,7 @@
#define MANUFACTURER_SST 0x00BF
diff -urN linux-2.6.19.old/drivers/mtd/chips/cfi_cmdset_0002.c linux-2.6.19.dev/drivers/mtd/chips/cfi_cmdset_0002.c
--- linux-2.6.19.old/drivers/mtd/chips/cfi_cmdset_0002.c 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/drivers/mtd/chips/cfi_cmdset_0002.c 2006-12-14 03:13:30.000000000 +0100
@@ -50,6 +50,7 @@
#define SST49LF004B 0x0060
#define SST49LF008A 0x005a
#define AT49BV6416 0x00d6
+#define MANUFACTURER_SAMSUNG 0x00ec
static int cfi_amdstd_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
static int cfi_amdstd_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
@@ -254,13 +255,20 @@
}
@@ -293,12 +294,19 @@
if (extp->MajorVersion != '1' ||
- (extp->MinorVersion < '0' || extp->MinorVersion > '4')) {
(extp->MinorVersion < '0' || extp->MinorVersion > '4')) {
- printk(KERN_ERR " Unknown Amd/Fujitsu Extended Query "
- "version %c.%c.\n", extp->MajorVersion,
- extp->MinorVersion);
- kfree(extp);
- kfree(mtd);
- return NULL;
+ (extp->MinorVersion < '0' || extp->MinorVersion > '4')) {
+ if (cfi->mfr == MANUFACTURER_SAMSUNG &&
+ (extp->MajorVersion == '3' && extp->MinorVersion == '3')) {
+ printk(KERN_NOTICE " Newer Samsung flash detected, "

View File

@@ -1,15 +1,15 @@
diff -Nur linux-2.6.16/fs/squashfs/Makefile linux-2.6.16-owrt/fs/squashfs/Makefile
--- linux-2.6.16/fs/squashfs/Makefile 2006-03-21 13:50:31.000000000 +0100
+++ linux-2.6.16-owrt/fs/squashfs/Makefile 2006-03-21 13:51:09.000000000 +0100
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 2006-12-14 03:13:22.000000000 +0100
+++ linux-2.6.19.dev/fs/squashfs/Makefile 2006-12-14 03:13:31.000000000 +0100
@@ -4,5 +4,4 @@
obj-$(CONFIG_SQUASHFS) += squashfs.o
squashfs-y += inode.o
-squashfs-y += squashfs2_0.o
squashfs-y += LzmaDecode.o
diff -Nur linux-2.6.16/fs/squashfs/squashfs.h linux-2.6.16-owrt/fs/squashfs/squashfs.h
--- linux-2.6.16/fs/squashfs/squashfs.h 2006-03-21 10:55:59.000000000 +0100
+++ linux-2.6.16-owrt/fs/squashfs/squashfs.h 2006-03-21 13:50:58.000000000 +0100
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 2006-12-14 03:13:20.000000000 +0100
+++ linux-2.6.19.dev/fs/squashfs/squashfs.h 2006-12-14 03:13:31.000000000 +0100
@@ -24,6 +24,9 @@
#ifdef CONFIG_SQUASHFS_1_0_COMPATIBILITY
#undef CONFIG_SQUASHFS_1_0_COMPATIBILITY

View File

@@ -1,7 +1,7 @@
diff -Nur linux-cvs/arch/mips/kernel/head.S linux-aruba/arch/mips/kernel/head.S
--- linux-cvs/arch/mips/kernel/head.S 2004-12-23 00:21:39.000000000 -0800
+++ linux-aruba/arch/mips/kernel/head.S 2005-10-20 09:16:08.000000000 -0700
@@ -122,6 +122,10 @@
diff -urN linux-2.6.19.old/arch/mips/kernel/head.S linux-2.6.19.dev/arch/mips/kernel/head.S
--- linux-2.6.19.old/arch/mips/kernel/head.S 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/arch/mips/kernel/head.S 2006-12-14 03:13:33.000000000 +0100
@@ -129,6 +129,10 @@
#endif
.endm
@@ -12,4 +12,3 @@ diff -Nur linux-cvs/arch/mips/kernel/head.S linux-aruba/arch/mips/kernel/head.S
/*
* Reserved space for exception handlers.
* Necessary for machines which link their kernels at KSEG0.

View File

@@ -1,5 +1,6 @@
--- linux-2.6.18/drivers/mtd/redboot.c.orig 2006-10-23 11:41:56.000000000 -0400
+++ linux-2.6.18/drivers/mtd/redboot.c 2006-10-23 11:42:09.000000000 -0400
diff -urN linux-2.6.19.old/drivers/mtd/redboot.c linux-2.6.19.dev/drivers/mtd/redboot.c
--- linux-2.6.19.old/drivers/mtd/redboot.c 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/drivers/mtd/redboot.c 2006-12-14 03:13:35.000000000 +0100
@@ -92,22 +92,47 @@
* swab32(erasesize) then we know we are looking at
* a byte swapped FIS directory - swap all the entries!
@@ -32,7 +33,9 @@
+ for (j = 0; j < numslots; ++j) {
/* The unsigned long fields were written with the
* wrong byte sex, name and pad have no byte sex.
- */
+ *
+ * Only process non-deleted entries. Don't exit early.
*/
- swab32s(&buf[j].flash_base);
- swab32s(&buf[j].mem_base);
- swab32s(&buf[j].size);
@@ -40,9 +43,6 @@
- swab32s(&buf[j].data_length);
- swab32s(&buf[j].desc_cksum);
- swab32s(&buf[j].file_cksum);
+ *
+ * Only process non-deleted entries. Don't exit early.
+ */
+ if (buf[j].name[0] != 0xff) {
+ swab32s(&buf[j].flash_base);
+ swab32s(&buf[j].mem_base);

View File

@@ -1,7 +1,7 @@
diff -Nur linux-2.6.17/include/linux/netfilter_ipv4/ip_conntrack.h linux-2.6.17-owrt/include/linux/netfilter_ipv4/ip_conntrack.h
--- linux-2.6.17/include/linux/netfilter_ipv4/ip_conntrack.h 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/include/linux/netfilter_ipv4/ip_conntrack.h 2006-06-18 12:29:04.000000000 +0200
@@ -124,6 +124,15 @@
diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ip_conntrack.h linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_conntrack.h
--- linux-2.6.19.old/include/linux/netfilter_ipv4/ip_conntrack.h 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/ip_conntrack.h 2006-12-14 03:13:37.000000000 +0100
@@ -127,6 +127,15 @@
/* Traversed often, so hopefully in different cacheline to top */
/* These are my tuples; original and reply */
struct ip_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX];
@@ -17,11 +17,11 @@ diff -Nur linux-2.6.17/include/linux/netfilter_ipv4/ip_conntrack.h linux-2.6.17-
};
struct ip_conntrack_expect
diff -Nur linux-2.6.17/include/linux/netfilter_ipv4/ipt_layer7.h linux-2.6.17-owrt/include/linux/netfilter_ipv4/ipt_layer7.h
--- linux-2.6.17/include/linux/netfilter_ipv4/ipt_layer7.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.17-owrt/include/linux/netfilter_ipv4/ipt_layer7.h 2006-06-18 12:29:04.000000000 +0200
diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ipt_layer7.h linux-2.6.19.dev/include/linux/netfilter_ipv4/ipt_layer7.h
--- linux-2.6.19.old/include/linux/netfilter_ipv4/ipt_layer7.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/ipt_layer7.h 2006-12-14 03:13:37.000000000 +0100
@@ -0,0 +1,27 @@
+/*
+/*
+ By Matthew Strait <quadong@users.sf.net>, Dec 2003.
+ http://l7-filter.sf.net
+
@@ -48,10 +48,10 @@ diff -Nur linux-2.6.17/include/linux/netfilter_ipv4/ipt_layer7.h linux-2.6.17-ow
+};
+
+#endif /* _IPT_LAYER7_H */
diff -Nur linux-2.6.17/net/ipv4/netfilter/ip_conntrack_core.c linux-2.6.17-owrt/net/ipv4/netfilter/ip_conntrack_core.c
--- linux-2.6.17/net/ipv4/netfilter/ip_conntrack_core.c 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/net/ipv4/netfilter/ip_conntrack_core.c 2006-06-18 12:29:04.000000000 +0200
@@ -339,6 +339,13 @@
diff -urN linux-2.6.19.old/net/ipv4/netfilter/ip_conntrack_core.c linux-2.6.19.dev/net/ipv4/netfilter/ip_conntrack_core.c
--- linux-2.6.19.old/net/ipv4/netfilter/ip_conntrack_core.c 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/net/ipv4/netfilter/ip_conntrack_core.c 2006-12-14 03:13:37.000000000 +0100
@@ -337,6 +337,13 @@
* too. */
ip_ct_remove_expectations(ct);
@@ -65,10 +65,10 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ip_conntrack_core.c linux-2.6.17-owrt/
/* We overload first tuple to link into unconfirmed list. */
if (!is_confirmed(ct)) {
BUG_ON(list_empty(&ct->tuplehash[IP_CT_DIR_ORIGINAL].list));
diff -Nur linux-2.6.17/net/ipv4/netfilter/ip_conntrack_standalone.c linux-2.6.17-owrt/net/ipv4/netfilter/ip_conntrack_standalone.c
--- linux-2.6.17/net/ipv4/netfilter/ip_conntrack_standalone.c 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/net/ipv4/netfilter/ip_conntrack_standalone.c 2006-06-18 12:29:04.000000000 +0200
@@ -189,6 +189,12 @@
diff -urN linux-2.6.19.old/net/ipv4/netfilter/ip_conntrack_standalone.c linux-2.6.19.dev/net/ipv4/netfilter/ip_conntrack_standalone.c
--- linux-2.6.19.old/net/ipv4/netfilter/ip_conntrack_standalone.c 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/net/ipv4/netfilter/ip_conntrack_standalone.c 2006-12-14 03:13:37.000000000 +0100
@@ -192,6 +192,12 @@
return -ENOSPC;
#endif
@@ -81,14 +81,14 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ip_conntrack_standalone.c linux-2.6.17
if (seq_printf(s, "use=%u\n", atomic_read(&conntrack->ct_general.use)))
return -ENOSPC;
diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv4/netfilter/ipt_layer7.c
--- linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.17-owrt/net/ipv4/netfilter/ipt_layer7.c 2006-06-18 12:29:04.000000000 +0200
@@ -0,0 +1,592 @@
+/*
+ Kernel module to match application layer (OSI layer 7)
diff -urN linux-2.6.19.old/net/ipv4/netfilter/ipt_layer7.c linux-2.6.19.dev/net/ipv4/netfilter/ipt_layer7.c
--- linux-2.6.19.old/net/ipv4/netfilter/ipt_layer7.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/net/ipv4/netfilter/ipt_layer7.c 2006-12-14 03:13:37.000000000 +0100
@@ -0,0 +1,586 @@
+/*
+ Kernel module to match application layer (OSI layer 7)
+ data in connections.
+
+
+ http://l7-filter.sf.net
+
+ By Matthew Strait and Ethan Sommer, 2003-2005.
@@ -147,24 +147,24 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+
+/* I'm new to locking. Here are my assumptions:
+
+- No one will write to /proc/net/layer7_numpackets over and over very fast;
+- No one will write to /proc/net/layer7_numpackets over and over very fast;
+ if they did, nothing awful would happen.
+
+- This code will never be processing the same packet twice at the same time,
+ because iptables rules are traversed in order.
+
+- It doesn't matter if two packets from different connections are in here at
+- It doesn't matter if two packets from different connections are in here at
+ the same time, because they don't share any data.
+
+- It _does_ matter if two packets from the same connection are here at the same
+ time. In this case, we have to protect the conntracks and the list of
+ time. In this case, we have to protect the conntracks and the list of
+ compiled patterns.
+*/
+DEFINE_RWLOCK(ct_lock);
+DEFINE_SPINLOCK(list_lock);
+
+#ifdef CONFIG_IP_NF_MATCH_LAYER7_DEBUG
+/* Converts an unfriendly string into a friendly one by
+/* Converts an unfriendly string into a friendly one by
+replacing unprintables with periods and all whitespace with " ". */
+static char * friendly_print(unsigned char * s)
+{
@@ -172,7 +172,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ int i;
+
+ if(!f) {
+ if (net_ratelimit())
+ if (net_ratelimit())
+ printk(KERN_ERR "layer7: out of memory in friendly_print, bailing.\n");
+ return NULL;
+ }
@@ -196,7 +196,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ return (char)(i - 10 + 'a');
+ break;
+ default:
+ if (net_ratelimit())
+ if (net_ratelimit())
+ printk("Problem in dec2hex\n");
+ return '\0';
+ }
@@ -208,7 +208,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ int i;
+
+ if(!g) {
+ if (net_ratelimit())
+ if (net_ratelimit())
+ printk(KERN_ERR "layer7: out of memory in hex_print, bailing.\n");
+ return NULL;
+ }
@@ -226,7 +226,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+
+/* Use instead of regcomp. As we expect to be seeing the same regexps over and
+over again, it make sense to cache the results. */
+static regexp * compile_and_cache(char * regex_string, char * protocol)
+static regexp * compile_and_cache(char * regex_string, char * protocol)
+{
+ struct pattern_cache * node = first_pattern_cache;
+ struct pattern_cache * last_pattern_cache = first_pattern_cache;
@@ -234,7 +234,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ unsigned int len;
+
+ while (node != NULL) {
+ if (!strcmp(node->regex_string, regex_string))
+ if (!strcmp(node->regex_string, regex_string))
+ return node->pattern;
+
+ last_pattern_cache = node;/* points at the last non-NULL node */
@@ -242,12 +242,12 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ }
+
+ /* If we reach the end of the list, then we have not yet cached
+ the pattern for this regex. Let's do that now.
+ the pattern for this regex. Let's do that now.
+ Be paranoid about running out of memory to avoid list corruption. */
+ tmp = kmalloc(sizeof(struct pattern_cache), GFP_ATOMIC);
+
+ if(!tmp) {
+ if (net_ratelimit())
+ if (net_ratelimit())
+ printk(KERN_ERR "layer7: out of memory in compile_and_cache, bailing.\n");
+ return NULL;
+ }
@@ -257,7 +257,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ tmp->next = NULL;
+
+ if(!tmp->regex_string || !tmp->pattern) {
+ if (net_ratelimit())
+ if (net_ratelimit())
+ printk(KERN_ERR "layer7: out of memory in compile_and_cache, bailing.\n");
+ kfree(tmp->regex_string);
+ kfree(tmp->pattern);
@@ -278,7 +278,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ DPRINTK("About to compile this: \"%s\"\n", regex_string);
+ node->pattern = regcomp(regex_string, &len);
+ if ( !node->pattern ) {
+ if (net_ratelimit())
+ if (net_ratelimit())
+ printk(KERN_ERR "layer7: Error compiling regexp \"%s\" (%s)\n", regex_string, protocol);
+ /* pattern is now cached as NULL, so we won't try again. */
+ }
@@ -301,14 +301,14 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+/* Returns offset the into the skb->data that the application data starts */
+static int app_data_offset(const struct sk_buff *skb)
+{
+ /* In case we are ported somewhere (ebtables?) where skb->nh.iph
+ /* In case we are ported somewhere (ebtables?) where skb->nh.iph
+ isn't set, this can be gotten from 4*(skb->data[0] & 0x0f) as well. */
+ int ip_hl = 4*skb->nh.iph->ihl;
+
+ if( skb->nh.iph->protocol == IPPROTO_TCP ) {
+ /* 12 == offset into TCP header for the header length field.
+ Can't get this with skb->h.th->doff because the tcphdr
+ struct doesn't get set when routing (this is confirmed to be
+ /* 12 == offset into TCP header for the header length field.
+ Can't get this with skb->h.th->doff because the tcphdr
+ struct doesn't get set when routing (this is confirmed to be
+ true in Netfilter as well as QoS.) */
+ int tcp_hl = 4*(skb->data[ip_hl + 12] >> 4);
+
@@ -318,7 +318,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ } else if( skb->nh.iph->protocol == IPPROTO_ICMP ) {
+ return ip_hl + 8; /* ICMP header is 8 bytes */
+ } else {
+ if (net_ratelimit())
+ if (net_ratelimit())
+ printk(KERN_ERR "layer7: tried to handle unknown protocol!\n");
+ return ip_hl + 8; /* something reasonable */
+ }
@@ -337,10 +337,10 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ if(!master_conntrack->layer7.app_proto) {
+ char * f = friendly_print(master_conntrack->layer7.app_data);
+ char * g = hex_print(master_conntrack->layer7.app_data);
+ DPRINTK("\nl7-filter gave up after %d bytes (%llu packets):\n%s\n",
+ strlen(f),
+ DPRINTK("\nl7-filter gave up after %d bytes (%llu packets):\n%s\n",
+ strlen(f),
+ TOTAL_PACKETS, f);
+ kfree(f);
+ kfree(f);
+ DPRINTK("In hex: %s\n", g);
+ kfree(g);
+ }
@@ -357,7 +357,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ if(!conntrack->layer7.app_proto) {
+ conntrack->layer7.app_proto = kmalloc(strlen(master_conntrack->layer7.app_proto)+1, GFP_ATOMIC);
+ if(!conntrack->layer7.app_proto){
+ if (net_ratelimit())
+ if (net_ratelimit())
+ printk(KERN_ERR "layer7: out of memory in match_no_append, bailing.\n");
+ write_unlock(&ct_lock);
+ return 1;
@@ -365,16 +365,16 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ strcpy(conntrack->layer7.app_proto, master_conntrack->layer7.app_proto);
+ }
+ write_unlock(&ct_lock);
+
+
+ return (!strcmp(master_conntrack->layer7.app_proto, info->protocol));
+ }
+ else {
+ /* If not classified, set to "unknown" to distinguish from
+ /* If not classified, set to "unknown" to distinguish from
+ connections that are still being tested. */
+ write_lock(&ct_lock);
+ master_conntrack->layer7.app_proto = kmalloc(strlen("unknown")+1, GFP_ATOMIC);
+ if(!master_conntrack->layer7.app_proto){
+ if (net_ratelimit())
+ if (net_ratelimit())
+ printk(KERN_ERR "layer7: out of memory in match_no_append, bailing.\n");
+ write_unlock(&ct_lock);
+ return 1;
@@ -393,7 +393,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ do case insensitivity). Add it to the end of the current data. */
+ for(i = 0; i < maxdatalen-offset-1 && i < len; i++) {
+ if(app_data[i] != '\0') {
+ target[length+offset] =
+ target[length+offset] =
+ /* the kernel version of tolower mungs 'upper ascii' */
+ isascii(app_data[i])? tolower(app_data[i]) : app_data[i];
+ length++;
@@ -405,11 +405,11 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+}
+
+/* add the new app data to the conntrack. Return number of bytes added. */
+static int add_data(struct ip_conntrack * master_conntrack,
+static int add_data(struct ip_conntrack * master_conntrack,
+ char * app_data, int appdatalen)
+{
+ int length;
+
+
+ length = add_datastr(master_conntrack->layer7.app_data, master_conntrack->layer7.app_data_len, app_data, appdatalen);
+ master_conntrack->layer7.app_data_len += length;
+
@@ -417,42 +417,44 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+}
+
+/* Returns true on match and false otherwise. */
+static int match(/* const */struct sk_buff *skb, const struct net_device *in,
+ const struct net_device *out, const void *matchinfo,
+ int offset, int *hotdrop)
+static int match(const struct sk_buff *skb_t, const struct net_device *in,
+ const struct net_device *out, const struct xt_match *match,
+ const void *matchinfo, int offset,
+ unsigned int protoff, int *hotdrop)
+{
+ struct ipt_layer7_info * info = (struct ipt_layer7_info *)matchinfo;
+ enum ip_conntrack_info master_ctinfo, ctinfo;
+ struct ip_conntrack *master_conntrack, *conntrack;
+ unsigned char *app_data, *tmp_data;
+ unsigned char *app_data, *tmp_data;
+ unsigned int pattern_result, appdatalen;
+ regexp * comppattern;
+ struct sk_buff *skb = skb_t; /* to leave warning - FIXME */
+
+ if(!can_handle(skb)){
+ DPRINTK("layer7: This is some protocol I can't handle.\n");
+ return info->invert;
+ }
+
+ /* Treat parent & all its children together as one connection, except
+ for the purpose of setting conntrack->layer7.app_proto in the actual
+ /* Treat parent & all its children together as one connection, except
+ for the purpose of setting conntrack->layer7.app_proto in the actual
+ connection. This makes /proc/net/ip_conntrack more satisfying. */
+ if(!(conntrack = ip_conntrack_get((struct sk_buff *)skb, &ctinfo)) ||
+ !(master_conntrack = ip_conntrack_get((struct sk_buff *)skb, &master_ctinfo))) {
+ //DPRINTK("layer7: packet is not from a known connection, giving up.\n");
+ return info->invert;
+ }
+
+
+ /* Try to get a master conntrack (and its master etc) for FTP, etc. */
+ while (master_ct(master_conntrack) != NULL)
+ master_conntrack = master_ct(master_conntrack);
+
+ /* if we've classified it or seen too many packets */
+ if(!info->pkt && (TOTAL_PACKETS > num_packets ||
+ if(!info->pkt && (TOTAL_PACKETS > num_packets ||
+ master_conntrack->layer7.app_proto)) {
+
+
+ pattern_result = match_no_append(conntrack, master_conntrack, ctinfo, master_ctinfo, info);
+
+ /* skb->cb[0] == seen. Avoid doing things twice if there are two l7
+
+ /* skb->cb[0] == seen. Avoid doing things twice if there are two l7
+ rules. I'm not sure that using cb for this purpose is correct, although
+ it says "put your private variables there". But it doesn't look like it
+ is being used for anything else in the skbs that make it here. How can
@@ -463,13 +465,13 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ }
+
+ if(skb_is_nonlinear(skb)){
+ if(skb_linearize(skb, GFP_ATOMIC) != 0){
+ if (net_ratelimit())
+ if(skb_linearize(skb) != 0){
+ if (net_ratelimit())
+ printk(KERN_ERR "layer7: failed to linearize packet, bailing.\n");
+ return info->invert;
+ }
+ }
+
+
+ /* now that the skb is linearized, it's safe to set these. */
+ app_data = skb->data + app_data_offset(skb);
+ appdatalen = skb->tail - app_data;
@@ -486,22 +488,22 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ printk(KERN_ERR "layer7: out of memory in match, bailing.\n");
+ return info->invert;
+ }
+
+
+ tmp_data[0] = '\0';
+ add_datastr(tmp_data, 0, app_data, appdatalen);
+ pattern_result = ((comppattern && regexec(comppattern, tmp_data)) ? 1 : 0);
+ kfree(tmp_data);
+ tmp_data = NULL;
+
+
+ return (pattern_result ^ info->invert);
+ }
+
+
+ /* On the first packet of a connection, allocate space for app data */
+ write_lock(&ct_lock);
+ if(TOTAL_PACKETS == 1 && !skb->cb[0] && !master_conntrack->layer7.app_data) {
+ master_conntrack->layer7.app_data = kmalloc(maxdatalen, GFP_ATOMIC);
+ if(!master_conntrack->layer7.app_data){
+ if (net_ratelimit())
+ if(!master_conntrack->layer7.app_data){
+ if (net_ratelimit())
+ printk(KERN_ERR "layer7: out of memory in match, bailing.\n");
+ write_unlock(&ct_lock);
+ return info->invert;
@@ -511,7 +513,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ }
+ write_unlock(&ct_lock);
+
+ /* Can be here, but unallocated, if numpackets is increased near
+ /* Can be here, but unallocated, if numpackets is increased near
+ the beginning of a connection */
+ if(master_conntrack->layer7.app_data == NULL)
+ return (info->invert); /* unmatched */
@@ -543,7 +545,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ write_lock(&ct_lock);
+ master_conntrack->layer7.app_proto = kmalloc(strlen(info->protocol)+1, GFP_ATOMIC);
+ if(!master_conntrack->layer7.app_proto){
+ if (net_ratelimit())
+ if (net_ratelimit())
+ printk(KERN_ERR "layer7: out of memory in match, bailing.\n");
+ write_unlock(&ct_lock);
+ return (pattern_result ^ info->invert);
@@ -558,19 +560,11 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ return (pattern_result ^ info->invert);
+}
+
+static int checkentry(const char *tablename, const struct ipt_ip *ip,
+ void *matchinfo, unsigned int matchsize, unsigned int hook_mask)
+{
+ if (matchsize != IPT_ALIGN(sizeof(struct ipt_layer7_info)))
+ return 0;
+ return 1;
+}
+
+static struct ipt_match layer7_match = {
+ .name = "layer7",
+ .match = &match,
+ .checkentry = &checkentry,
+ .me = THIS_MODULE
+static struct ipt_match layer7_match = {
+ .name = "layer7",
+ .match = &match,
+ .matchsize = sizeof(struct ipt_layer7_info),
+ .me = THIS_MODULE
+};
+
+/* taken from drivers/video/modedb.c */
@@ -590,30 +584,30 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+}
+
+/* write out num_packets to userland. */
+static int layer7_read_proc(char* page, char ** start, off_t off, int count,
+ int* eof, void * data)
+static int layer7_read_proc(char* page, char ** start, off_t off, int count,
+ int* eof, void * data)
+{
+ if(num_packets > 99 && net_ratelimit())
+ if(num_packets > 99 && net_ratelimit())
+ printk(KERN_ERR "layer7: NOT REACHED. num_packets too big\n");
+
+
+ page[0] = num_packets/10 + '0';
+ page[1] = num_packets%10 + '0';
+ page[2] = '\n';
+ page[3] = '\0';
+
+
+ *eof=1;
+
+ return 3;
+}
+
+/* Read in num_packets from userland */
+static int layer7_write_proc(struct file* file, const char* buffer,
+ unsigned long count, void *data)
+static int layer7_write_proc(struct file* file, const char* buffer,
+ unsigned long count, void *data)
+{
+ char * foo = kmalloc(count, GFP_ATOMIC);
+
+ if(!foo){
+ if (net_ratelimit())
+ if (net_ratelimit())
+ printk(KERN_ERR "layer7: out of memory, bailing. num_packets unchanged.\n");
+ return count;
+ }
@@ -621,12 +615,12 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ if(copy_from_user(foo, buffer, count)) {
+ return -EFAULT;
+ }
+
+
+
+ num_packets = my_atoi(foo);
+ kfree (foo);
+
+ /* This has an arbitrary limit to make the math easier. I'm lazy.
+ /* This has an arbitrary limit to make the math easier. I'm lazy.
+ But anyway, 99 is a LOT! If you want more, you're doing it wrong! */
+ if(num_packets > 99) {
+ printk(KERN_WARNING "layer7: num_packets can't be > 99.\n");
@@ -635,7 +629,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ printk(KERN_WARNING "layer7: num_packets can't be < 1.\n");
+ num_packets = 1;
+ }
+
+
+ return count;
+}
+
@@ -660,12 +654,12 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+ printk(KERN_WARNING "layer7: maxdatalen can't be < 1, using 1\n");
+ maxdatalen = 1;
+ }
+ /* This is not a hard limit. It's just here to prevent people from
+ /* This is not a hard limit. It's just here to prevent people from
+ bringing their slow machines to a grinding halt. */
+ else if(maxdatalen > 65536) {
+ printk(KERN_WARNING "layer7: maxdatalen can't be > 65536, using 65536\n");
+ maxdatalen = 65536;
+ }
+ maxdatalen = 65536;
+ }
+ return ipt_register_match(&layer7_match);
+}
+
@@ -677,10 +671,10 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_layer7.c linux-2.6.17-owrt/net/ipv
+
+module_init(init);
+module_exit(fini);
diff -Nur linux-2.6.17/net/ipv4/netfilter/Kconfig linux-2.6.17-owrt/net/ipv4/netfilter/Kconfig
--- linux-2.6.17/net/ipv4/netfilter/Kconfig 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/net/ipv4/netfilter/Kconfig 2006-06-18 12:32:58.000000000 +0200
@@ -314,6 +314,24 @@
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-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/net/ipv4/netfilter/Kconfig 2006-12-14 03:13:37.000000000 +0100
@@ -329,6 +329,24 @@
destination IP' or `500pps from any given source IP' with a single
IPtables rule.
@@ -705,10 +699,10 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/Kconfig linux-2.6.17-owrt/net/ipv4/net
# `filter', generic and specific targets
config IP_NF_FILTER
tristate "Packet filtering"
diff -Nur linux-2.6.17/net/ipv4/netfilter/Makefile linux-2.6.17-owrt/net/ipv4/netfilter/Makefile
--- linux-2.6.17/net/ipv4/netfilter/Makefile 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/net/ipv4/netfilter/Makefile 2006-06-18 12:29:04.000000000 +0200
@@ -62,6 +62,8 @@
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-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/net/ipv4/netfilter/Makefile 2006-12-14 03:13:37.000000000 +0100
@@ -63,6 +63,8 @@
obj-$(CONFIG_IP_NF_MATCH_TTL) += ipt_ttl.o
obj-$(CONFIG_IP_NF_MATCH_ADDRTYPE) += ipt_addrtype.o
@@ -717,9 +711,9 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/Makefile linux-2.6.17-owrt/net/ipv4/ne
# targets
obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o
obj-$(CONFIG_IP_NF_TARGET_TOS) += ipt_TOS.o
diff -Nur linux-2.6.17/net/ipv4/netfilter/regexp/regexp.c linux-2.6.17-owrt/net/ipv4/netfilter/regexp/regexp.c
--- linux-2.6.17/net/ipv4/netfilter/regexp/regexp.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.17-owrt/net/ipv4/netfilter/regexp/regexp.c 2006-06-18 12:29:04.000000000 +0200
diff -urN linux-2.6.19.old/net/ipv4/netfilter/regexp/regexp.c linux-2.6.19.dev/net/ipv4/netfilter/regexp/regexp.c
--- linux-2.6.19.old/net/ipv4/netfilter/regexp/regexp.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/net/ipv4/netfilter/regexp/regexp.c 2006-12-14 03:13:37.000000000 +0100
@@ -0,0 +1,1195 @@
+/*
+ * regcomp and regexec -- regsub and regerror are elsewhere
@@ -748,7 +742,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/regexp/regexp.c linux-2.6.17-owrt/net/
+ *
+ * This code was modified by Ethan Sommer to work within the kernel
+ * (it now uses kmalloc etc..)
+ *
+ *
+ * Modified slightly by Matthew Strait to use more modern C.
+ */
+
@@ -1076,7 +1070,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/regexp/regexp.c linux-2.6.17-owrt/net/
+ }
+
+ /* Make a closing node, and hook it on the end. */
+ ender = regnode((paren) ? CLOSE+parno : END);
+ ender = regnode((paren) ? CLOSE+parno : END);
+ regtail(ret, ender);
+
+ /* Hook the tails of the branches to the closing node. */
@@ -1767,7 +1761,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/regexp/regexp.c linux-2.6.17-owrt/net/
+/*
+ - regnext - dig the "next" pointer out of a node
+ */
+static char*
+static char*
+regnext(char *p)
+{
+ register int offset;
@@ -1808,7 +1802,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/regexp/regexp.c linux-2.6.17-owrt/net/
+ next = regnext(s);
+ if (next == NULL) /* Next ptr. */
+ printf("(0)");
+ else
+ else
+ printf("(%d)", (s-r->program)+(next-s));
+ s += 3;
+ if (op == ANYOF || op == ANYBUT || op == EXACTLY) {
@@ -1916,9 +1910,9 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/regexp/regexp.c linux-2.6.17-owrt/net/
+#endif
+
+
diff -Nur linux-2.6.17/net/ipv4/netfilter/regexp/regexp.h linux-2.6.17-owrt/net/ipv4/netfilter/regexp/regexp.h
--- linux-2.6.17/net/ipv4/netfilter/regexp/regexp.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.17-owrt/net/ipv4/netfilter/regexp/regexp.h 2006-06-18 12:29:04.000000000 +0200
diff -urN linux-2.6.19.old/net/ipv4/netfilter/regexp/regexp.h linux-2.6.19.dev/net/ipv4/netfilter/regexp/regexp.h
--- linux-2.6.19.old/net/ipv4/netfilter/regexp/regexp.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/net/ipv4/netfilter/regexp/regexp.h 2006-12-14 03:13:37.000000000 +0100
@@ -0,0 +1,41 @@
+/*
+ * Definitions etc. for regexp(3) routines.
@@ -1931,8 +1925,8 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/regexp/regexp.h linux-2.6.17-owrt/net/
+#define REGEXP_H
+
+
+/*
+http://www.opensource.apple.com/darwinsource/10.3/expect-1/expect/expect.h ,
+/*
+http://www.opensource.apple.com/darwinsource/10.3/expect-1/expect/expect.h ,
+which contains a version of this library, says:
+
+ *
@@ -1961,18 +1955,18 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/regexp/regexp.h linux-2.6.17-owrt/net/
+void regerror(char *s);
+
+#endif
diff -Nur linux-2.6.17/net/ipv4/netfilter/regexp/regmagic.h linux-2.6.17-owrt/net/ipv4/netfilter/regexp/regmagic.h
--- linux-2.6.17/net/ipv4/netfilter/regexp/regmagic.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.17-owrt/net/ipv4/netfilter/regexp/regmagic.h 2006-06-18 12:29:04.000000000 +0200
diff -urN linux-2.6.19.old/net/ipv4/netfilter/regexp/regmagic.h linux-2.6.19.dev/net/ipv4/netfilter/regexp/regmagic.h
--- linux-2.6.19.old/net/ipv4/netfilter/regexp/regmagic.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/net/ipv4/netfilter/regexp/regmagic.h 2006-12-14 03:13:37.000000000 +0100
@@ -0,0 +1,5 @@
+/*
+ * The first byte of the regexp internal "program" is actually this magic
+ * number; the start node begins in the second byte.
+ */
+#define MAGIC 0234
diff -Nur linux-2.6.17/net/ipv4/netfilter/regexp/regsub.c linux-2.6.17-owrt/net/ipv4/netfilter/regexp/regsub.c
--- linux-2.6.17/net/ipv4/netfilter/regexp/regsub.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.17-owrt/net/ipv4/netfilter/regexp/regsub.c 2006-06-18 12:29:04.000000000 +0200
diff -urN linux-2.6.19.old/net/ipv4/netfilter/regexp/regsub.c linux-2.6.19.dev/net/ipv4/netfilter/regexp/regsub.c
--- linux-2.6.19.old/net/ipv4/netfilter/regexp/regsub.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/net/ipv4/netfilter/regexp/regsub.c 2006-12-14 03:13:37.000000000 +0100
@@ -0,0 +1,95 @@
+/*
+ * regsub
@@ -2030,7 +2024,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/regexp/regsub.c linux-2.6.17-owrt/net/
+ register char c;
+ register int no;
+ register int len;
+
+
+ /* Not necessary and gcc doesn't like it -MLS */
+ /*extern char *strncpy();*/
+

View File

@@ -1,6 +1,6 @@
diff -Nur linux-2.6.17/include/linux/netfilter_ipv4/ipt_ipp2p.h linux-2.6.17-owrt/include/linux/netfilter_ipv4/ipt_ipp2p.h
--- linux-2.6.17/include/linux/netfilter_ipv4/ipt_ipp2p.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.17-owrt/include/linux/netfilter_ipv4/ipt_ipp2p.h 2006-06-18 12:37:14.000000000 +0200
diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ipt_ipp2p.h linux-2.6.19.dev/include/linux/netfilter_ipv4/ipt_ipp2p.h
--- linux-2.6.19.old/include/linux/netfilter_ipv4/ipt_ipp2p.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/ipt_ipp2p.h 2006-12-14 03:13:39.000000000 +0100
@@ -0,0 +1,31 @@
+#ifndef __IPT_IPP2P_H
+#define __IPT_IPP2P_H
@@ -33,10 +33,10 @@ diff -Nur linux-2.6.17/include/linux/netfilter_ipv4/ipt_ipp2p.h linux-2.6.17-owr
+#define IPP2P_MUTE (1 << 14)
+#define IPP2P_WASTE (1 << 15)
+#define IPP2P_XDCC (1 << 16)
diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4/netfilter/ipt_ipp2p.c
--- linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.17-owrt/net/ipv4/netfilter/ipt_ipp2p.c 2006-06-18 12:37:14.000000000 +0200
@@ -0,0 +1,868 @@
diff -urN linux-2.6.19.old/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.19.dev/net/ipv4/netfilter/ipt_ipp2p.c
--- linux-2.6.19.old/net/ipv4/netfilter/ipt_ipp2p.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/net/ipv4/netfilter/ipt_ipp2p.c 2006-12-14 03:13:39.000000000 +0100
@@ -0,0 +1,881 @@
+#if defined(MODVERSIONS)
+#include <linux/modversions.h>
+#endif
@@ -64,12 +64,12 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ t += 8;
+
+ switch (t[0]) {
+ case 0xe3:
+ case 0xe3:
+ { /*edonkey*/
+ switch (t[1])
+ switch (t[1])
+ {
+ /* client -> server status request */
+ case 0x96:
+ case 0x96:
+ if (packet_len == 14) return ((IPP2P_EDK * 100) + 50);
+ break;
+ /* server -> client status request */
@@ -91,9 +91,9 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ }
+ break;
+ }
+ case 0xe4:
+ case 0xe4:
+ {
+ switch (t[1])
+ switch (t[1])
+ {
+ /* e4 20 .. | size == 43 */
+ case 0x20: if ((packet_len == 43) && (t[2] != 0x00) && (t[34] != 0x00)) return ((IPP2P_EDK * 100) + 60);
@@ -139,7 +139,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+{
+ unsigned char *t = haystack;
+ t += 8;
+
+
+ if (memcmp(t, "GND", 3) == 0) return ((IPP2P_GNU * 100) + 51);
+ if (memcmp(t, "GNUTELLA ", 9) == 0) return ((IPP2P_GNU * 100) + 52);
+ return 0;
@@ -151,12 +151,12 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+udp_search_kazaa (unsigned char *haystack, int packet_len)
+{
+ unsigned char *t = haystack;
+
+
+ if (t[packet_len-1] == 0x00){
+ t += (packet_len - 6);
+ if (memcmp(t, "KaZaA", 5) == 0) return (IPP2P_KAZAA * 100 +50);
+ }
+
+
+ return 0;
+}/*udp_search_kazaa*/
+
@@ -183,33 +183,33 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ {
+ case 24:
+ /* ^ 00 00 04 17 27 10 19 80 */
+ if ((ntohl(get_u32(haystack, 8)) == 0x00000417) && (ntohl(get_u32(haystack, 12)) == 0x27101980))
+ if ((ntohl(get_u32(haystack, 8)) == 0x00000417) && (ntohl(get_u32(haystack, 12)) == 0x27101980))
+ return (IPP2P_BIT * 100 + 50);
+ break;
+ case 44:
+ if (get_u32(haystack, 16) == __constant_htonl(0x00000400) && get_u32(haystack, 36) == __constant_htonl(0x00000104))
+ if (get_u32(haystack, 16) == __constant_htonl(0x00000400) && get_u32(haystack, 36) == __constant_htonl(0x00000104))
+ return (IPP2P_BIT * 100 + 51);
+ if (get_u32(haystack, 16) == __constant_htonl(0x00000400))
+ return (IPP2P_BIT * 100 + 61);
+ break;
+ case 65:
+ if (get_u32(haystack, 16) == __constant_htonl(0x00000404) && get_u32(haystack, 36) == __constant_htonl(0x00000104))
+ if (get_u32(haystack, 16) == __constant_htonl(0x00000404) && get_u32(haystack, 36) == __constant_htonl(0x00000104))
+ return (IPP2P_BIT * 100 + 52);
+ if (get_u32(haystack, 16) == __constant_htonl(0x00000404))
+ return (IPP2P_BIT * 100 + 62);
+ break;
+ case 67:
+ if (get_u32(haystack, 16) == __constant_htonl(0x00000406) && get_u32(haystack, 36) == __constant_htonl(0x00000104))
+ if (get_u32(haystack, 16) == __constant_htonl(0x00000406) && get_u32(haystack, 36) == __constant_htonl(0x00000104))
+ return (IPP2P_BIT * 100 + 53);
+ if (get_u32(haystack, 16) == __constant_htonl(0x00000406))
+ return (IPP2P_BIT * 100 + 63);
+ break;
+ case 211:
+ if (get_u32(haystack, 8) == __constant_htonl(0x00000405))
+ if (get_u32(haystack, 8) == __constant_htonl(0x00000405))
+ return (IPP2P_BIT * 100 + 54);
+ break;
+ case 29:
+ if ((get_u32(haystack, 8) == __constant_htonl(0x00000401)))
+ if ((get_u32(haystack, 8) == __constant_htonl(0x00000401)))
+ return (IPP2P_BIT * 100 + 55);
+ break;
+ case 52:
@@ -219,11 +219,11 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ break;
+ default:
+ /* this packet does not have a constant size */
+ if (packet_len >= 40 && get_u32(haystack, 16) == __constant_htonl(0x00000402) && get_u32(haystack, 36) == __constant_htonl(0x00000104))
+ if (packet_len >= 40 && get_u32(haystack, 16) == __constant_htonl(0x00000402) && get_u32(haystack, 36) == __constant_htonl(0x00000104))
+ return (IPP2P_BIT * 100 + 56);
+ break;
+ }
+
+
+ /* some extra-bitcomet rules:
+ * "d1:" [a|r] "d2:id20:"
+ */
@@ -235,7 +235,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ return (IPP2P_BIT * 100 + 57);
+ }
+ }
+
+
+#if 0
+ /* bitlord rules */
+ /* packetlen must be bigger than 40 */
@@ -243,18 +243,18 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ if (packet_len > 40 && get_u32(haystack, 8) == 0x00000000)
+ {
+ /* first rule: 00 00 00 00 01 00 00 xx xx xx xx 00 00 00 00*/
+ if (get_u32(haystack, 12) == 0x00000000 &&
+ if (get_u32(haystack, 12) == 0x00000000 &&
+ get_u32(haystack, 16) == 0x00010000 &&
+ get_u32(haystack, 24) == 0x00000000 )
+ return (IPP2P_BIT * 100 + 71);
+
+
+ /* 00 01 00 00 0d 00 00 xx xx xx xx 00 00 00 00*/
+ if (get_u32(haystack, 12) == 0x00000001 &&
+ if (get_u32(haystack, 12) == 0x00000001 &&
+ get_u32(haystack, 16) == 0x000d0000 &&
+ get_u32(haystack, 24) == 0x00000000 )
+ return (IPP2P_BIT * 100 + 71);
+
+
+
+
+ }
+#endif
+
@@ -270,7 +270,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+//int search_ares (unsigned char *haystack, int packet_len, int head_len)
+{
+// const unsigned char *t = haystack + head_len;
+
+
+ /* all ares packets start with */
+ if (payload[1] == 0 && (plen - payload[0]) == 3)
+ {
@@ -293,7 +293,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ }
+ }
+
+#if 0
+#if 0
+ /* found connect packet: 03 00 5a 04 03 05 */
+ /* new version ares 1.8: 03 00 5a xx xx 05 */
+ if ((plen) == 6){ /* possible connect command*/
@@ -327,7 +327,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+#endif /* IPP2P_DEBUG_SOUL */
+ return ((IPP2P_SOUL * 100) + 1);
+ }
+
+
+ /* next match: 01 yy 00 00 | yy can be everything */
+ if ( get_u8(payload, 4) == 0x01 && get_u16(payload, 6) == 0x0000 )
+ {
@@ -336,7 +336,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+#endif /* IPP2P_DEBUG_SOUL */
+ return ((IPP2P_SOUL * 100) + 2);
+ }
+
+
+ /* other soulseek commandos are: 1-5,7,9,13-18,22,23,26,28,35-37,40-46,50,51,60,62-69,91,92,1001 */
+ /* try to do this in an intelligent way */
+ /* get all small commandos */
@@ -359,8 +359,8 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+#endif /* IPP2P_DEBUG_SOUL */
+ return ((IPP2P_SOUL * 100) + 3);
+ }
+
+ if (m > 0 && m < 6 )
+
+ if (m > 0 && m < 6 )
+ {
+#ifdef IPP2P_DEBUG_SOUL
+ printk(KERN_DEBUG "3: Soulseek command 0x%x recognized\n",get_u16(payload, 4));
@@ -391,7 +391,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ return ((IPP2P_SOUL * 100) + 7);
+ }
+
+ if (m > 61 && m < 70 )
+ if (m > 61 && m < 70 )
+ {
+#ifdef IPP2P_DEBUG_SOUL
+ printk(KERN_DEBUG "7: Soulseek command 0x%x recognized\n",get_u16(payload, 4));
@@ -403,7 +403,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ printk(KERN_DEBUG "unknown SOULSEEK command: 0x%x, first 16 bit: 0x%x, first 8 bit: 0x%x ,soulseek ???\n",get_u32(payload, 4),get_u16(payload, 4) >> 16,get_u8(payload, 4) >> 24);
+#endif /* IPP2P_DEBUG_SOUL */
+ }
+
+
+ /* match 14 00 00 00 01 yy 00 00 00 STRING(YY) 01 00 00 00 00 46|50 00 00 00 00 */
+ /* without size at the beginning !!! */
+ if ( get_u32(payload, 0) == 0x14 && get_u8(payload, 4) == 0x01 )
@@ -433,7 +433,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ if (((plen) == 3) && (memcmp(payload, "GET", 3) == 0)) return ((IPP2P_WINMX * 100) + 2);
+ //if (packet_len < (head_len + 10)) return 0;
+ if (plen < 10) return 0;
+
+
+ if ((memcmp(payload, "SEND", 4) == 0) || (memcmp(payload, "GET", 3) == 0)){
+ u16 c=4;
+ const u16 end=plen-2;
@@ -449,7 +449,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ c++;
+ }
+ }
+
+
+ if ( plen == 149 && payload[0] == '8' )
+ {
+#ifdef IPP2P_DEBUG_WINMX
@@ -459,7 +459,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+// get_u32(payload,33) == __constant_htonl(0x71182b1a) && get_u32(payload,37) == __constant_htonl(0x05050000) &&
+// get_u32(payload,133) == __constant_htonl(0x31097edf) && get_u32(payload,145) == __constant_htonl(0xdcb8f792))
+ get_u16(payload,39) == 0 && get_u16(payload,135) == __constant_htons(0x7edf) && get_u16(payload,147) == __constant_htons(0xf792))
+
+
+ {
+#ifdef IPP2P_DEBUG_WINMX
+ printk(KERN_INFO "got WinMX\n");
@@ -476,7 +476,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+search_apple (const unsigned char *payload, const u16 plen)
+{
+ if ( (plen > 7) && (payload[6] == 0x0d) && (payload[7] == 0x0a) && (memcmp(payload, "ajprot", 6) == 0)) return (IPP2P_APPLE * 100);
+
+
+ return 0;
+}
+
@@ -488,11 +488,11 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ if (plen > 20)
+ {
+ /* test for match 0x13+"BitTorrent protocol" */
+ if (payload[0] == 0x13)
+ if (payload[0] == 0x13)
+ {
+ if (memcmp(payload+1, "BitTorrent protocol", 19) == 0) return (IPP2P_BIT * 100);
+ }
+
+
+ /* get tracker commandos, all starts with GET /
+ * then it can follow: scrape| announce
+ * and then ?hash_info=
@@ -504,14 +504,14 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ /* message announce */
+ if ( memcmp(payload+5,"announce?info_hash=",19)==0 ) return (IPP2P_BIT * 100 + 2);
+ }
+ }
+ else
+ }
+ else
+ {
+ /* bitcomet encryptes the first packet, so we have to detect another
+ /* bitcomet encryptes the first packet, so we have to detect another
+ * one later in the flow */
+ /* first try failed, too many missdetections */
+ //if ( size == 5 && get_u32(t,0) == __constant_htonl(1) && t[4] < 3) return (IPP2P_BIT * 100 + 3);
+
+
+ /* second try: block request packets */
+ if ( plen == 17 && get_u32(payload,0) == __constant_htonl(0x0d) && payload[4] == 0x06 && get_u32(payload,13) == __constant_htonl(0x4000) ) return (IPP2P_BIT * 100 + 3);
+ }
@@ -540,7 +540,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ if ((payload[plen-2] == 0x0d) && (payload[plen-1] == 0x0a))
+ {
+ if (memcmp(payload, "GET /get/", 9) == 0) return ((IPP2P_DATA_GNU * 100) + 1);
+ if (memcmp(payload, "GET /uri-res/", 13) == 0) return ((IPP2P_DATA_GNU * 100) + 2);
+ if (memcmp(payload, "GET /uri-res/", 13) == 0) return ((IPP2P_DATA_GNU * 100) + 2);
+ }
+ return 0;
+}
@@ -550,20 +550,20 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+int
+search_all_gnu (const unsigned char *payload, const u16 plen)
+{
+
+
+ if ((payload[plen-2] == 0x0d) && (payload[plen-1] == 0x0a))
+ {
+
+
+ if (memcmp(payload, "GNUTELLA CONNECT/", 17) == 0) return ((IPP2P_GNU * 100) + 1);
+ if (memcmp(payload, "GNUTELLA/", 9) == 0) return ((IPP2P_GNU * 100) + 2);
+
+
+ if (memcmp(payload, "GNUTELLA/", 9) == 0) return ((IPP2P_GNU * 100) + 2);
+
+
+ if ((memcmp(payload, "GET /get/", 9) == 0) || (memcmp(payload, "GET /uri-res/", 13) == 0))
+ {
+ {
+ u16 c=8;
+ const u16 end=plen-22;
+ while (c < end) {
+ if ( payload[c] == 0x0a && payload[c+1] == 0x0d && ((memcmp(&payload[c+2], "X-Gnutella-", 11) == 0) || (memcmp(&payload[c+2], "X-Queue:", 8) == 0)))
+ if ( payload[c] == 0x0a && payload[c+1] == 0x0d && ((memcmp(&payload[c+2], "X-Gnutella-", 11) == 0) || (memcmp(&payload[c+2], "X-Queue:", 8) == 0)))
+ return ((IPP2P_GNU * 100) + 3);
+ c++;
+ }
@@ -581,7 +581,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ {
+
+ if (memcmp(payload, "GIVE ", 5) == 0) return ((IPP2P_KAZAA * 100) + 1);
+
+
+ if (memcmp(payload, "GET /", 5) == 0) {
+ u16 c = 8;
+ const u16 end=plen-22;
@@ -599,12 +599,12 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+int
+search_edk (const unsigned char *payload, const u16 plen)
+{
+ if (payload[0] != 0xe3)
+ if (payload[0] != 0xe3)
+ return 0;
+ else {
+ if (payload[5] == 0x47)
+ if (payload[5] == 0x47)
+ return (IPP2P_DATA_EDK * 100);
+ else
+ else
+ return 0;
+ }
+}
@@ -615,10 +615,10 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+int
+search_all_edk (const unsigned char *payload, const u16 plen)
+{
+ if (payload[0] != 0xe3)
+ if (payload[0] != 0xe3)
+ return 0;
+ else {
+ //t += head_len;
+ //t += head_len;
+ const u16 cmd = get_u16(payload, 1);
+ if (cmd == (plen - 5)) {
+ switch (payload[5]) {
@@ -636,14 +636,14 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+search_dc (const unsigned char *payload, const u16 plen)
+{
+
+ if (payload[0] != 0x24 )
+ if (payload[0] != 0x24 )
+ return 0;
+ else {
+ if (memcmp(&payload[1], "Send|", 5) == 0)
+ return (IPP2P_DATA_DC * 100);
+ else
+ return 0;
+ }
+ }
+
+}
+
@@ -654,13 +654,13 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+{
+// unsigned char *t = haystack;
+
+ if (payload[0] == 0x24 && payload[plen-1] == 0x7c)
+ if (payload[0] == 0x24 && payload[plen-1] == 0x7c)
+ {
+ const unsigned char *t=&payload[1];
+ /* Client-Hub-Protocol */
+ if (memcmp(t, "Lock ", 5) == 0) return ((IPP2P_DC * 100) + 1);
+ /* Client-Client-Protocol, some are already recognized by client-hub (like lock) */
+ if (memcmp(t, "MyNick ", 7) == 0) return ((IPP2P_DC * 100) + 38);
+ if (memcmp(t, "MyNick ", 7) == 0) return ((IPP2P_DC * 100) + 38);
+ }
+ return 0;
+}
@@ -673,13 +673,13 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ {
+ //printk(KERN_DEBUG "size hit: %u",size);
+ if (memcmp(payload,"PublicKey: ",11) == 0 )
+ {
+ {
+ return ((IPP2P_MUTE * 100) + 0);
+
+
+/* if (memcmp(t+size-14,"\x0aEndPublicKey\x0a",14) == 0)
+ {
+ printk(KERN_DEBUG "end pubic key hit: %u",size);
+
+
+ }*/
+ }
+ }
@@ -694,10 +694,10 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ /* search in small packets only */
+ if (plen > 20 && plen < 200 && payload[plen-1] == 0x0a && payload[plen-2] == 0x0d && memcmp(payload,"PRIVMSG ",8) == 0)
+ {
+
+
+ u16 x=10;
+ const u16 end=plen - 13;
+
+
+ /* is seems to be a irc private massage, chedck for xdcc command */
+ while (x < end)
+ {
@@ -758,7 +758,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ {IPP2P_BIT,SHORT_HAND_IPP2P,23, &udp_search_bit},
+ {IPP2P_GNU,SHORT_HAND_IPP2P,11, &udp_search_gnu},
+ {IPP2P_EDK,SHORT_HAND_IPP2P,9, &udp_search_edk},
+ {IPP2P_DC,SHORT_HAND_IPP2P,12, &udp_search_directconnect},
+ {IPP2P_DC,SHORT_HAND_IPP2P,12, &udp_search_directconnect},
+ {0,0,0,NULL}
+};
+
@@ -767,14 +767,17 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+match(const struct sk_buff *skb,
+ const struct net_device *in,
+ const struct net_device *out,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+ const struct xt_match *match,
+#endif
+ const void *matchinfo,
+ int offset,
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+ unsigned int protoff,
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+ const void *hdr,
+ u_int16_t datalen,
+#endif
+
+ int *hotdrop)
+{
+ const struct ipt_p2p_info *info = matchinfo;
@@ -789,7 +792,7 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ if (info->debug) printk("IPP2P.match: offset found %i \n",offset);
+ return 0;
+ }
+
+
+ /*make sure that skb is linear*/
+ if(skb_is_nonlinear(skb)){
+ if (info->debug) printk("IPP2P.match: nonlinear skb found\n");
@@ -803,11 +806,11 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ case IPPROTO_TCP: /*what to do with a TCP packet*/
+ {
+ struct tcphdr *tcph = (void *) ip + ip->ihl * 4;
+
+
+ if (tcph->fin) return 0; /*if FIN bit is set bail out*/
+ if (tcph->syn) return 0; /*if SYN bit is set bail out*/
+ if (tcph->rst) return 0; /*if RST bit is set bail out*/
+
+
+ haystack += tcph->doff * 4; /*get TCP-Header-Size*/
+ hlen -= tcph->doff * 4;
+ while (matchlist[i].command) {
@@ -815,9 +818,9 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ ((info->cmd & matchlist[i].short_hand) == matchlist[i].short_hand)) &&
+ (hlen > matchlist[i].packet_len)) {
+ p2p_result = matchlist[i].function_name(haystack, hlen);
+ if (p2p_result)
+ if (p2p_result)
+ {
+ if (info->debug) printk("IPP2P.debug:TCP-match: %i from: %u.%u.%u.%u:%i to: %u.%u.%u.%u:%i Length: %i\n",
+ if (info->debug) printk("IPP2P.debug:TCP-match: %i from: %u.%u.%u.%u:%i to: %u.%u.%u.%u:%i Length: %i\n",
+ p2p_result, NIPQUAD(ip->saddr),ntohs(tcph->source), NIPQUAD(ip->daddr),ntohs(tcph->dest),hlen);
+ return p2p_result;
+ }
@@ -826,27 +829,27 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ }
+ return p2p_result;
+ }
+
+
+ case IPPROTO_UDP: /*what to do with an UDP packet*/
+ {
+ struct udphdr *udph = (void *) ip + ip->ihl * 4;
+
+
+ while (udp_list[i].command){
+ if ((((info->cmd & udp_list[i].command) == udp_list[i].command) ||
+ ((info->cmd & udp_list[i].short_hand) == udp_list[i].short_hand)) &&
+ (hlen > udp_list[i].packet_len)) {
+ p2p_result = udp_list[i].function_name(haystack, hlen);
+ if (p2p_result){
+ if (info->debug) printk("IPP2P.debug:UDP-match: %i from: %u.%u.%u.%u:%i to: %u.%u.%u.%u:%i Length: %i\n",
+ if (info->debug) printk("IPP2P.debug:UDP-match: %i from: %u.%u.%u.%u:%i to: %u.%u.%u.%u:%i Length: %i\n",
+ p2p_result, NIPQUAD(ip->saddr),ntohs(udph->source), NIPQUAD(ip->daddr),ntohs(udph->dest),hlen);
+ return p2p_result;
+ }
+ }
+ i++;
+ }
+ }
+ return p2p_result;
+ }
+
+
+ default: return 0;
+ }
+}
@@ -855,9 +858,16 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+
+static int
+checkentry(const char *tablename,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+ const void *ip,
+ const struct xt_match *match,
+#else
+ const struct ipt_ip *ip,
+#endif
+ void *matchinfo,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
+ unsigned int matchsize,
+#endif
+ unsigned int hook_mask)
+{
+ /* Must specify -p tcp */
@@ -867,22 +877,25 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ * }*/
+ return 1;
+}
+
+
+
+
+static struct ipt_match ipp2p_match = {
+
+static struct ipt_match ipp2p_match = {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+ { NULL, NULL },
+ "ipp2p",
+ &match,
+ &checkentry,
+ NULL,
+ { NULL, NULL },
+ "ipp2p",
+ &match,
+ &checkentry,
+ NULL,
+ THIS_MODULE
+#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ .name = "ipp2p",
+ .match = &match,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+ .matchsize = sizeof(struct ipt_p2p_info),
+#endif
+ .checkentry = &checkentry,
+ .me = THIS_MODULE,
+#endif
@@ -894,21 +907,21 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_ipp2p.c linux-2.6.17-owrt/net/ipv4
+ printk(KERN_INFO "IPP2P v%s loading\n", IPP2P_VERSION);
+ return ipt_register_match(&ipp2p_match);
+}
+
+
+static void __exit fini(void)
+{
+ ipt_unregister_match(&ipp2p_match);
+ printk(KERN_INFO "IPP2P v%s unloaded\n", IPP2P_VERSION);
+ printk(KERN_INFO "IPP2P v%s unloaded\n", IPP2P_VERSION);
+}
+
+
+module_init(init);
+module_exit(fini);
+
+
diff -Nur linux-2.6.17/net/ipv4/netfilter/Kconfig linux-2.6.17-owrt/net/ipv4/netfilter/Kconfig
--- linux-2.6.17/net/ipv4/netfilter/Kconfig 2006-06-18 12:36:55.000000000 +0200
+++ linux-2.6.17-owrt/net/ipv4/netfilter/Kconfig 2006-06-18 12:37:14.000000000 +0200
@@ -222,6 +222,12 @@
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:39.000000000 +0100
+++ linux-2.6.19.dev/net/ipv4/netfilter/Kconfig 2006-12-14 03:13:39.000000000 +0100
@@ -248,6 +248,12 @@
To compile it as a module, choose M here. If unsure, say N.
@@ -921,10 +934,10 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/Kconfig linux-2.6.17-owrt/net/ipv4/net
config IP_NF_MATCH_TOS
tristate "TOS match support"
depends on IP_NF_IPTABLES
diff -Nur linux-2.6.17/net/ipv4/netfilter/Makefile linux-2.6.17-owrt/net/ipv4/netfilter/Makefile
--- linux-2.6.17/net/ipv4/netfilter/Makefile 2006-06-18 12:36:55.000000000 +0200
+++ linux-2.6.17-owrt/net/ipv4/netfilter/Makefile 2006-06-18 12:38:11.000000000 +0200
@@ -61,7 +61,7 @@
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:39.000000000 +0100
+++ linux-2.6.19.dev/net/ipv4/netfilter/Makefile 2006-12-14 03:13:39.000000000 +0100
@@ -62,7 +62,7 @@
obj-$(CONFIG_IP_NF_MATCH_AH) += ipt_ah.o
obj-$(CONFIG_IP_NF_MATCH_TTL) += ipt_ttl.o
obj-$(CONFIG_IP_NF_MATCH_ADDRTYPE) += ipt_addrtype.o

View File

@@ -1,6 +1,6 @@
diff -Nur linux-2.6.16/include/net/xfrmudp.h linux-2.6.16-owrt/include/net/xfrmudp.h
--- linux-2.6.16/include/net/xfrmudp.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16-owrt/include/net/xfrmudp.h 2006-03-22 21:39:54.000000000 +0100
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
@@ -0,0 +1,10 @@
+/*
+ * pointer to function for type that xfrm4_input wants, to permit
@@ -12,10 +12,10 @@ diff -Nur linux-2.6.16/include/net/xfrmudp.h linux-2.6.16-owrt/include/net/xfrmu
+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 -Nur linux-2.6.16/net/ipv4/Kconfig linux-2.6.16-owrt/net/ipv4/Kconfig
--- linux-2.6.16/net/ipv4/Kconfig 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-owrt/net/ipv4/Kconfig 2006-03-22 21:49:04.000000000 +0100
@@ -271,6 +271,12 @@
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 @@
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,10 +28,10 @@ diff -Nur linux-2.6.16/net/ipv4/Kconfig linux-2.6.16-owrt/net/ipv4/Kconfig
config IP_MROUTE
bool "IP: multicast routing"
depends on IP_MULTICAST
diff -Nur linux-2.6.16/net/ipv4/udp.c linux-2.6.16-owrt/net/ipv4/udp.c
--- linux-2.6.16/net/ipv4/udp.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-owrt/net/ipv4/udp.c 2006-03-22 21:39:54.000000000 +0100
@@ -109,11 +109,14 @@
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>
#include <net/checksum.h>
#include <net/xfrm.h>
@@ -46,7 +46,7 @@ diff -Nur linux-2.6.16/net/ipv4/udp.c linux-2.6.16-owrt/net/ipv4/udp.c
DEFINE_SNMP_STAT(struct udp_mib, udp_statistics) __read_mostly;
struct hlist_head udp_hash[UDP_HTABLE_SIZE];
@@ -882,6 +885,42 @@
@@ -917,6 +920,42 @@
sk_common_release(sk);
}
@@ -89,7 +89,7 @@ diff -Nur linux-2.6.16/net/ipv4/udp.c linux-2.6.16-owrt/net/ipv4/udp.c
/* return:
* 1 if the the UDP system should process it
* 0 if we should drop this packet
@@ -889,9 +928,9 @@
@@ -924,9 +963,9 @@
*/
static int udp_encap_rcv(struct sock * sk, struct sk_buff *skb)
{
@@ -99,12 +99,12 @@ diff -Nur linux-2.6.16/net/ipv4/udp.c linux-2.6.16-owrt/net/ipv4/udp.c
-#else
+#else /* either CONFIG_XFRM or CONFIG_IPSEC_NAT_TRAVERSAL */
struct udp_sock *up = udp_sk(sk);
struct udphdr *uh = skb->h.uh;
struct udphdr *uh;
struct iphdr *iph;
@@ -903,11 +942,11 @@
@@ -939,11 +978,11 @@
/* if we're overly short, let UDP handle it */
if (udpdata > skb->tail)
len = skb->len - sizeof(struct udphdr);
if (len <= 0)
- return 1;
+ return 2;
@@ -113,9 +113,9 @@ diff -Nur linux-2.6.16/net/ipv4/udp.c linux-2.6.16-owrt/net/ipv4/udp.c
- return 1;
+ return 3;
len = skb->tail - udpdata;
@@ -922,7 +961,7 @@
/* If this is a paged skb, make sure we pull up
* whatever data we need to look at. */
@@ -966,7 +1005,7 @@
len = sizeof(struct udphdr);
} else
/* Must be an IKE packet.. pass it through */
@@ -124,7 +124,7 @@ diff -Nur linux-2.6.16/net/ipv4/udp.c linux-2.6.16-owrt/net/ipv4/udp.c
break;
case UDP_ENCAP_ESPINUDP_NON_IKE:
/* Check if this is a keepalive packet. If so, eat it. */
@@ -935,7 +974,7 @@
@@ -979,7 +1018,7 @@
len = sizeof(struct udphdr) + 2 * sizeof(u32);
} else
/* Must be an IKE packet.. pass it through */
@@ -133,7 +133,7 @@ diff -Nur linux-2.6.16/net/ipv4/udp.c linux-2.6.16-owrt/net/ipv4/udp.c
break;
}
@@ -946,6 +985,8 @@
@@ -990,6 +1029,8 @@
*/
if (skb_cloned(skb) && pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
return 0;
@@ -142,7 +142,7 @@ diff -Nur linux-2.6.16/net/ipv4/udp.c linux-2.6.16-owrt/net/ipv4/udp.c
/* Now we can update and verify the packet length... */
iph = skb->nh.iph;
@@ -1010,9 +1051,13 @@
@@ -1055,9 +1096,13 @@
return 0;
}
if (ret < 0) {
@@ -159,7 +159,7 @@ diff -Nur linux-2.6.16/net/ipv4/udp.c linux-2.6.16-owrt/net/ipv4/udp.c
return -ret;
}
/* FALLTHROUGH -- it's a UDP Packet */
@@ -1559,3 +1604,9 @@
@@ -1639,3 +1684,9 @@
EXPORT_SYMBOL(udp_proc_register);
EXPORT_SYMBOL(udp_proc_unregister);
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,28 @@
diff -urN linux-2.6.15-rc6.orig/net/ipv4/netfilter/ipt_time.c linux-2.6.15-rc6/net/ipv4/netfilter/ipt_time.c
--- linux-2.6.15-rc6.orig/net/ipv4/netfilter/ipt_time.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15-rc6/net/ipv4/netfilter/ipt_time.c 2006-01-07 13:02:59.000000000 +0100
diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ipt_time.h linux-2.6.19.dev/include/linux/netfilter_ipv4/ipt_time.h
--- linux-2.6.19.old/include/linux/netfilter_ipv4/ipt_time.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/ipt_time.h 2006-12-14 03:13:45.000000000 +0100
@@ -0,0 +1,18 @@
+#ifndef __ipt_time_h_included__
+#define __ipt_time_h_included__
+
+
+struct ipt_time_info {
+ u_int8_t days_match; /* 1 bit per day. -SMTWTFS */
+ u_int16_t time_start; /* 0 < time_start < 23*60+59 = 1439 */
+ u_int16_t time_stop; /* 0:0 < time_stat < 23:59 */
+
+ /* FIXME: Keep this one for userspace iptables binary compability: */
+ u_int8_t kerneltime; /* ignore skb time (and use kerneltime) or not. */
+
+ time_t date_start;
+ time_t date_stop;
+};
+
+
+#endif /* __ipt_time_h_included__ */
diff -urN linux-2.6.19.old/net/ipv4/netfilter/ipt_time.c linux-2.6.19.dev/net/ipv4/netfilter/ipt_time.c
--- linux-2.6.19.old/net/ipv4/netfilter/ipt_time.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/net/ipv4/netfilter/ipt_time.c 2006-12-14 03:13:45.000000000 +0100
@@ -0,0 +1,178 @@
+/*
+ This is a module which is used for time matching
@@ -50,8 +72,10 @@ diff -urN linux-2.6.15-rc6.orig/net/ipv4/netfilter/ipt_time.c linux-2.6.15-rc6/n
+match(const struct sk_buff *skb,
+ const struct net_device *in,
+ const struct net_device *out,
+ const struct xt_match *match,
+ const void *matchinfo,
+ int offset,
+ unsigned int protoff,
+ int *hotdrop)
+{
+ const struct ipt_time_info *info = matchinfo; /* match info for rule */
@@ -85,9 +109,9 @@ diff -urN linux-2.6.15-rc6.orig/net/ipv4/netfilter/ipt_time.c linux-2.6.15-rc6/n
+
+static int
+checkentry(const char *tablename,
+ const struct ipt_ip *ip,
+ const void *ip,
+ const struct xt_match *match,
+ void *matchinfo,
+ unsigned int matchsize,
+ unsigned int hook_mask)
+{
+ struct ipt_time_info *info = matchinfo; /* match info for rule */
@@ -100,9 +124,6 @@ diff -urN linux-2.6.15-rc6.orig/net/ipv4/netfilter/ipt_time.c linux-2.6.15-rc6/n
+ return 0;
+ }
+
+ /* Check the size */
+ if (matchsize != IPT_ALIGN(sizeof(struct ipt_time_info)))
+ return 0;
+ /* Now check the coherence of the data ... */
+ if ((info->time_start > 1439) || /* 23*60+59 = 1439*/
+ (info->time_stop > 1439))
@@ -117,6 +138,7 @@ diff -urN linux-2.6.15-rc6.orig/net/ipv4/netfilter/ipt_time.c linux-2.6.15-rc6/n
+static struct ipt_match time_match = {
+ .name = "time",
+ .match = &match,
+ .matchsize = sizeof(struct ipt_time_info),
+ .checkentry = &checkentry,
+ .me = THIS_MODULE
+};
@@ -180,14 +202,14 @@ diff -urN linux-2.6.15-rc6.orig/net/ipv4/netfilter/ipt_time.c linux-2.6.15-rc6/n
+ r->tm_mon=i;
+ r->tm_mday=work-__spm[i]+1;
+}
diff -urN linux-2.6.15-rc6.orig/net/ipv4/netfilter/Kconfig linux-2.6.15-rc6/net/ipv4/netfilter/Kconfig
--- linux-2.6.15-rc6.orig/net/ipv4/netfilter/Kconfig 2006-01-07 13:00:21.000000000 +0100
+++ linux-2.6.15-rc6/net/ipv4/netfilter/Kconfig 2006-01-07 13:05:07.000000000 +0100
@@ -278,6 +278,22 @@
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:45.000000000 +0100
+++ linux-2.6.19.dev/net/ipv4/netfilter/Kconfig 2006-12-14 03:13:45.000000000 +0100
@@ -263,6 +263,22 @@
To compile it as a module, choose M here. If unsure, say N.
+
+
+config IP_NF_MATCH_TIME
+ tristate 'TIME match support'
+ depends on IP_NF_IPTABLES
@@ -196,46 +218,24 @@ diff -urN linux-2.6.15-rc6.orig/net/ipv4/netfilter/Kconfig linux-2.6.15-rc6/net/
+ to match based on the packet arrival time/date
+ (arrival time/date at the machine which netfilter is running on) or
+ departure time/date (for locally generated packets).
+
+
+ If you say Y here, try iptables -m time --help for more information.
+ If you want to compile it as a module, say M here and read
+
+
+ Documentation/modules.txt. If unsure, say `N'.
+
+
config IP_NF_MATCH_RECENT
tristate "recent match support"
depends on IP_NF_IPTABLES
diff -urN linux-2.6.15-rc6.orig/net/ipv4/netfilter/Makefile linux-2.6.15-rc6/net/ipv4/netfilter/Makefile
--- linux-2.6.15-rc6.orig/net/ipv4/netfilter/Makefile 2006-01-07 13:00:21.000000000 +0100
+++ linux-2.6.15-rc6/net/ipv4/netfilter/Makefile 2006-01-07 13:03:50.000000000 +0100
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:45.000000000 +0100
+++ linux-2.6.19.dev/net/ipv4/netfilter/Makefile 2006-12-14 03:13:45.000000000 +0100
@@ -58,6 +58,7 @@
obj-$(CONFIG_IP_NF_MATCH_MULTIPORT) += ipt_multiport.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
+obj-$(CONFIG_IP_NF_MATCH_TIME) += ipt_time.o
obj-$(CONFIG_IP_NF_MATCH_RECENT) += ipt_recent.o
obj-$(CONFIG_IP_NF_MATCH_ECN) += ipt_ecn.o
obj-$(CONFIG_IP_NF_MATCH_DSCP) += ipt_dscp.o
diff -urN linux-2.6.15-rc6.orig/include/linux/netfilter_ipv4/ipt_time.h linux-2.6.15-rc6/include/linux/netfilter_ipv4/ipt_time.h
--- linux-2.6.15-rc6.orig/include/linux/netfilter_ipv4/ipt_time.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15-rc6/include/linux/netfilter_ipv4/ipt_time.h 2006-01-07 13:02:14.000000000 +0100
@@ -0,0 +1,18 @@
+#ifndef __ipt_time_h_included__
+#define __ipt_time_h_included__
+
+
+struct ipt_time_info {
+ u_int8_t days_match; /* 1 bit per day. -SMTWTFS */
+ u_int16_t time_start; /* 0 < time_start < 23*60+59 = 1439 */
+ u_int16_t time_stop; /* 0:0 < time_stat < 23:59 */
+
+ /* FIXME: Keep this one for userspace iptables binary compability: */
+ u_int8_t kerneltime; /* ignore skb time (and use kerneltime) or not. */
+
+ time_t date_start;
+ time_t date_stop;
+};
+
+
+#endif /* __ipt_time_h_included__ */
obj-$(CONFIG_IP_NF_MATCH_AH) += ipt_ah.o

View File

@@ -1,7 +1,7 @@
diff -Nur linux-2.6.16/drivers/net/imq.c linux-2.6.16-owrt/drivers/net/imq.c
--- linux-2.6.16/drivers/net/imq.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16-owrt/drivers/net/imq.c 2006-03-20 12:59:23.000000000 +0100
@@ -0,0 +1,403 @@
diff -urN linux-2.6.19.old/drivers/net/imq.c linux-2.6.19.dev/drivers/net/imq.c
--- linux-2.6.19.old/drivers/net/imq.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/drivers/net/imq.c 2006-12-14 03:13:47.000000000 +0100
@@ -0,0 +1,400 @@
+/*
+ * Pseudo-driver for the intermediate queue device.
+ *
@@ -29,31 +29,31 @@ diff -Nur linux-2.6.16/drivers/net/imq.c linux-2.6.16-owrt/drivers/net/imq.c
+ * the following changes:
+ *
+ * - Correction of ipv6 support "+"s issue (Hasso Tepper)
+ * - Correction of imq_init_devs() issue that resulted in
+ * - Correction of imq_init_devs() issue that resulted in
+ * kernel OOPS unloading IMQ as module (Norbert Buchmuller)
+ * - Addition of functionality to choose number of IMQ devices
+ * during kernel config (Andre Correa)
+ * - Addition of functionality to choose how IMQ hooks on
+ * - Addition of functionality to choose how IMQ hooks on
+ * PRE and POSTROUTING (after or before NAT) (Andre Correa)
+ * - Cosmetic corrections (Norbert Buchmuller) (Andre Correa)
+ *
+ *
+ * 2005/12/16 - IMQ versions between 2.6.7 and 2.6.13 were
+ * released with almost no problems. 2.6.14-x was released
+ * with some important changes: nfcache was removed; After
+ * some weeks of trouble we figured out that some IMQ fields
+ * 2005/12/16 - IMQ versions between 2.6.7 and 2.6.13 were
+ * released with almost no problems. 2.6.14-x was released
+ * with some important changes: nfcache was removed; After
+ * some weeks of trouble we figured out that some IMQ fields
+ * in skb were missing in skbuff.c - skb_clone and copy_skb_header.
+ * These functions are correctly patched by this new patch version.
+ *
+ * Thanks for all who helped to figure out all the problems with
+ * Thanks for all who helped to figure out all the problems with
+ * 2.6.14.x: Patrick McHardy, Rune Kock, VeNoMouS, Max CtRiX,
+ * Kevin Shanahan, Richard Lucassen, Valery Dachev (hopefully
+ * Kevin Shanahan, Richard Lucassen, Valery Dachev (hopefully
+ * I didn't forget anybody). I apologize again for my lack of time.
+ *
+ * More info at: http://www.linuximq.net/ (Andre Correa)
+ */
+
+#include <linux/config.h>
+#include <linux/autoconf.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/moduleparam.h>
@@ -172,7 +172,7 @@ diff -Nur linux-2.6.16/drivers/net/imq.c linux-2.6.16-owrt/drivers/net/imq.c
+ unsigned int index = skb->imq_flags&IMQ_F_IFMASK;
+ int ret = -1;
+
+ if (index > numdevs)
+ if (index > numdevs)
+ return -1;
+
+ dev = imq_devs + index;
@@ -205,13 +205,10 @@ diff -Nur linux-2.6.16/drivers/net/imq.c linux-2.6.16-owrt/drivers/net/imq.c
+ ret = 0;
+ }
+ }
+ if (spin_is_locked(&dev->xmit_lock))
+ if (spin_is_locked(&dev->_xmit_lock))
+ netif_schedule(dev);
+ else
+
+ while (!netif_queue_stopped(dev) &&
+ qdisc_restart(dev)<0)
+ /* NOTHING */;
+ qdisc_run(dev);
+
+ spin_unlock_bh(&dev->queue_lock);
+
@@ -405,10 +402,10 @@ diff -Nur linux-2.6.16/drivers/net/imq.c linux-2.6.16-owrt/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 -Nur linux-2.6.16/drivers/net/Kconfig linux-2.6.16-owrt/drivers/net/Kconfig
--- linux-2.6.16/drivers/net/Kconfig 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-owrt/drivers/net/Kconfig 2006-03-20 12:59:23.000000000 +0100
@@ -93,6 +93,129 @@
diff -urN linux-2.6.19.old/drivers/net/Kconfig linux-2.6.19.dev/drivers/net/Kconfig
--- linux-2.6.19.old/drivers/net/Kconfig 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/drivers/net/Kconfig 2006-12-14 03:13:47.000000000 +0100
@@ -96,6 +96,129 @@
To compile this driver as a module, choose M here: the module
will be called eql. If unsure, say N.
@@ -526,7 +523,7 @@ diff -Nur linux-2.6.16/drivers/net/Kconfig linux-2.6.16-owrt/drivers/net/Kconfig
+ default "2"
+ help
+
+ This settings defines how many IMQ devices will be
+ This settings defines how many IMQ devices will be
+ created.
+
+ The default value is 2.
@@ -538,20 +535,20 @@ diff -Nur linux-2.6.16/drivers/net/Kconfig linux-2.6.16-owrt/drivers/net/Kconfig
config TUN
tristate "Universal TUN/TAP device driver support"
select CRC32
diff -Nur linux-2.6.16/drivers/net/Makefile linux-2.6.16-owrt/drivers/net/Makefile
--- linux-2.6.16/drivers/net/Makefile 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-owrt/drivers/net/Makefile 2006-03-20 13:00:13.000000000 +0100
@@ -125,6 +125,7 @@
endif
diff -urN linux-2.6.19.old/drivers/net/Makefile linux-2.6.19.dev/drivers/net/Makefile
--- linux-2.6.19.old/drivers/net/Makefile 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/drivers/net/Makefile 2006-12-14 03:13:47.000000000 +0100
@@ -124,6 +124,7 @@
obj-$(CONFIG_SLHC) += slhc.o
obj-$(CONFIG_DUMMY) += dummy.o
+obj-$(CONFIG_IMQ) += imq.o
obj-$(CONFIG_IFB) += ifb.o
obj-$(CONFIG_DE600) += de600.o
obj-$(CONFIG_DE620) += de620.o
diff -Nur linux-2.6.16/include/linux/imq.h linux-2.6.16-owrt/include/linux/imq.h
--- linux-2.6.16/include/linux/imq.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16-owrt/include/linux/imq.h 2006-03-20 12:59:23.000000000 +0100
diff -urN linux-2.6.19.old/include/linux/imq.h linux-2.6.19.dev/include/linux/imq.h
--- linux-2.6.19.old/include/linux/imq.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/include/linux/imq.h 2006-12-14 03:13:47.000000000 +0100
@@ -0,0 +1,9 @@
+#ifndef _IMQ_H
+#define _IMQ_H
@@ -562,9 +559,9 @@ diff -Nur linux-2.6.16/include/linux/imq.h linux-2.6.16-owrt/include/linux/imq.h
+#define IMQ_F_ENQUEUE 0x80
+
+#endif /* _IMQ_H */
diff -Nur linux-2.6.16/include/linux/netfilter_ipv4/ipt_IMQ.h linux-2.6.16-owrt/include/linux/netfilter_ipv4/ipt_IMQ.h
--- linux-2.6.16/include/linux/netfilter_ipv4/ipt_IMQ.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16-owrt/include/linux/netfilter_ipv4/ipt_IMQ.h 2006-03-20 12:59:23.000000000 +0100
diff -urN linux-2.6.19.old/include/linux/netfilter_ipv4/ipt_IMQ.h linux-2.6.19.dev/include/linux/netfilter_ipv4/ipt_IMQ.h
--- linux-2.6.19.old/include/linux/netfilter_ipv4/ipt_IMQ.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/include/linux/netfilter_ipv4/ipt_IMQ.h 2006-12-14 03:13:47.000000000 +0100
@@ -0,0 +1,8 @@
+#ifndef _IPT_IMQ_H
+#define _IPT_IMQ_H
@@ -574,9 +571,9 @@ diff -Nur linux-2.6.16/include/linux/netfilter_ipv4/ipt_IMQ.h linux-2.6.16-owrt/
+};
+
+#endif /* _IPT_IMQ_H */
diff -Nur linux-2.6.16/include/linux/netfilter_ipv6/ip6t_IMQ.h linux-2.6.16-owrt/include/linux/netfilter_ipv6/ip6t_IMQ.h
--- linux-2.6.16/include/linux/netfilter_ipv6/ip6t_IMQ.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16-owrt/include/linux/netfilter_ipv6/ip6t_IMQ.h 2006-03-20 12:59:23.000000000 +0100
diff -urN linux-2.6.19.old/include/linux/netfilter_ipv6/ip6t_IMQ.h linux-2.6.19.dev/include/linux/netfilter_ipv6/ip6t_IMQ.h
--- linux-2.6.19.old/include/linux/netfilter_ipv6/ip6t_IMQ.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/include/linux/netfilter_ipv6/ip6t_IMQ.h 2006-12-14 03:13:47.000000000 +0100
@@ -0,0 +1,8 @@
+#ifndef _IP6T_IMQ_H
+#define _IP6T_IMQ_H
@@ -586,10 +583,10 @@ diff -Nur linux-2.6.16/include/linux/netfilter_ipv6/ip6t_IMQ.h linux-2.6.16-owrt
+};
+
+#endif /* _IP6T_IMQ_H */
diff -Nur linux-2.6.16/include/linux/skbuff.h linux-2.6.16-owrt/include/linux/skbuff.h
--- linux-2.6.16/include/linux/skbuff.h 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-owrt/include/linux/skbuff.h 2006-03-20 12:59:23.000000000 +0100
@@ -275,6 +275,10 @@
diff -urN linux-2.6.19.old/include/linux/skbuff.h linux-2.6.19.dev/include/linux/skbuff.h
--- linux-2.6.19.old/include/linux/skbuff.h 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/include/linux/skbuff.h 2006-12-14 03:13:47.000000000 +0100
@@ -292,6 +292,10 @@
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
struct sk_buff *nfct_reasm;
#endif
@@ -600,10 +597,10 @@ diff -Nur linux-2.6.16/include/linux/skbuff.h linux-2.6.16-owrt/include/linux/sk
#ifdef CONFIG_BRIDGE_NETFILTER
struct nf_bridge_info *nf_bridge;
#endif
diff -Nur linux-2.6.16/net/core/skbuff.c linux-2.6.16-owrt/net/core/skbuff.c
--- linux-2.6.16/net/core/skbuff.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-owrt/net/core/skbuff.c 2006-03-20 12:59:23.000000000 +0100
@@ -425,6 +425,10 @@
diff -urN linux-2.6.19.old/net/core/skbuff.c linux-2.6.19.dev/net/core/skbuff.c
--- linux-2.6.19.old/net/core/skbuff.c 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/net/core/skbuff.c 2006-12-14 03:13:47.000000000 +0100
@@ -482,6 +482,10 @@
C(nfct_reasm);
nf_conntrack_get_reasm(skb->nfct_reasm);
#endif
@@ -614,7 +611,7 @@ diff -Nur linux-2.6.16/net/core/skbuff.c linux-2.6.16-owrt/net/core/skbuff.c
#ifdef CONFIG_BRIDGE_NETFILTER
C(nf_bridge);
nf_bridge_get(skb->nf_bridge);
@@ -489,6 +493,10 @@
@@ -546,6 +550,10 @@
#if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE)
new->ipvs_property = old->ipvs_property;
#endif
@@ -625,10 +622,10 @@ diff -Nur linux-2.6.16/net/core/skbuff.c linux-2.6.16-owrt/net/core/skbuff.c
#ifdef CONFIG_BRIDGE_NETFILTER
new->nf_bridge = old->nf_bridge;
nf_bridge_get(old->nf_bridge);
diff -Nur linux-2.6.16/net/ipv4/netfilter/ipt_IMQ.c linux-2.6.16-owrt/net/ipv4/netfilter/ipt_IMQ.c
--- linux-2.6.16/net/ipv4/netfilter/ipt_IMQ.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16-owrt/net/ipv4/netfilter/ipt_IMQ.c 2006-03-20 12:59:23.000000000 +0100
@@ -0,0 +1,80 @@
diff -urN linux-2.6.19.old/net/ipv4/netfilter/ipt_IMQ.c linux-2.6.19.dev/net/ipv4/netfilter/ipt_IMQ.c
--- linux-2.6.19.old/net/ipv4/netfilter/ipt_IMQ.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/net/ipv4/netfilter/ipt_IMQ.c 2006-12-14 03:13:47.000000000 +0100
@@ -0,0 +1,77 @@
+/*
+ * This target marks packets to be enqueued to an imq device
+ */
@@ -642,8 +639,8 @@ diff -Nur linux-2.6.16/net/ipv4/netfilter/ipt_IMQ.c linux-2.6.16-owrt/net/ipv4/n
+ const struct net_device *in,
+ const struct net_device *out,
+ unsigned int hooknum,
+ const void *targinfo,
+ void *userdata)
+ const struct xt_target *target,
+ const void *targinfo)
+{
+ struct ipt_imq_info *mr = (struct ipt_imq_info*)targinfo;
+
@@ -653,17 +650,13 @@ diff -Nur linux-2.6.16/net/ipv4/netfilter/ipt_IMQ.c linux-2.6.16-owrt/net/ipv4/n
+}
+
+static int imq_checkentry(const char *tablename,
+ const struct ipt_entry *e,
+ const void *e,
+ const struct xt_target *target,
+ void *targinfo,
+ unsigned int targinfosize,
+ unsigned int hook_mask)
+{
+ struct ipt_imq_info *mr;
+
+ if (targinfosize != IPT_ALIGN(sizeof(struct ipt_imq_info))) {
+ printk(KERN_WARNING "IMQ: invalid targinfosize\n");
+ return 0;
+ }
+ mr = (struct ipt_imq_info*)targinfo;
+
+ if (strcmp(tablename, "mangle") != 0) {
@@ -686,6 +679,7 @@ diff -Nur linux-2.6.16/net/ipv4/netfilter/ipt_IMQ.c linux-2.6.16-owrt/net/ipv4/n
+static struct ipt_target ipt_imq_reg = {
+ .name = "IMQ",
+ .target = imq_target,
+ .targetsize = sizeof(struct ipt_imq_info),
+ .checkentry = imq_checkentry,
+ .me = THIS_MODULE
+};
@@ -709,10 +703,10 @@ diff -Nur linux-2.6.16/net/ipv4/netfilter/ipt_IMQ.c linux-2.6.16-owrt/net/ipv4/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 -Nur linux-2.6.16/net/ipv4/netfilter/Kconfig linux-2.6.16-owrt/net/ipv4/netfilter/Kconfig
--- linux-2.6.16/net/ipv4/netfilter/Kconfig 2006-03-20 12:58:53.000000000 +0100
+++ linux-2.6.16-owrt/net/ipv4/netfilter/Kconfig 2006-03-20 12:59:23.000000000 +0100
@@ -351,6 +351,17 @@
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:47.000000000 +0100
+++ linux-2.6.19.dev/net/ipv4/netfilter/Kconfig 2006-12-14 03:13:47.000000000 +0100
@@ -390,6 +390,17 @@
To compile it as a module, choose M here. If unsure, say N.
@@ -730,21 +724,21 @@ diff -Nur linux-2.6.16/net/ipv4/netfilter/Kconfig linux-2.6.16-owrt/net/ipv4/net
config IP_NF_TARGET_LOG
tristate "LOG target support"
depends on IP_NF_IPTABLES
diff -Nur linux-2.6.16/net/ipv4/netfilter/Makefile linux-2.6.16-owrt/net/ipv4/netfilter/Makefile
--- linux-2.6.16/net/ipv4/netfilter/Makefile 2006-03-20 12:58:53.000000000 +0100
+++ linux-2.6.16-owrt/net/ipv4/netfilter/Makefile 2006-03-20 13:01:12.000000000 +0100
@@ -67,6 +67,7 @@
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:47.000000000 +0100
+++ linux-2.6.19.dev/net/ipv4/netfilter/Makefile 2006-12-14 03:13:47.000000000 +0100
@@ -71,6 +71,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
obj-$(CONFIG_IP_NF_TARGET_DSCP) += ipt_DSCP.o
+obj-$(CONFIG_IP_NF_TARGET_IMQ) += ipt_IMQ.o
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 -Nur linux-2.6.16/net/ipv6/netfilter/ip6t_IMQ.c linux-2.6.16-owrt/net/ipv6/netfilter/ip6t_IMQ.c
--- linux-2.6.16/net/ipv6/netfilter/ip6t_IMQ.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16-owrt/net/ipv6/netfilter/ip6t_IMQ.c 2006-03-20 12:59:23.000000000 +0100
@@ -0,0 +1,80 @@
diff -urN linux-2.6.19.old/net/ipv6/netfilter/ip6t_IMQ.c linux-2.6.19.dev/net/ipv6/netfilter/ip6t_IMQ.c
--- linux-2.6.19.old/net/ipv6/netfilter/ip6t_IMQ.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/net/ipv6/netfilter/ip6t_IMQ.c 2006-12-14 03:13:47.000000000 +0100
@@ -0,0 +1,77 @@
+/*
+ * This target marks packets to be enqueued to an imq device
+ */
@@ -755,11 +749,11 @@ diff -Nur linux-2.6.16/net/ipv6/netfilter/ip6t_IMQ.c linux-2.6.16-owrt/net/ipv6/
+#include <linux/imq.h>
+
+static unsigned int imq_target(struct sk_buff **pskb,
+ unsigned int hooknum,
+ const struct net_device *in,
+ const struct net_device *out,
+ const void *targinfo,
+ void *userdata)
+ unsigned int hooknum,
+ const struct xt_target *target,
+ const void *targinfo)
+{
+ struct ip6t_imq_info *mr = (struct ip6t_imq_info*)targinfo;
+
@@ -769,17 +763,13 @@ diff -Nur linux-2.6.16/net/ipv6/netfilter/ip6t_IMQ.c linux-2.6.16-owrt/net/ipv6/
+}
+
+static int imq_checkentry(const char *tablename,
+ const struct ip6t_entry *e,
+ const void *e,
+ const struct xt_target *target,
+ void *targinfo,
+ unsigned int targinfosize,
+ unsigned int hook_mask)
+{
+ struct ip6t_imq_info *mr;
+
+ if (targinfosize != IP6T_ALIGN(sizeof(struct ip6t_imq_info))) {
+ printk(KERN_WARNING "IMQ: invalid targinfosize\n");
+ return 0;
+ }
+ mr = (struct ip6t_imq_info*)targinfo;
+
+ if (strcmp(tablename, "mangle") != 0) {
@@ -802,6 +792,7 @@ diff -Nur linux-2.6.16/net/ipv6/netfilter/ip6t_IMQ.c linux-2.6.16-owrt/net/ipv6/
+static struct ip6t_target ip6t_imq_reg = {
+ .name = "IMQ",
+ .target = imq_target,
+ .targetsize = sizeof(struct ip6t_imq_info),
+ .checkentry = imq_checkentry,
+ .me = THIS_MODULE
+};
@@ -825,10 +816,10 @@ diff -Nur linux-2.6.16/net/ipv6/netfilter/ip6t_IMQ.c linux-2.6.16-owrt/net/ipv6/
+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 -Nur linux-2.6.16/net/ipv6/netfilter/Kconfig linux-2.6.16-owrt/net/ipv6/netfilter/Kconfig
--- linux-2.6.16/net/ipv6/netfilter/Kconfig 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-owrt/net/ipv6/netfilter/Kconfig 2006-03-20 12:59:23.000000000 +0100
@@ -154,6 +154,15 @@
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-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/net/ipv6/netfilter/Kconfig 2006-12-14 03:13:47.000000000 +0100
@@ -134,6 +134,15 @@
To compile it as a module, choose M here. If unsure, say N.
@@ -844,21 +835,21 @@ diff -Nur linux-2.6.16/net/ipv6/netfilter/Kconfig linux-2.6.16-owrt/net/ipv6/net
config IP6_NF_TARGET_LOG
tristate "LOG target support"
depends on IP6_NF_FILTER
diff -Nur linux-2.6.16/net/ipv6/netfilter/Makefile linux-2.6.16-owrt/net/ipv6/netfilter/Makefile
--- linux-2.6.16/net/ipv6/netfilter/Makefile 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-owrt/net/ipv6/netfilter/Makefile 2006-03-20 13:02:14.000000000 +0100
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-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/net/ipv6/netfilter/Makefile 2006-12-14 03:13:47.000000000 +0100
@@ -4,6 +4,7 @@
# Link order matters here.
obj-$(CONFIG_IP6_NF_IPTABLES) += ip6_tables.o
+obj-$(CONFIG_IP6_NF_TARGET_IMQ) += ip6t_IMQ.o
obj-$(CONFIG_IP6_NF_MATCH_RT) += ip6t_rt.o
obj-$(CONFIG_IP6_NF_MATCH_OPTS) += ip6t_hbh.o ip6t_dst.o
obj-$(CONFIG_IP6_NF_MATCH_OPTS) += ip6t_hbh.o
obj-$(CONFIG_IP6_NF_MATCH_IPV6HEADER) += ip6t_ipv6header.o
diff -Nur linux-2.6.16/net/sched/sch_generic.c linux-2.6.16-owrt/net/sched/sch_generic.c
--- linux-2.6.16/net/sched/sch_generic.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-owrt/net/sched/sch_generic.c 2006-03-20 12:59:23.000000000 +0100
@@ -29,6 +29,9 @@
diff -urN linux-2.6.19.old/net/sched/sch_generic.c linux-2.6.19.dev/net/sched/sch_generic.c
--- linux-2.6.19.old/net/sched/sch_generic.c 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/net/sched/sch_generic.c 2006-12-14 03:13:47.000000000 +0100
@@ -28,6 +28,9 @@
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/rtnetlink.h>
@@ -868,18 +859,10 @@ diff -Nur linux-2.6.16/net/sched/sch_generic.c linux-2.6.16-owrt/net/sched/sch_g
#include <linux/init.h>
#include <linux/rcupdate.h>
#include <linux/list.h>
@@ -136,7 +139,13 @@
if (!netif_queue_stopped(dev)) {
int ret;
- if (netdev_nit)
+
+ if (netdev_nit
+#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE)
+ && !(skb->imq_flags & IMQ_F_ENQUEUE)
+#endif
+ )
+
dev_queue_xmit_nit(skb, dev);
ret = dev->hard_start_xmit(skb, dev);
@@ -615,5 +618,6 @@
EXPORT_SYMBOL(qdisc_alloc);
EXPORT_SYMBOL(qdisc_destroy);
EXPORT_SYMBOL(qdisc_reset);
+EXPORT_SYMBOL(__qdisc_run);
EXPORT_SYMBOL(qdisc_lock_tree);
EXPORT_SYMBOL(qdisc_unlock_tree);

View File

@@ -1,830 +0,0 @@
diff -urN linux-2.6.16.4/net/ipv4/netfilter/ip_conntrack_sip.c linux-2.6.16.4.new/net/ipv4/netfilter/ip_conntrack_sip.c
--- linux-2.6.16.4/net/ipv4/netfilter/ip_conntrack_sip.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16.4.new/net/ipv4/netfilter/ip_conntrack_sip.c 2006-04-12 17:31:44.000000000 +0200
@@ -0,0 +1,414 @@
+/* SIP extension for IP connection tracking.
+ *
+ * (C) 2005 by Christian Hentschel <chentschel@arnet.com.ar>
+ * based on RR's ip_conntrack_ftp.c and other modules.
+ *
+ * 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/config.h>
+#include <linux/module.h>
+#include <linux/netfilter.h>
+#include <linux/ip.h>
+#include <linux/ctype.h>
+#include <linux/in.h>
+#include <linux/udp.h>
+#include <net/checksum.h>
+#include <net/udp.h>
+
+#include <linux/netfilter_ipv4/ip_conntrack_helper.h>
+#include <linux/netfilter_ipv4/ip_conntrack_sip.h>
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Christian Hentschel <chentschel@arnet.com.ar>");
+MODULE_DESCRIPTION("SIP connection tracking helper");
+
+static DEFINE_SPINLOCK(sipbf_lock);
+
+
+#define MAX_PORTS 8
+static int ports[MAX_PORTS];
+static int ports_c;
+module_param_array(ports, int, &ports_c, 0400);
+MODULE_PARM_DESC(ports, " port numbers of sip servers");
+
+static unsigned int sip_timeout = SIP_TIMEOUT;
+
+module_param(sip_timeout, int, 0600);
+MODULE_PARM_DESC(sip_timeout, "timeout for the master sip session");
+
+unsigned int (*ip_nat_sip_hook)(struct sk_buff **pskb,
+ enum ip_conntrack_info ctinfo,
+ struct ip_conntrack *ct,
+ const char **dptr);
+EXPORT_SYMBOL_GPL(ip_nat_sip_hook);
+
+unsigned int (*ip_nat_sdp_hook)(struct sk_buff **pskb,
+ enum ip_conntrack_info ctinfo,
+ struct ip_conntrack_expect *exp,
+ const char *dptr);
+EXPORT_SYMBOL_GPL(ip_nat_sdp_hook);
+
+int ct_sip_get_info(const char *dptr, size_t dlen,
+ unsigned int *matchoff,
+ unsigned int *matchlen,
+ struct sip_header_nfo *hnfo);
+EXPORT_SYMBOL(ct_sip_get_info);
+
+#if 0
+#define DEBUGP printk
+#else
+#define DEBUGP(format, args...)
+#endif
+
+static int digits_len(const char *dptr, const char *limit, int *shift);
+static int epaddr_len(const char *dptr, const char *limit, int *shift);
+static int skp_digits_len(const char *dptr, const char *limit, int *shift);
+static int skp_epaddr_len(const char *dptr, const char *limit, int *shift);
+
+struct sip_header_nfo ct_sip_hdrs[] = {
+ { /* Via header */
+ "Via:", sizeof("Via:") - 1,
+ "\r\nv:", sizeof("\r\nv:") - 1, /* rfc3261 "\r\n" */
+ "UDP ", sizeof("UDP ") - 1,
+ epaddr_len
+ },
+ { /* Contact header */
+ "Contact:", sizeof("Contact:") - 1,
+ "\r\nm:", sizeof("\r\nm:") - 1,
+ "sip:", sizeof("sip:") - 1,
+ skp_epaddr_len
+ },
+ { /* Content length header */
+ "Content-Length:", sizeof("Content-Length:") - 1,
+ "\r\nl:", sizeof("\r\nl:") - 1,
+ ":", sizeof(":") - 1,
+ skp_digits_len
+ },
+ { /* SDP media info */
+ "\nm=", sizeof("\nm=") - 1,
+ "\rm=", sizeof("\rm=") - 1,
+ "audio ", sizeof("audio ") - 1,
+ digits_len
+ },
+ { /* SDP owner address*/
+ "\no=", sizeof("\no=") - 1,
+ "\ro=", sizeof("\ro=") - 1,
+ "IN IP4 ", sizeof("IN IP4 ") - 1,
+ epaddr_len
+ },
+ { /* SDP connection info */
+ "\nc=", sizeof("\nc=") - 1,
+ "\rc=", sizeof("\rc=") - 1,
+ "IN IP4 ", sizeof("IN IP4 ") - 1,
+ epaddr_len
+ },
+ { /* Requests headers */
+ "sip:", sizeof("sip:") - 1,
+ "sip:", sizeof("sip:") - 1, /* yes, i know.. ;) */
+ "@", sizeof("@") - 1,
+ epaddr_len
+ },
+ { /* SDP version header */
+ "\nv=", sizeof("\nv=") - 1,
+ "\rv=", sizeof("\rv=") - 1,
+ "=", sizeof("=") - 1,
+ digits_len
+ }
+};
+EXPORT_SYMBOL(ct_sip_hdrs);
+
+
+static int digits_len(const char *dptr, const char *limit, int *shift)
+{
+ int len = 0;
+ while (dptr <= limit && isdigit(*dptr)) {
+ dptr++;
+ len++;
+ }
+ return len;
+}
+
+/* get digits lenght, skiping blank spaces. */
+static int skp_digits_len(const char *dptr, const char *limit, int *shift)
+{
+ for (; dptr <= limit && *dptr == ' '; dptr++)
+ (*shift)++;
+
+ return digits_len(dptr, limit, shift);
+}
+
+/* Simple ipaddr parser.. */
+static int parse_ipaddr(const char *cp, const char **endp,
+ uint32_t *ipaddr, const char *limit)
+{
+ unsigned long int val;
+ int i, digit = 0;
+
+ for (i = 0, *ipaddr = 0; cp <= limit && i < 4; i++) {
+ digit = 0;
+ if (!isdigit(*cp))
+ break;
+
+ val = simple_strtoul(cp, (char **)&cp, 10);
+ if (val > 0xFF)
+ return -1;
+
+ ((uint8_t *)ipaddr)[i] = val;
+ digit = 1;
+
+ if (*cp != '.')
+ break;
+ cp++;
+ }
+ if (!digit)
+ return -1;
+
+ if (endp)
+ *endp = cp;
+
+ return 0;
+}
+
+/* skip ip address. returns it lenght. */
+static int epaddr_len(const char *dptr, const char *limit, int *shift)
+{
+ const char *aux = dptr;
+ uint32_t ip;
+
+ if (parse_ipaddr(dptr, &dptr, &ip, limit) < 0) {
+ DEBUGP("ip: %s parse failed.!\n", dptr);
+ return 0;
+ }
+
+ /* Port number */
+ if (*dptr == ':') {
+ dptr++;
+ dptr += digits_len(dptr, limit, shift);
+ }
+ return dptr - aux;
+}
+
+/* get address lenght, skiping user info. */
+static int skp_epaddr_len(const char *dptr, const char *limit, int *shift)
+{
+ for (; dptr <= limit && *dptr != '@'; dptr++)
+ (*shift)++;
+
+ if (*dptr == '@') {
+ dptr++;
+ (*shift)++;
+ return epaddr_len(dptr, limit, shift);
+ }
+ return 0;
+}
+
+/* Returns 0 if not found, -1 error parsing. */
+int ct_sip_get_info(const char *dptr, size_t dlen,
+ unsigned int *matchoff,
+ unsigned int *matchlen,
+ struct sip_header_nfo *hnfo)
+{
+ const char *limit, *aux, *k = dptr;
+ int shift = 0;
+
+ limit = dptr + (dlen - hnfo->lnlen);
+
+ while (dptr <= limit) {
+ if ((strncmp(dptr, hnfo->lname, hnfo->lnlen) != 0) &&
+ (strncmp(dptr, hnfo->sname, hnfo->snlen) != 0))
+ {
+ dptr++;
+ continue;
+ }
+ aux = ct_sip_search(hnfo->ln_str, dptr, hnfo->ln_strlen,
+ ct_sip_lnlen(dptr, limit));
+ if (!aux) {
+ DEBUGP("'%s' not found in '%s'.\n", hnfo->ln_str, hnfo->lname);
+ return -1;
+ }
+ aux += hnfo->ln_strlen;
+
+ *matchlen = hnfo->match_len(aux, limit, &shift);
+ if (!*matchlen)
+ return -1;
+
+ *matchoff = (aux - k) + shift;
+
+ DEBUGP("%s match succeeded! - len: %u\n", hnfo->lname, *matchlen);
+ return 1;
+ }
+ DEBUGP("%s header not found.\n", hnfo->lname);
+ return 0;
+}
+
+static int set_expected_rtp(struct sk_buff **pskb,
+ struct ip_conntrack *ct,
+ enum ip_conntrack_info ctinfo,
+ uint32_t ipaddr, uint16_t port,
+ const char *dptr)
+{
+ struct ip_conntrack_expect *exp;
+ int ret;
+
+ exp = ip_conntrack_expect_alloc(ct);
+ if (exp == NULL)
+ return NF_DROP;
+
+ exp->tuple = ((struct ip_conntrack_tuple)
+ { { ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.ip, { 0 } },
+ { ipaddr, { .udp = { htons(port) } }, IPPROTO_UDP }});
+
+ exp->mask = ((struct ip_conntrack_tuple)
+ { { 0xFFFFFFFF, { 0 } },
+ { 0xFFFFFFFF, { .udp = { 0xFFFF } }, 0xFF }});
+
+ exp->expectfn = NULL;
+
+ if (ip_nat_sdp_hook)
+ ret = ip_nat_sdp_hook(pskb, ctinfo, exp, dptr);
+ else {
+ if (ip_conntrack_expect_related(exp) != 0)
+ ret = NF_DROP;
+ else
+ ret = NF_ACCEPT;
+ }
+ ip_conntrack_expect_put(exp);
+
+ return ret;
+}
+
+static int sip_help(struct sk_buff **pskb,
+ struct ip_conntrack *ct,
+ enum ip_conntrack_info ctinfo)
+{
+ unsigned int dataoff, datalen;
+ const char *dptr;
+ int ret = NF_ACCEPT;
+ int matchoff, matchlen;
+ uint32_t ipaddr;
+ uint16_t port;
+
+ /* No Data ? */
+ dataoff = (*pskb)->nh.iph->ihl*4 + sizeof(struct udphdr);
+ if (dataoff >= (*pskb)->len) {
+ DEBUGP("skb->len = %u\n", (*pskb)->len);
+ return NF_ACCEPT;
+ }
+
+ ip_ct_refresh(ct, *pskb, sip_timeout * HZ);
+
+ spin_lock_bh(&sipbf_lock);
+
+ if ((dataoff + (*pskb)->len - dataoff) <= skb_headlen(*pskb))
+ dptr = (*pskb)->data + dataoff;
+ else {
+ DEBUGP("Copy of skbuff not supported yet.\n");
+ goto out;
+ }
+
+ if (ip_nat_sip_hook) {
+ if (!ip_nat_sip_hook(pskb, ctinfo, ct, &dptr)) {
+ ret = NF_DROP;
+ goto out;
+ }
+ }
+
+ if ((ctinfo) >= IP_CT_IS_REPLY)
+ goto out;
+
+ /* After this point NAT, could have mangled skb, so
+ we need to recalculate payload lenght. */
+ datalen = (*pskb)->len - dataoff;
+
+ if (datalen < (sizeof("SIP/2.0 200") - 1))
+ goto out;
+
+ /* RTP info only in some SDP pkts */
+ if (memcmp(dptr, "INVITE", sizeof("INVITE") - 1) != 0 &&
+ memcmp(dptr, "SIP/2.0 200", sizeof("SIP/2.0 200") - 1) != 0) {
+ goto out;
+ }
+ /* Get ip and port address from SDP packet. */
+ if (ct_sip_get_info(dptr, datalen, &matchoff, &matchlen,
+ &ct_sip_hdrs[POS_CONECTION]) > 0) {
+
+ /* We'll drop only if there are parse problems. */
+ if (parse_ipaddr(dptr + matchoff, NULL, &ipaddr,
+ dptr + datalen) < 0) {
+ ret = NF_DROP;
+ goto out;
+ }
+ if (ct_sip_get_info(dptr, datalen, &matchoff, &matchlen,
+ &ct_sip_hdrs[POS_MEDIA]) > 0) {
+
+ port = simple_strtoul(dptr + matchoff, NULL, 10);
+ if (port < 1024) {
+ ret = NF_DROP;
+ goto out;
+ }
+ ret = set_expected_rtp(pskb, ct, ctinfo,
+ ipaddr, port, dptr);
+ }
+ }
+out: spin_unlock_bh(&sipbf_lock);
+ return ret;
+}
+
+static struct ip_conntrack_helper sip[MAX_PORTS];
+static char sip_names[MAX_PORTS][10];
+
+static void fini(void)
+{
+ int i = 0;
+ for (; i < ports_c; i++) {
+ DEBUGP("unregistering helper for port %d\n", ports[i]);
+ ip_conntrack_helper_unregister(&sip[i]);
+ }
+}
+
+static int __init init(void)
+{
+ int i, ret;
+ char *tmpname;
+
+ if (ports_c == 0)
+ ports[ports_c++] = SIP_PORT;
+
+ for (i = 0; i < ports_c; i++) {
+ /* Create helper structure */
+ memset(&sip[i], 0, sizeof(struct ip_conntrack_helper));
+
+ sip[i].tuple.dst.protonum = IPPROTO_UDP;
+ sip[i].tuple.src.u.udp.port = htons(ports[i]);
+ sip[i].mask.src.u.udp.port = 0xFFFF;
+ sip[i].mask.dst.protonum = 0xFF;
+ sip[i].max_expected = 1;
+ sip[i].timeout = 3 * 60; /* 3 minutes */
+ sip[i].me = THIS_MODULE;
+ sip[i].help = sip_help;
+
+ tmpname = &sip_names[i][0];
+ if (ports[i] == SIP_PORT)
+ sprintf(tmpname, "sip");
+ else
+ sprintf(tmpname, "sip-%d", i);
+ sip[i].name = tmpname;
+
+ DEBUGP("port #%d: %d\n", i, ports[i]);
+
+ ret=ip_conntrack_helper_register(&sip[i]);
+ if (ret) {
+ printk("ERROR registering helper for port %d\n",
+ ports[i]);
+ fini();
+ return(ret);
+ }
+ }
+ return(0);
+}
+
+module_init(init);
+module_exit(fini);
diff -urN linux-2.6.16.4/net/ipv4/netfilter/ip_nat_sip.c linux-2.6.16.4.new/net/ipv4/netfilter/ip_nat_sip.c
--- linux-2.6.16.4/net/ipv4/netfilter/ip_nat_sip.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16.4.new/net/ipv4/netfilter/ip_nat_sip.c 2006-04-12 17:31:53.000000000 +0200
@@ -0,0 +1,249 @@
+/* SIP extension for UDP NAT alteration.
+ *
+ * (C) 2005 by Christian Hentschel <chentschel@arnet.com.ar>
+ * based on RR's ip_nat_ftp.c and other modules.
+ *
+ * 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/netfilter_ipv4.h>
+#include <linux/ip.h>
+#include <linux/udp.h>
+#include <net/udp.h>
+
+#include <linux/netfilter_ipv4/ip_nat.h>
+#include <linux/netfilter_ipv4/ip_nat_helper.h>
+#include <linux/netfilter_ipv4/ip_conntrack_helper.h>
+#include <linux/netfilter_ipv4/ip_conntrack_sip.h>
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Christian Hentschel <chentschel@arnet.com.ar>");
+MODULE_DESCRIPTION("SIP NAT helper");
+
+#if 0
+#define DEBUGP printk
+#else
+#define DEBUGP(format, args...)
+#endif
+
+extern struct sip_header_nfo ct_sip_hdrs[];
+
+static unsigned int mangle_sip_packet(struct sk_buff **pskb,
+ enum ip_conntrack_info ctinfo,
+ struct ip_conntrack *ct,
+ const char **dptr, size_t dlen,
+ char *buffer, int bufflen,
+ struct sip_header_nfo *hnfo)
+{
+ unsigned int matchlen, matchoff;
+
+ if (ct_sip_get_info(*dptr, dlen, &matchoff, &matchlen, hnfo) <= 0)
+ return 0;
+
+ if (!ip_nat_mangle_udp_packet(pskb, ct, ctinfo,
+ matchoff, matchlen, buffer, bufflen)) {
+ return 0;
+ }
+ /* We need to reload this. Thanks Patrick. */
+ *dptr = (*pskb)->data + (*pskb)->nh.iph->ihl*4 + sizeof(struct udphdr);
+ return 1;
+}
+
+static unsigned int ip_nat_sip(struct sk_buff **pskb,
+ enum ip_conntrack_info ctinfo,
+ struct ip_conntrack *ct,
+ const char **dptr)
+{
+ char buffer[sizeof("nnn.nnn.nnn.nnn:nnnnn")];
+ unsigned int bufflen, dataoff;
+ uint32_t ip;
+ uint16_t port;
+
+ dataoff = (*pskb)->nh.iph->ihl*4 + sizeof(struct udphdr);
+
+ if ((ctinfo) >= IP_CT_IS_REPLY) {
+ ip = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.ip;
+ port = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u.udp.port;
+ } else {
+ ip = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip;
+ port = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u.udp.port;
+ }
+ bufflen = sprintf(buffer, "%u.%u.%u.%u:%u", NIPQUAD(ip), ntohs(port));
+
+ /* short packet ? */
+ if (((*pskb)->len - dataoff) < (sizeof("SIP/2.0") - 1))
+ return 0;
+
+ /* Basic rules: requests and responses. */
+ if (memcmp(*dptr, "SIP/2.0", sizeof("SIP/2.0") - 1) == 0) {
+
+ if ((ctinfo) < IP_CT_IS_REPLY) {
+ mangle_sip_packet(pskb, ctinfo, ct, dptr,
+ (*pskb)->len - dataoff, buffer, bufflen,
+ &ct_sip_hdrs[POS_CONTACT]);
+ return 1;
+ }
+
+ if (!mangle_sip_packet(pskb, ctinfo, ct, dptr, (*pskb)->len - dataoff,
+ buffer, bufflen, &ct_sip_hdrs[POS_VIA])) {
+ return 0;
+ }
+
+ /* This search should ignore case, but later.. */
+ const char *aux = ct_sip_search("CSeq:", *dptr, sizeof("CSeq:") - 1,
+ (*pskb)->len - dataoff);
+ if (!aux)
+ return 0;
+
+ if (!ct_sip_search("REGISTER", aux, sizeof("REGISTER"),
+ ct_sip_lnlen(aux, *dptr + (*pskb)->len - dataoff))) {
+ return 1;
+ }
+ return mangle_sip_packet(pskb, ctinfo, ct, dptr, (*pskb)->len - dataoff,
+ buffer, bufflen, &ct_sip_hdrs[POS_CONTACT]);
+ }
+ if ((ctinfo) < IP_CT_IS_REPLY) {
+ if (!mangle_sip_packet(pskb, ctinfo, ct, dptr, (*pskb)->len - dataoff,
+ buffer, bufflen, &ct_sip_hdrs[POS_VIA])) {
+ return 0;
+ }
+
+ /* Mangle Contact if exists only. - watch udp_nat_mangle()! */
+ mangle_sip_packet(pskb, ctinfo, ct, dptr, (*pskb)->len - dataoff,
+ buffer, bufflen, &ct_sip_hdrs[POS_CONTACT]);
+ return 1;
+ }
+ /* This mangle requests headers. */
+ return mangle_sip_packet(pskb, ctinfo, ct, dptr,
+ ct_sip_lnlen(*dptr, *dptr + (*pskb)->len - dataoff),
+ buffer, bufflen, &ct_sip_hdrs[POS_REQ_HEADER]);
+}
+
+static int mangle_content_len(struct sk_buff **pskb,
+ enum ip_conntrack_info ctinfo,
+ struct ip_conntrack *ct,
+ const char *dptr)
+{
+ unsigned int dataoff, matchoff, matchlen;
+ char buffer[sizeof("65536")];
+ int bufflen;
+
+ dataoff = (*pskb)->nh.iph->ihl*4 + sizeof(struct udphdr);
+
+ /* Get actual SDP lenght */
+ if (ct_sip_get_info(dptr, (*pskb)->len - dataoff, &matchoff,
+ &matchlen, &ct_sip_hdrs[POS_SDP_HEADER]) > 0) {
+
+ /* since ct_sip_get_info() give us a pointer passing 'v='
+ we need to add 2 bytes in this count. */
+ int c_len = (*pskb)->len - dataoff - matchoff + 2;
+
+ /* Now, update SDP lenght */
+ if (ct_sip_get_info(dptr, (*pskb)->len - dataoff, &matchoff,
+ &matchlen, &ct_sip_hdrs[POS_CONTENT]) > 0) {
+
+ bufflen = sprintf(buffer, "%u", c_len);
+
+ return ip_nat_mangle_udp_packet(pskb, ct, ctinfo, matchoff,
+ matchlen, buffer, bufflen);
+ }
+ }
+ return 0;
+}
+
+static unsigned int mangle_sdp(struct sk_buff **pskb,
+ enum ip_conntrack_info ctinfo,
+ struct ip_conntrack *ct,
+ uint32_t newip, uint16_t port,
+ const char *dptr)
+{
+ char buffer[sizeof("nnn.nnn.nnn.nnn")];
+ unsigned int dataoff, bufflen;
+
+ dataoff = (*pskb)->nh.iph->ihl*4 + sizeof(struct udphdr);
+
+ /* Mangle owner and contact info. */
+ bufflen = sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(newip));
+ if (!mangle_sip_packet(pskb, ctinfo, ct, &dptr, (*pskb)->len - dataoff,
+ buffer, bufflen, &ct_sip_hdrs[POS_OWNER])) {
+ return 0;
+ }
+
+ if (!mangle_sip_packet(pskb, ctinfo, ct, &dptr, (*pskb)->len - dataoff,
+ buffer, bufflen, &ct_sip_hdrs[POS_CONECTION])) {
+ return 0;
+ }
+
+ /* Mangle media port. */
+ bufflen = sprintf(buffer, "%u", port);
+ if (!mangle_sip_packet(pskb, ctinfo, ct, &dptr, (*pskb)->len - dataoff,
+ buffer, bufflen, &ct_sip_hdrs[POS_MEDIA])) {
+ return 0;
+ }
+
+ return mangle_content_len(pskb, ctinfo, ct, dptr);
+}
+
+/* So, this packet has hit the connection tracking matching code.
+ Mangle it, and change the expectation to match the new version. */
+static unsigned int ip_nat_sdp(struct sk_buff **pskb,
+ enum ip_conntrack_info ctinfo,
+ struct ip_conntrack_expect *exp,
+ const char *dptr)
+{
+ struct ip_conntrack *ct = exp->master;
+ uint32_t newip;
+ uint16_t port;
+
+ DEBUGP("ip_nat_sdp():\n");
+
+ /* Connection will come from reply */
+ newip = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip;
+
+ exp->tuple.dst.ip = newip;
+ exp->saved_proto.udp.port = exp->tuple.dst.u.udp.port;
+ exp->dir = IP_CT_DIR_REPLY;
+
+ /* When you see the packet, we need to NAT it the same as the
+ this one. */
+ exp->expectfn = ip_nat_follow_master;
+
+ /* Try to get same port: if not, try to change it. */
+ for (port = ntohs(exp->saved_proto.udp.port); port != 0; port++) {
+ exp->tuple.dst.u.udp.port = htons(port);
+ if (ip_conntrack_expect_related(exp) == 0)
+ break;
+ }
+
+ if (port == 0)
+ return NF_DROP;
+
+ if (!mangle_sdp(pskb, ctinfo, ct, newip, port, dptr)) {
+ ip_conntrack_unexpect_related(exp);
+ return NF_DROP;
+ }
+ return NF_ACCEPT;
+}
+
+static void __exit fini(void)
+{
+ ip_nat_sip_hook = NULL;
+ ip_nat_sdp_hook = NULL;
+ /* Make sure noone calls it, meanwhile. */
+ synchronize_net();
+}
+
+static int __init init(void)
+{
+ BUG_ON(ip_nat_sip_hook);
+ BUG_ON(ip_nat_sdp_hook);
+ ip_nat_sip_hook = ip_nat_sip;
+ ip_nat_sdp_hook = ip_nat_sdp;
+ return 0;
+}
+
+module_init(init);
+module_exit(fini);
diff -urN linux-2.6.16.4/net/ipv4/netfilter/Kconfig linux-2.6.16.4.new/net/ipv4/netfilter/Kconfig
--- linux-2.6.16.4/net/ipv4/netfilter/Kconfig 2006-04-12 17:29:19.000000000 +0200
+++ linux-2.6.16.4.new/net/ipv4/netfilter/Kconfig 2006-04-12 17:32:53.000000000 +0200
@@ -168,6 +168,19 @@
If you want to compile it as a module, say M here and read
Documentation/modules.txt. If unsure, say `N'.
+config IP_NF_SIP
+ tristate 'SIP support'
+ depends on IP_NF_CONNTRACK
+ help
+ SIP is an application-layer control protocol that can establish,
+ modify, and terminate multimedia sessions (conferences) such as
+ Internet telephony calls. With the ip_conntrack_sip and
+ the ip_nat_sip modules you can support the protocol on a connection
+ tracking/NATing firewall.
+
+ If you want to compile it as a module, say 'M' here and read
+ Documentation/modules.txt. If unsure, say 'N'.
+
config IP_NF_QUEUE
tristate "IP Userspace queueing via NETLINK (OBSOLETE)"
help
@@ -545,6 +558,12 @@
default IP_NF_NAT if IP_NF_PPTP=y
default m if IP_NF_PPTP=m
+config IP_NF_NAT_SIP
+ tristate
+ depends on IP_NF_CONNTRACK!=n && IP_NF_NAT!=n
+ default IP_NF_NAT if IP_NF_SIP=y
+ default m if IP_NF_SIP=m
+
# mangle + specific targets
config IP_NF_MANGLE
tristate "Packet mangling"
diff -urN linux-2.6.16.4/net/ipv4/netfilter/Makefile linux-2.6.16.4.new/net/ipv4/netfilter/Makefile
--- linux-2.6.16.4/net/ipv4/netfilter/Makefile 2006-04-12 17:29:19.000000000 +0200
+++ linux-2.6.16.4.new/net/ipv4/netfilter/Makefile 2006-04-12 17:33:39.000000000 +0200
@@ -28,6 +28,7 @@
obj-$(CONFIG_IP_NF_FTP) += ip_conntrack_ftp.o
obj-$(CONFIG_IP_NF_IRC) += ip_conntrack_irc.o
obj-$(CONFIG_IP_NF_NETBIOS_NS) += ip_conntrack_netbios_ns.o
+obj-$(CONFIG_IP_NF_SIP) += ip_conntrack_sip.o
# NAT helpers
obj-$(CONFIG_IP_NF_NAT_PPTP) += ip_nat_pptp.o
@@ -35,6 +36,7 @@
obj-$(CONFIG_IP_NF_NAT_TFTP) += ip_nat_tftp.o
obj-$(CONFIG_IP_NF_NAT_FTP) += ip_nat_ftp.o
obj-$(CONFIG_IP_NF_NAT_IRC) += ip_nat_irc.o
+obj-$(CONFIG_IP_NF_NAT_SIP) += ip_nat_sip.o
# generic IP tables
obj-$(CONFIG_IP_NF_IPTABLES) += ip_tables.o
diff -urN linux-2.6.16.4/include/linux/netfilter_ipv4/ip_conntrack.h linux-2.6.16.4.new/include/linux/netfilter_ipv4/ip_conntrack.h
--- linux-2.6.16.4/include/linux/netfilter_ipv4/ip_conntrack.h 2006-04-12 17:29:19.000000000 +0200
+++ linux-2.6.16.4.new/include/linux/netfilter_ipv4/ip_conntrack.h 2006-04-12 17:30:38.000000000 +0200
@@ -33,6 +33,7 @@
#include <linux/netfilter_ipv4/ip_conntrack_amanda.h>
#include <linux/netfilter_ipv4/ip_conntrack_ftp.h>
#include <linux/netfilter_ipv4/ip_conntrack_irc.h>
+#include <linux/netfilter_ipv4/ip_conntrack_sip.h>
/* per conntrack: application helper private data */
union ip_conntrack_help {
@@ -40,6 +41,7 @@
struct ip_ct_pptp_master ct_pptp_info;
struct ip_ct_ftp_master ct_ftp_info;
struct ip_ct_irc_master ct_irc_info;
+ struct ip_ct_sip_master ct_sip_info;
};
#ifdef CONFIG_IP_NF_NAT_NEEDED
diff -urN linux-2.6.16.4/include/linux/netfilter_ipv4/ip_conntrack_sip.h linux-2.6.16.4.new/include/linux/netfilter_ipv4/ip_conntrack_sip.h
--- linux-2.6.16.4/include/linux/netfilter_ipv4/ip_conntrack_sip.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16.4.new/include/linux/netfilter_ipv4/ip_conntrack_sip.h 2006-04-12 17:31:12.000000000 +0200
@@ -0,0 +1,81 @@
+#ifndef __IP_CONNTRACK_SIP_H__
+#define __IP_CONNTRACK_SIP_H__
+/* SIP tracking. */
+
+#ifdef __KERNEL__
+
+#define SIP_PORT 5060
+#define SIP_TIMEOUT 3600
+
+#define POS_VIA 0
+#define POS_CONTACT 1
+#define POS_CONTENT 2
+#define POS_MEDIA 3
+#define POS_OWNER 4
+#define POS_CONECTION 5
+#define POS_REQ_HEADER 6
+#define POS_SDP_HEADER 7
+
+struct ip_ct_sip_master {
+};
+
+struct sip_header_nfo {
+ const char *lname;
+ size_t lnlen;
+ const char *sname;
+ size_t snlen;
+ const char *ln_str;
+ size_t ln_strlen;
+ int (*match_len)(const char *, const char *, int *);
+
+};
+
+extern unsigned int (*ip_nat_sip_hook)(struct sk_buff **pskb,
+ enum ip_conntrack_info ctinfo,
+ struct ip_conntrack *ct,
+ const char **dptr);
+
+/* For NAT to hook in when on expect. */
+extern unsigned int (*ip_nat_sdp_hook)(struct sk_buff **pskb,
+ enum ip_conntrack_info ctinfo,
+ struct ip_conntrack_expect *exp,
+ const char *dptr);
+
+extern int ct_sip_get_info(const char *dptr, size_t dlen,
+ unsigned int *matchoff,
+ unsigned int *matchlen,
+ struct sip_header_nfo *hnfo);
+
+/* get line lenght until first CR or LF seen. */
+static __inline__ int ct_sip_lnlen(const char *line, const char *limit)
+{
+ const char *k = line;
+
+ while ((line <= limit) && (*line == '\r' || *line == '\n'))
+ line++;
+
+ while (line <= limit) {
+ if (*line == '\r' || *line == '\n')
+ break;
+ line++;
+ }
+ return line - k;
+}
+
+/* Linear string search, case sensitive. */
+static __inline__
+const char *ct_sip_search(const char *needle, const char *haystack,
+ size_t needle_len, size_t haystack_len)
+{
+ const char *limit = haystack + (haystack_len - needle_len);
+
+ while (haystack <= limit) {
+ if (memcmp(haystack, needle, needle_len) == 0)
+ return haystack;
+ haystack++;
+ }
+ return NULL;
+}
+#endif /* __KERNEL__ */
+
+#endif /* __IP_CONNTRACK_SIP_H__ */

View File

@@ -1,6 +1,6 @@
diff -u'rNF^function' linux-2.6.16.7/include/linux/netfilter_ipv4/ipt_ROUTE.h linux-2.6.16.7-ROUTE/include/linux/netfilter_ipv4/ipt_ROUTE.h
--- linux-2.6.16.7/include/linux/netfilter_ipv4/ipt_ROUTE.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16.7-ROUTE/include/linux/netfilter_ipv4/ipt_ROUTE.h 2006-06-14 16:40:49.000000000 +0200
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
@@ -0,0 +1,23 @@
+/* Header file for iptables ipt_ROUTE target
+ *
@@ -25,9 +25,9 @@ diff -u'rNF^function' linux-2.6.16.7/include/linux/netfilter_ipv4/ipt_ROUTE.h li
+#define IPT_ROUTE_TEE 0x02
+
+#endif /*_IPT_ROUTE_H_target*/
diff -u'rNF^function' linux-2.6.16.7/include/linux/netfilter_ipv6/ip6t_ROUTE.h linux-2.6.16.7-ROUTE/include/linux/netfilter_ipv6/ip6t_ROUTE.h
--- linux-2.6.16.7/include/linux/netfilter_ipv6/ip6t_ROUTE.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16.7-ROUTE/include/linux/netfilter_ipv6/ip6t_ROUTE.h 2006-06-14 16:41:08.000000000 +0200
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
@@ -0,0 +1,23 @@
+/* Header file for iptables ip6t_ROUTE target
+ *
@@ -52,48 +52,10 @@ diff -u'rNF^function' linux-2.6.16.7/include/linux/netfilter_ipv6/ip6t_ROUTE.h l
+#define IP6T_ROUTE_TEE 0x02
+
+#endif /*_IP6T_ROUTE_H_target*/
diff -u'rNF^function' linux-2.6.16.7/net/ipv4/netfilter/Kconfig linux-2.6.16.7-ROUTE/net/ipv4/netfilter/Kconfig
--- linux-2.6.16.7/net/ipv4/netfilter/Kconfig 2006-06-14 16:05:44.000000000 +0200
+++ linux-2.6.16.7-ROUTE/net/ipv4/netfilter/Kconfig 2006-06-14 16:46:40.000000000 +0200
@@ -491,6 +491,23 @@
To compile it as a module, choose M here. If unsure, say N.
+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 -u'rNF^function' linux-2.6.16.7/net/ipv4/netfilter/Makefile linux-2.6.16.7-ROUTE/net/ipv4/netfilter/Makefile
--- linux-2.6.16.7/net/ipv4/netfilter/Makefile 2006-06-14 16:05:44.000000000 +0200
+++ linux-2.6.16.7-ROUTE/net/ipv4/netfilter/Makefile 2006-06-14 16:44:02.000000000 +0200
@@ -74,6 +74,7 @@
obj-$(CONFIG_IP_NF_TARGET_IMQ) += ipt_IMQ.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 -u'rNF^function' linux-2.6.16.7/net/ipv4/netfilter/ipt_ROUTE.c linux-2.6.16.7-ROUTE/net/ipv4/netfilter/ipt_ROUTE.c
--- linux-2.6.16.7/net/ipv4/netfilter/ipt_ROUTE.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16.7-ROUTE/net/ipv4/netfilter/ipt_ROUTE.c 2006-06-14 16:42:23.000000000 +0200
@@ -0,0 +1,461 @@
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 @@
+/*
+ * This implements the ROUTE target, which enables you to setup unusual
+ * routes not supported by the standard kernel routing table.
@@ -376,8 +338,8 @@ diff -u'rNF^function' linux-2.6.16.7/net/ipv4/netfilter/ipt_ROUTE.c linux-2.6.16
+ const struct net_device *in,
+ const struct net_device *out,
+ unsigned int hooknum,
+ const void *targinfo,
+ void *userinfo)
+ const struct xt_target *target,
+ const void *targinfo)
+{
+ const struct ipt_route_target_info *route_info = targinfo;
+ struct sk_buff *skb = *pskb;
@@ -497,8 +459,8 @@ diff -u'rNF^function' linux-2.6.16.7/net/ipv4/netfilter/ipt_ROUTE.c linux-2.6.16
+
+static int ipt_route_checkentry(const char *tablename,
+ const void *e,
+ const struct xt_target *target,
+ void *targinfo,
+ unsigned int targinfosize,
+ unsigned int hook_mask)
+{
+ if (strcmp(tablename, "mangle") != 0) {
@@ -516,13 +478,6 @@ diff -u'rNF^function' linux-2.6.16.7/net/ipv4/netfilter/ipt_ROUTE.c linux-2.6.16
+ return 0;
+ }
+
+ 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;
+ }
+
+ return 1;
+}
+
@@ -530,6 +485,7 @@ diff -u'rNF^function' linux-2.6.16.7/net/ipv4/netfilter/ipt_ROUTE.c linux-2.6.16
+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,
+};
@@ -555,10 +511,48 @@ diff -u'rNF^function' linux-2.6.16.7/net/ipv4/netfilter/ipt_ROUTE.c linux-2.6.16
+
+module_init(init);
+module_exit(fini);
diff -u'rNF^function' linux-2.6.16.7/net/ipv6/ipv6_syms.c linux-2.6.16.7-ROUTE/net/ipv6/ipv6_syms.c
--- linux-2.6.16.7/net/ipv6/ipv6_syms.c 2006-04-17 23:53:25.000000000 +0200
+++ linux-2.6.16.7-ROUTE/net/ipv6/ipv6_syms.c 2006-06-14 17:02:32.000000000 +0200
@@ -12,6 +12,7 @@
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.
+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
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 @@
EXPORT_SYMBOL(icmpv6_statistics);
EXPORT_SYMBOL(icmpv6_err_convert);
EXPORT_SYMBOL(ndisc_mc_map);
@@ -566,44 +560,10 @@ diff -u'rNF^function' linux-2.6.16.7/net/ipv6/ipv6_syms.c linux-2.6.16.7-ROUTE/n
EXPORT_SYMBOL(register_inet6addr_notifier);
EXPORT_SYMBOL(unregister_inet6addr_notifier);
EXPORT_SYMBOL(ip6_route_output);
diff -u'rNF^function' linux-2.6.16.7/net/ipv6/netfilter/Kconfig linux-2.6.16.7-ROUTE/net/ipv6/netfilter/Kconfig
--- linux-2.6.16.7/net/ipv6/netfilter/Kconfig 2006-06-14 16:05:44.000000000 +0200
+++ linux-2.6.16.7-ROUTE/net/ipv6/netfilter/Kconfig 2006-06-14 16:45:45.000000000 +0200
@@ -182,6 +182,19 @@
To compile it as a module, choose M here. 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 -u'rNF^function' linux-2.6.16.7/net/ipv6/netfilter/Makefile linux-2.6.16.7-ROUTE/net/ipv6/netfilter/Makefile
--- linux-2.6.16.7/net/ipv6/netfilter/Makefile 2006-06-14 16:05:44.000000000 +0200
+++ linux-2.6.16.7-ROUTE/net/ipv6/netfilter/Makefile 2006-06-14 16:45:00.000000000 +0200
@@ -22,6 +22,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
# objects for l3 independent conntrack
nf_conntrack_ipv6-objs := nf_conntrack_l3proto_ipv6.o nf_conntrack_proto_icmpv6.o nf_conntrack_reasm.o
diff -u'rNF^function' linux-2.6.16.7/net/ipv6/netfilter/ip6t_ROUTE.c linux-2.6.16.7-ROUTE/net/ipv6/netfilter/ip6t_ROUTE.c
--- linux-2.6.16.7/net/ipv6/netfilter/ip6t_ROUTE.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16.7-ROUTE/net/ipv6/netfilter/ip6t_ROUTE.c 2006-06-14 16:42:44.000000000 +0200
@@ -0,0 +1,308 @@
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 @@
+/*
+ * This implements the ROUTE v6 target, which enables you to setup unusual
+ * routes not supported by the standard kernel routing table.
@@ -798,8 +758,8 @@ diff -u'rNF^function' linux-2.6.16.7/net/ipv6/netfilter/ip6t_ROUTE.c linux-2.6.1
+ const struct net_device *in,
+ const struct net_device *out,
+ unsigned int hooknum,
+ const void *targinfo,
+ void *userinfo)
+ const struct xt_target *target,
+ const void *targinfo)
+{
+ const struct ip6t_route_target_info *route_info = targinfo;
+ struct sk_buff *skb = *pskb;
@@ -865,9 +825,9 @@ diff -u'rNF^function' linux-2.6.16.7/net/ipv6/netfilter/ip6t_ROUTE.c linux-2.6.1
+
+static int
+ip6t_route_checkentry(const char *tablename,
+ const struct ip6t_entry *e,
+ const void *e,
+ const struct xt_target *target,
+ void *targinfo,
+ unsigned int targinfosize,
+ unsigned int hook_mask)
+{
+ if (strcmp(tablename, "mangle") != 0) {
@@ -875,13 +835,6 @@ diff -u'rNF^function' linux-2.6.16.7/net/ipv6/netfilter/ip6t_ROUTE.c linux-2.6.1
+ return 0;
+ }
+
+ 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;
+ }
+
+ return 1;
+}
+
@@ -889,6 +842,7 @@ diff -u'rNF^function' linux-2.6.16.7/net/ipv6/netfilter/ip6t_ROUTE.c linux-2.6.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
+};
@@ -912,3 +866,37 @@ diff -u'rNF^function' linux-2.6.16.7/net/ipv6/netfilter/ip6t_ROUTE.c linux-2.6.1
+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.
+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 @@
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
# objects for l3 independent conntrack
nf_conntrack_ipv6-objs := nf_conntrack_l3proto_ipv6.o nf_conntrack_proto_icmpv6.o nf_conntrack_reasm.o

View File

@@ -1,6 +1,6 @@
diff -Naur linux-2.6.15.1.orig/include/linux/pkt_sched.h linux-2.6.15.1/include/linux/pkt_sched.h
--- linux-2.6.15.1.orig/include/linux/pkt_sched.h 2006-01-14 22:16:02.000000000 -0800
+++ linux-2.6.15.1/include/linux/pkt_sched.h 2006-01-30 16:02:32.000000000 -0800
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 @@
*
* The only reason for this is efficiency, it is possible
@@ -37,9 +37,9 @@ diff -Naur linux-2.6.15.1.orig/include/linux/pkt_sched.h linux-2.6.15.1/include/
/* RED section */
enum
diff -Naur linux-2.6.15.1.orig/net/sched/Kconfig linux-2.6.15.1/net/sched/Kconfig
--- linux-2.6.15.1.orig/net/sched/Kconfig 2006-01-14 22:16:02.000000000 -0800
+++ linux-2.6.15.1/net/sched/Kconfig 2006-01-30 16:02:32.000000000 -0800
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 @@
To compile this code as a module, choose M here: the
module will be called sch_sfq.
@@ -69,9 +69,9 @@ diff -Naur linux-2.6.15.1.orig/net/sched/Kconfig linux-2.6.15.1/net/sched/Kconfi
config NET_SCH_TEQL
tristate "True Link Equalizer (TEQL)"
---help---
diff -Naur linux-2.6.15.1.orig/net/sched/Makefile linux-2.6.15.1/net/sched/Makefile
--- linux-2.6.15.1.orig/net/sched/Makefile 2006-01-14 22:16:02.000000000 -0800
+++ linux-2.6.15.1/net/sched/Makefile 2006-01-30 16:02:32.000000000 -0800
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 @@
obj-$(CONFIG_NET_SCH_INGRESS) += sch_ingress.o
obj-$(CONFIG_NET_SCH_DSMARK) += sch_dsmark.o
@@ -80,9 +80,9 @@ diff -Naur linux-2.6.15.1.orig/net/sched/Makefile linux-2.6.15.1/net/sched/Makef
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 -Naur linux-2.6.15.1.orig/net/sched/sch_esfq.c linux-2.6.15.1/net/sched/sch_esfq.c
--- linux-2.6.15.1.orig/net/sched/sch_esfq.c 1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.15.1/net/sched/sch_esfq.c 2006-01-30 16:12:29.000000000 -0800
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 @@
+/*
+ * net/sched/sch_esfq.c Extended Stochastic Fairness Queueing discipline.
@@ -108,7 +108,7 @@ diff -Naur linux-2.6.15.1.orig/net/sched/sch_esfq.c linux-2.6.15.1/net/sched/sch
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/autoconf.h>
+#include <linux/module.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>

View File

@@ -1,6 +1,6 @@
diff -Nur linux-2.6.17/include/linux/netfilter_ipv4/ip_nat.h linux-2.6.17-owrt/include/linux/netfilter_ipv4/ip_nat.h
--- linux-2.6.17/include/linux/netfilter_ipv4/ip_nat.h 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/include/linux/netfilter_ipv4/ip_nat.h 2006-06-18 16:53:21.000000000 +0200
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 @@
struct ip_conntrack;
@@ -15,9 +15,9 @@ diff -Nur linux-2.6.17/include/linux/netfilter_ipv4/ip_nat.h linux-2.6.17-owrt/i
/* 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 -Nur linux-2.6.17/include/linux/rtnetlink.h linux-2.6.17-owrt/include/linux/rtnetlink.h
--- linux-2.6.17/include/linux/rtnetlink.h 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/include/linux/rtnetlink.h 2006-06-18 16:53:21.000000000 +0200
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
@@ -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,19 +27,19 @@ diff -Nur linux-2.6.17/include/linux/rtnetlink.h linux-2.6.17-owrt/include/linux
/* Macros to handle hexthops */
diff -Nur linux-2.6.17/include/net/flow.h linux-2.6.17-owrt/include/net/flow.h
--- linux-2.6.17/include/net/flow.h 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/include/net/flow.h 2006-06-18 16:53:21.000000000 +0200
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
@@ -19,6 +19,8 @@
__u32 daddr;
__u32 saddr;
__be32 daddr;
__be32 saddr;
__u32 fwmark;
+ __u32 lsrc;
+ __u32 gw;
__u8 tos;
__u8 scope;
} ip4_u;
@@ -46,6 +48,8 @@
@@ -48,6 +50,8 @@
#define fl4_dst nl_u.ip4_u.daddr
#define fl4_src nl_u.ip4_u.saddr
#define fl4_fwmark nl_u.ip4_u.fwmark
@@ -48,10 +48,10 @@ diff -Nur linux-2.6.17/include/net/flow.h linux-2.6.17-owrt/include/net/flow.h
#define fl4_tos nl_u.ip4_u.tos
#define fl4_scope nl_u.ip4_u.scope
diff -Nur linux-2.6.17/include/net/ip_fib.h linux-2.6.17-owrt/include/net/ip_fib.h
--- linux-2.6.17/include/net/ip_fib.h 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/include/net/ip_fib.h 2006-06-18 16:53:21.000000000 +0200
@@ -195,7 +195,8 @@
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)
{
@@ -61,53 +61,56 @@ diff -Nur linux-2.6.17/include/net/ip_fib.h linux-2.6.17-owrt/include/net/ip_fib
ip_fib_main_table->tb_select_default(ip_fib_main_table, flp, res);
}
@@ -207,6 +208,7 @@
extern int fib_lookup(const struct flowi *flp, struct fib_result *res);
extern struct fib_table *__fib_new_table(int id);
extern void fib_rule_put(struct fib_rule *r);
+extern int fib_result_table(struct fib_result *res);
@@ -212,6 +213,8 @@
static inline struct fib_table *fib_get_table(int id)
{
@@ -302,4 +304,6 @@
#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 -Nur linux-2.6.17/include/net/route.h linux-2.6.17-owrt/include/net/route.h
--- linux-2.6.17/include/net/route.h 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/include/net/route.h 2006-06-18 16:53:21.000000000 +0200
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*, u32 dst, u32 src, u8 tos, struct net_device *devin);
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 -Nur linux-2.6.17/net/ipv4/fib_frontend.c linux-2.6.17-owrt/net/ipv4/fib_frontend.c
--- linux-2.6.17/net/ipv4/fib_frontend.c 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/net/ipv4/fib_frontend.c 2006-06-18 16:53:21.000000000 +0200
@@ -56,6 +56,8 @@
struct fib_table *ip_fib_local_table;
struct fib_table *ip_fib_main_table;
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 RT_TABLE_MIN 1
@@ -73,6 +75,7 @@
return tb;
#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 */
@@ -170,6 +173,9 @@
static void fib_flush(void)
@@ -190,6 +195,9 @@
.tos = tos } },
.iif = oif };
struct fib_result res;
@@ -117,7 +120,7 @@ diff -Nur linux-2.6.17/net/ipv4/fib_frontend.c linux-2.6.17-owrt/net/ipv4/fib_fr
int no_addr, rpf;
int ret;
@@ -191,31 +197,35 @@
@@ -211,31 +219,35 @@
goto e_inval_res;
*spec_dst = FIB_RES_PREFSRC(res);
fib_combine_itag(itag, &res);
@@ -160,7 +163,7 @@ diff -Nur linux-2.6.17/net/ipv4/fib_frontend.c linux-2.6.17-owrt/net/ipv4/fib_fr
return ret;
last_resort:
@@ -589,9 +599,7 @@
@@ -836,9 +848,7 @@
switch (event) {
case NETDEV_UP:
fib_add_ifaddr(ifa);
@@ -170,7 +173,7 @@ diff -Nur linux-2.6.17/net/ipv4/fib_frontend.c linux-2.6.17-owrt/net/ipv4/fib_fr
rt_cache_flush(-1);
break;
case NETDEV_DOWN:
@@ -627,9 +635,7 @@
@@ -874,9 +884,7 @@
for_ifa(in_dev) {
fib_add_ifaddr(ifa);
} endfor_ifa(in_dev);
@@ -180,10 +183,10 @@ diff -Nur linux-2.6.17/net/ipv4/fib_frontend.c linux-2.6.17-owrt/net/ipv4/fib_fr
rt_cache_flush(-1);
break;
case NETDEV_DOWN:
diff -Nur linux-2.6.17/net/ipv4/fib_hash.c linux-2.6.17-owrt/net/ipv4/fib_hash.c
--- linux-2.6.17/net/ipv4/fib_hash.c 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/net/ipv4/fib_hash.c 2006-06-18 16:53:21.000000000 +0200
@@ -277,30 +277,38 @@
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;
}
@@ -227,7 +230,7 @@ diff -Nur linux-2.6.17/net/ipv4/fib_hash.c linux-2.6.17-owrt/net/ipv4/fib_hash.c
list_for_each_entry(fa, &f->fn_alias, fa_list) {
struct fib_info *next_fi = fa->fa_info;
@@ -308,41 +316,52 @@
@@ -306,41 +314,52 @@
fa->fa_type != RTN_UNICAST)
continue;
@@ -292,7 +295,7 @@ diff -Nur linux-2.6.17/net/ipv4/fib_hash.c linux-2.6.17-owrt/net/ipv4/fib_hash.c
goto out;
}
@@ -352,8 +371,11 @@
@@ -350,8 +369,11 @@
res->fi = last_resort;
if (last_resort)
atomic_inc(&last_resort->fib_clntref);
@@ -305,25 +308,25 @@ diff -Nur linux-2.6.17/net/ipv4/fib_hash.c linux-2.6.17-owrt/net/ipv4/fib_hash.c
out:
read_unlock(&fib_hash_lock);
}
@@ -452,6 +474,7 @@
@@ -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 = type;
fa->fa_scope = r->rtm_scope;
fa->fa_type = cfg->fc_type;
fa->fa_scope = cfg->fc_scope;
state = fa->fa_state;
@@ -511,6 +534,7 @@
new_fa->fa_type = type;
new_fa->fa_scope = r->rtm_scope;
@@ -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 -Nur linux-2.6.17/net/ipv4/fib_lookup.h linux-2.6.17-owrt/net/ipv4/fib_lookup.h
--- linux-2.6.17/net/ipv4/fib_lookup.h 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/net/ipv4/fib_lookup.h 2006-06-18 16:53:21.000000000 +0200
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;
@@ -332,7 +335,7 @@ diff -Nur linux-2.6.17/net/ipv4/fib_lookup.h linux-2.6.17-owrt/net/ipv4/fib_look
u8 fa_tos;
u8 fa_type;
u8 fa_scope;
@@ -40,6 +41,7 @@
@@ -35,6 +36,7 @@
u8 tos, u32 prio);
extern int fib_detect_death(struct fib_info *fi, int order,
struct fib_info **last_resort,
@@ -341,34 +344,34 @@ diff -Nur linux-2.6.17/net/ipv4/fib_lookup.h linux-2.6.17-owrt/net/ipv4/fib_look
+ const struct flowi *flp);
#endif /* _FIB_LOOKUP_H */
diff -Nur linux-2.6.17/net/ipv4/fib_rules.c linux-2.6.17-owrt/net/ipv4/fib_rules.c
--- linux-2.6.17/net/ipv4/fib_rules.c 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/net/ipv4/fib_rules.c 2006-06-18 16:53:21.000000000 +0200
@@ -296,6 +296,11 @@
}
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->r_table;
+ return res->r->table;
+}
+
int fib_lookup(const struct flowi *flp, struct fib_result *res)
int fib_lookup(struct flowi *flp, struct fib_result *res)
{
int err;
@@ -361,7 +366,8 @@
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->r_action == RTN_UNICAST &&
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)) {
+ FIB_RES_NH(*res).nh_scope == RT_SCOPE_HOST)) {
struct fib_table *tb;
if ((tb = fib_get_table(res->r->r_table)) != NULL)
if ((tb = fib_get_table(res->r->table)) != NULL)
tb->tb_select_default(tb, flp, res);
diff -Nur linux-2.6.17/net/ipv4/fib_semantics.c linux-2.6.17-owrt/net/ipv4/fib_semantics.c
--- linux-2.6.17/net/ipv4/fib_semantics.c 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/net/ipv4/fib_semantics.c 2006-06-18 16:53:21.000000000 +0200
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;
@@ -482,7 +485,7 @@ diff -Nur linux-2.6.17/net/ipv4/fib_semantics.c linux-2.6.17-owrt/net/ipv4/fib_s
}
#ifdef CONFIG_IP_ROUTE_MULTIPATH
@@ -509,8 +554,11 @@
@@ -508,8 +553,11 @@
return -EINVAL;
if ((dev = __dev_get_by_index(nh->nh_oif)) == NULL)
return -ENODEV;
@@ -496,7 +499,7 @@ diff -Nur linux-2.6.17/net/ipv4/fib_semantics.c linux-2.6.17-owrt/net/ipv4/fib_s
nh->nh_dev = dev;
dev_hold(dev);
nh->nh_scope = RT_SCOPE_LINK;
@@ -525,24 +573,48 @@
@@ -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;
@@ -561,7 +564,7 @@ diff -Nur linux-2.6.17/net/ipv4/fib_semantics.c linux-2.6.17-owrt/net/ipv4/fib_s
} else {
struct in_device *in_dev;
@@ -553,8 +625,11 @@
@@ -557,8 +629,11 @@
if (in_dev == NULL)
return -ENODEV;
if (!(in_dev->dev->flags&IFF_UP)) {
@@ -575,7 +578,7 @@ diff -Nur linux-2.6.17/net/ipv4/fib_semantics.c linux-2.6.17-owrt/net/ipv4/fib_s
}
nh->nh_dev = in_dev->dev;
dev_hold(nh->nh_dev);
@@ -892,8 +967,12 @@
@@ -881,8 +956,12 @@
for_nexthops(fi) {
if (nh->nh_flags&RTNH_F_DEAD)
continue;
@@ -590,7 +593,7 @@ diff -Nur linux-2.6.17/net/ipv4/fib_semantics.c linux-2.6.17-owrt/net/ipv4/fib_s
}
#ifdef CONFIG_IP_ROUTE_MULTIPATH
if (nhsel < fi->fib_nhs) {
@@ -1199,18 +1278,29 @@
@@ -1056,18 +1135,29 @@
prev_fi = fi;
dead = 0;
change_nexthops(fi) {
@@ -628,7 +631,7 @@ diff -Nur linux-2.6.17/net/ipv4/fib_semantics.c linux-2.6.17-owrt/net/ipv4/fib_s
}
#ifdef CONFIG_IP_ROUTE_MULTIPATH
if (force > 1 && nh->nh_dev == dev) {
@@ -1229,11 +1319,8 @@
@@ -1086,11 +1176,8 @@
return ret;
}
@@ -641,7 +644,7 @@ diff -Nur linux-2.6.17/net/ipv4/fib_semantics.c linux-2.6.17-owrt/net/ipv4/fib_s
*/
int fib_sync_up(struct net_device *dev)
@@ -1243,8 +1330,10 @@
@@ -1100,8 +1187,10 @@
struct hlist_head *head;
struct hlist_node *node;
struct fib_nh *nh;
@@ -653,7 +656,7 @@ diff -Nur linux-2.6.17/net/ipv4/fib_semantics.c linux-2.6.17-owrt/net/ipv4/fib_s
if (!(dev->flags&IFF_UP))
return 0;
@@ -1252,6 +1341,7 @@
@@ -1109,6 +1198,7 @@
hash = fib_devindex_hashfn(dev->ifindex);
head = &fib_info_devhash[hash];
ret = 0;
@@ -661,7 +664,7 @@ diff -Nur linux-2.6.17/net/ipv4/fib_semantics.c linux-2.6.17-owrt/net/ipv4/fib_s
hlist_for_each_entry(nh, node, head, nh_hash) {
struct fib_info *fi = nh->nh_parent;
@@ -1264,19 +1354,37 @@
@@ -1121,19 +1211,37 @@
prev_fi = fi;
alive = 0;
change_nexthops(fi) {
@@ -702,7 +705,7 @@ diff -Nur linux-2.6.17/net/ipv4/fib_semantics.c linux-2.6.17-owrt/net/ipv4/fib_s
} endfor_nexthops(fi)
if (alive > 0) {
@@ -1284,10 +1392,14 @@
@@ -1141,10 +1249,14 @@
ret++;
}
}
@@ -717,7 +720,7 @@ diff -Nur linux-2.6.17/net/ipv4/fib_semantics.c linux-2.6.17-owrt/net/ipv4/fib_s
/*
The algorithm is suboptimal, but it provides really
fair weighted route distribution.
@@ -1296,24 +1408,45 @@
@@ -1153,24 +1265,45 @@
void fib_select_multipath(const struct flowi *flp, struct fib_result *res)
{
struct fib_info *fi = res->fi;
@@ -771,7 +774,7 @@ diff -Nur linux-2.6.17/net/ipv4/fib_semantics.c linux-2.6.17-owrt/net/ipv4/fib_s
}
@@ -1323,20 +1456,40 @@
@@ -1180,20 +1313,40 @@
w = jiffies % fi->fib_power;
@@ -815,10 +818,10 @@ diff -Nur linux-2.6.17/net/ipv4/fib_semantics.c linux-2.6.17-owrt/net/ipv4/fib_s
spin_unlock_bh(&fib_multipath_lock);
}
#endif
diff -Nur linux-2.6.17/net/ipv4/netfilter/ip_nat_core.c linux-2.6.17-owrt/net/ipv4/netfilter/ip_nat_core.c
--- linux-2.6.17/net/ipv4/netfilter/ip_nat_core.c 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/net/ipv4/netfilter/ip_nat_core.c 2006-06-18 16:53:21.000000000 +0200
@@ -589,6 +589,53 @@
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
@@ -872,10 +875,10 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ip_nat_core.c linux-2.6.17-owrt/net/ip
static int __init ip_nat_init(void)
{
size_t i;
diff -Nur linux-2.6.17/net/ipv4/netfilter/ip_nat_standalone.c linux-2.6.17-owrt/net/ipv4/netfilter/ip_nat_standalone.c
--- linux-2.6.17/net/ipv4/netfilter/ip_nat_standalone.c 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/net/ipv4/netfilter/ip_nat_standalone.c 2006-06-18 17:12:03.000000000 +0200
@@ -334,6 +334,14 @@
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,
},
@@ -890,10 +893,10 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ip_nat_standalone.c linux-2.6.17-owrt/
/* After packet filtering, change source */
{
.hook = ip_nat_fn,
diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_MASQUERADE.c linux-2.6.17-owrt/net/ipv4/netfilter/ipt_MASQUERADE.c
--- linux-2.6.17/net/ipv4/netfilter/ipt_MASQUERADE.c 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/net/ipv4/netfilter/ipt_MASQUERADE.c 2006-06-18 16:53:21.000000000 +0200
@@ -88,13 +88,31 @@
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;
@@ -930,10 +933,10 @@ diff -Nur linux-2.6.17/net/ipv4/netfilter/ipt_MASQUERADE.c linux-2.6.17-owrt/net
write_lock_bh(&masq_lock);
ct->nat.masq_index = out->ifindex;
write_unlock_bh(&masq_lock);
diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
--- linux-2.6.17/net/ipv4/route.c 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/net/ipv4/route.c 2006-06-18 16:53:21.000000000 +0200
@@ -1195,6 +1195,7 @@
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 @@
/* Gateway is different ... */
rt->rt_gateway = new_gw;
@@ -941,7 +944,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
/* Redirect received -> path was valid */
dst_confirm(&rth->u.dst);
@@ -1626,6 +1627,7 @@
@@ -1647,6 +1648,7 @@
rth->fl.fl4_fwmark= skb->nfmark;
#endif
rth->fl.fl4_src = saddr;
@@ -949,7 +952,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
rth->rt_src = saddr;
#ifdef CONFIG_NET_CLS_ROUTE
rth->u.dst.tclassid = itag;
@@ -1636,6 +1638,7 @@
@@ -1657,6 +1659,7 @@
dev_hold(rth->u.dst.dev);
rth->idev = in_dev_get(rth->u.dst.dev);
rth->fl.oif = 0;
@@ -957,16 +960,16 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
rth->rt_gateway = daddr;
rth->rt_spec_dst= spec_dst;
rth->rt_type = RTN_MULTICAST;
@@ -1700,7 +1703,7 @@
@@ -1721,7 +1724,7 @@
struct fib_result* res,
struct in_device *in_dev,
u32 daddr, u32 saddr, u32 tos,
__be32 daddr, __be32 saddr, u32 tos,
- struct rtable **result)
+ u32 lsrc, struct rtable **result)
{
struct rtable *rth;
@@ -1733,6 +1736,7 @@
@@ -1755,6 +1758,7 @@
flags |= RTCF_DIRECTSRC;
if (out_dev == in_dev && err && !(flags & (RTCF_NAT | RTCF_MASQ)) &&
@@ -974,7 +977,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
(IN_DEV_SHARED_MEDIA(out_dev) ||
inet_addr_onlink(out_dev, saddr, FIB_RES_GW(*res))))
flags |= RTCF_DOREDIRECT;
@@ -1772,6 +1776,7 @@
@@ -1794,6 +1798,7 @@
#endif
rth->fl.fl4_src = saddr;
rth->rt_src = saddr;
@@ -982,7 +985,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
rth->rt_gateway = daddr;
rth->rt_iif =
rth->fl.iif = in_dev->dev->ifindex;
@@ -1779,6 +1784,7 @@
@@ -1801,6 +1806,7 @@
dev_hold(rth->u.dst.dev);
rth->idev = in_dev_get(rth->u.dst.dev);
rth->fl.oif = 0;
@@ -990,12 +993,13 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
rth->rt_spec_dst= spec_dst;
rth->u.dst.input = ip_forward;
@@ -1800,19 +1806,20 @@
@@ -1822,19 +1828,21 @@
struct fib_result* res,
const struct flowi *fl,
struct in_device *in_dev,
- u32 daddr, u32 saddr, u32 tos)
+ u32 daddr, u32 saddr, u32 tos, u32 lsrc)
- __be32 daddr, __be32 saddr, u32 tos)
+ __be32 daddr, __be32 saddr, u32 tos,
+ u32 lsrc)
{
struct rtable* rth = NULL;
int err;
@@ -1014,16 +1018,17 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
if (err)
return err;
@@ -1825,7 +1832,7 @@
@@ -1847,7 +1855,8 @@
struct fib_result* res,
const struct flowi *fl,
struct in_device *in_dev,
- u32 daddr, u32 saddr, u32 tos)
+ u32 daddr, u32 saddr, u32 tos, u32 lsrc)
- __be32 daddr, __be32 saddr, u32 tos)
+ __be32 daddr, __be32 saddr, u32 tos,
+ u32 lsrc)
{
#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
struct rtable* rth = NULL, *rtres;
@@ -1841,7 +1848,7 @@
@@ -1863,7 +1872,7 @@
/* distinguish between multipath and singlepath */
if (hopcount < 2)
return ip_mkroute_input_def(skb, res, fl, in_dev, daddr,
@@ -1032,7 +1037,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
/* add all alternatives to the routing cache */
for (hop = 0; hop < hopcount; hop++) {
@@ -1853,7 +1860,7 @@
@@ -1875,7 +1884,7 @@
/* create a routing cache entry */
err = __mkroute_input(skb, res, in_dev, daddr, saddr, tos,
@@ -1041,7 +1046,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
if (err)
return err;
@@ -1873,7 +1880,7 @@
@@ -1895,7 +1904,7 @@
skb->dst = &rtres->u.dst;
return err;
#else /* CONFIG_IP_ROUTE_MULTIPATH_CACHED */
@@ -1050,10 +1055,10 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
#endif /* CONFIG_IP_ROUTE_MULTIPATH_CACHED */
}
@@ -1889,20 +1896,20 @@
@@ -1911,20 +1920,20 @@
*/
static int ip_route_input_slow(struct sk_buff *skb, u32 daddr, u32 saddr,
static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
- u8 tos, struct net_device *dev)
+ u8 tos, struct net_device *dev, u32 lsrc)
{
@@ -1074,7 +1079,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
unsigned flags = 0;
u32 itag = 0;
struct rtable * rth;
@@ -1935,6 +1942,12 @@
@@ -1957,6 +1966,12 @@
if (BADCLASS(daddr) || ZERONET(daddr) || LOOPBACK(daddr))
goto martian_destination;
@@ -1087,7 +1092,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
/*
* Now we are ready to route packet.
*/
@@ -1944,6 +1957,10 @@
@@ -1966,6 +1981,10 @@
goto no_route;
}
free_res = 1;
@@ -1098,7 +1103,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
RT_CACHE_STAT_INC(in_slow_tot);
@@ -1968,7 +1985,7 @@
@@ -1990,7 +2009,7 @@
if (res.type != RTN_UNICAST)
goto martian_destination;
@@ -1107,7 +1112,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
if (err == -ENOBUFS)
goto e_nobufs;
if (err == -EINVAL)
@@ -1983,6 +2000,8 @@
@@ -2005,6 +2024,8 @@
brd_input:
if (skb->protocol != htons(ETH_P_IP))
goto e_inval;
@@ -1116,7 +1121,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
if (ZERONET(saddr))
spec_dst = inet_select_addr(dev, 0, RT_SCOPE_LINK);
@@ -2025,6 +2044,7 @@
@@ -2047,6 +2068,7 @@
rth->u.dst.dev = &loopback_dev;
dev_hold(rth->u.dst.dev);
rth->idev = in_dev_get(rth->u.dst.dev);
@@ -1124,19 +1129,19 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
rth->rt_gateway = daddr;
rth->rt_spec_dst= spec_dst;
rth->u.dst.input= ip_local_deliver;
@@ -2074,8 +2094,9 @@
@@ -2096,8 +2118,9 @@
goto e_inval;
}
-int ip_route_input(struct sk_buff *skb, u32 daddr, u32 saddr,
-int ip_route_input(struct sk_buff *skb, __be32 daddr, __be32 saddr,
- u8 tos, struct net_device *dev)
+static inline int
+ip_route_input_cached(struct sk_buff *skb, u32 daddr, u32 saddr,
+ u8 tos, struct net_device *dev, u32 lsrc)
+ip_route_input_cached(struct sk_buff *skb, __be32 daddr, __be32 saddr,
+ u8 tos, struct net_device *dev, u32 lsrc)
{
struct rtable * rth;
unsigned hash;
@@ -2090,6 +2111,7 @@
@@ -2112,6 +2135,7 @@
if (rth->fl.fl4_dst == daddr &&
rth->fl.fl4_src == saddr &&
rth->fl.iif == iif &&
@@ -1144,7 +1149,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
rth->fl.oif == 0 &&
#ifdef CONFIG_IP_ROUTE_FWMARK
rth->fl.fl4_fwmark == skb->nfmark &&
@@ -2138,7 +2160,19 @@
@@ -2160,7 +2184,19 @@
rcu_read_unlock();
return -EINVAL;
}
@@ -1165,7 +1170,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
}
static inline int __mkroute_output(struct rtable **result,
@@ -2217,6 +2251,7 @@
@@ -2239,6 +2275,7 @@
rth->fl.fl4_tos = tos;
rth->fl.fl4_src = oldflp->fl4_src;
rth->fl.oif = oldflp->oif;
@@ -1173,7 +1178,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
#ifdef CONFIG_IP_ROUTE_FWMARK
rth->fl.fl4_fwmark= oldflp->fl4_fwmark;
#endif
@@ -2361,6 +2396,7 @@
@@ -2381,6 +2418,7 @@
struct flowi fl = { .nl_u = { .ip4_u =
{ .daddr = oldflp->fl4_dst,
.saddr = oldflp->fl4_src,
@@ -1181,7 +1186,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
.tos = tos & IPTOS_RT_MASK,
.scope = ((tos & RTO_ONLINK) ?
RT_SCOPE_LINK :
@@ -2466,6 +2502,7 @@
@@ -2486,6 +2524,7 @@
dev_out = &loopback_dev;
dev_hold(dev_out);
fl.oif = loopback_dev.ifindex;
@@ -1189,7 +1194,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
res.type = RTN_LOCAL;
flags |= RTCF_LOCAL;
goto make_route;
@@ -2473,7 +2510,7 @@
@@ -2493,7 +2532,7 @@
if (fib_lookup(&fl, &res)) {
res.fi = NULL;
@@ -1198,7 +1203,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
/* Apparently, routing tables are wrong. Assume,
that the destination is on link.
@@ -2513,6 +2550,7 @@
@@ -2533,6 +2572,7 @@
dev_out = &loopback_dev;
dev_hold(dev_out);
fl.oif = dev_out->ifindex;
@@ -1206,7 +1211,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
if (res.fi)
fib_info_put(res.fi);
res.fi = NULL;
@@ -2520,13 +2558,12 @@
@@ -2540,13 +2580,12 @@
goto make_route;
}
@@ -1223,7 +1228,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
if (!fl.fl4_src)
fl.fl4_src = FIB_RES_PREFSRC(res);
@@ -2563,6 +2600,7 @@
@@ -2583,6 +2622,7 @@
rth->fl.fl4_src == flp->fl4_src &&
rth->fl.iif == 0 &&
rth->fl.oif == flp->oif &&
@@ -1231,7 +1236,7 @@ diff -Nur linux-2.6.17/net/ipv4/route.c linux-2.6.17-owrt/net/ipv4/route.c
#ifdef CONFIG_IP_ROUTE_FWMARK
rth->fl.fl4_fwmark == flp->fl4_fwmark &&
#endif
@@ -3199,3 +3237,4 @@
@@ -3221,3 +3261,4 @@
EXPORT_SYMBOL(__ip_select_ident);
EXPORT_SYMBOL(ip_route_input);
EXPORT_SYMBOL(ip_route_output_key);

View File

@@ -1,6 +1,7 @@
--- linux-2.6.17/arch/mips/Makefile 2006-06-19 15:12:09.000000000 -0700
+++ linux-2.6.17/arch/mips/Makefile 2006-06-19 15:11:59.000000000 -0700
@@ -602,6 +602,9 @@
diff -urN linux-2.6.19.old/arch/mips/Makefile linux-2.6.19.dev/arch/mips/Makefile
--- linux-2.6.19.old/arch/mips/Makefile 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/arch/mips/Makefile 2006-12-14 03:13:55.000000000 +0100
@@ -600,6 +600,9 @@
core-$(CONFIG_TOSHIBA_RBTX4938) += arch/mips/tx4938/common/
load-$(CONFIG_TOSHIBA_RBTX4938) += 0xffffffff80100000

View File

@@ -1,13 +0,0 @@
diff -Nurb linux-2.6.17/usr/Makefile linux-2.6.17/usr/Makefile
--- linux-2.6.17/usr/Makefile 2006-06-20 11:51:27.000000000 -0700
+++ linux-2.6.17/usr/Makefile 2006-06-20 11:51:34.000000000 -0700
@@ -21,8 +21,7 @@
$(CONFIG_INITRAMFS_SOURCE),-d)
ramfs-args := \
$(if $(CONFIG_INITRAMFS_ROOT_UID), -u $(CONFIG_INITRAMFS_ROOT_UID)) \
- $(if $(CONFIG_INITRAMFS_ROOT_GID), -g $(CONFIG_INITRAMFS_ROOT_GID)) \
- $(ramfs-input)
+ $(if $(CONFIG_INITRAMFS_ROOT_GID), -g $(CONFIG_INITRAMFS_ROOT_GID))
# .initramfs_data.cpio.gz.d is used to identify all files included
# in initramfs and to detect if any files are added/removed.

View File

@@ -1,6 +1,6 @@
diff -urN linux.old/fs/jffs2/build.c linux.dev/fs/jffs2/build.c
--- linux.old/fs/jffs2/build.c 2006-06-18 03:49:35.000000000 +0200
+++ linux.dev/fs/jffs2/build.c 2006-06-23 21:46:48.000000000 +0200
diff -urN linux-2.6.19.old/fs/jffs2/build.c linux-2.6.19.dev/fs/jffs2/build.c
--- linux-2.6.19.old/fs/jffs2/build.c 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/fs/jffs2/build.c 2006-12-14 03:13:57.000000000 +0100
@@ -107,6 +107,17 @@
dbg_fsbuild("scanned flash completely\n");
jffs2_dbg_dump_block_lists_nolock(c);
@@ -19,10 +19,10 @@ diff -urN linux.old/fs/jffs2/build.c linux.dev/fs/jffs2/build.c
dbg_fsbuild("pass 1 starting\n");
c->flags |= JFFS2_SB_FLAG_BUILDING;
/* Now scan the directory tree, increasing nlink according to every dirent found. */
diff -urN linux.old/fs/jffs2/scan.c linux.dev/fs/jffs2/scan.c
--- linux.old/fs/jffs2/scan.c 2006-06-23 21:39:38.000000000 +0200
+++ linux.dev/fs/jffs2/scan.c 2006-06-23 21:42:18.000000000 +0200
@@ -119,9 +119,12 @@
diff -urN linux-2.6.19.old/fs/jffs2/scan.c linux-2.6.19.dev/fs/jffs2/scan.c
--- linux-2.6.19.old/fs/jffs2/scan.c 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/fs/jffs2/scan.c 2006-12-14 03:13:57.000000000 +0100
@@ -141,9 +141,12 @@
/* reset summary info for next eraseblock scan */
jffs2_sum_reset_collected(s);
@@ -38,7 +38,7 @@ diff -urN linux.old/fs/jffs2/scan.c linux.dev/fs/jffs2/scan.c
if (ret < 0)
goto out;
@@ -389,6 +392,17 @@
@@ -540,6 +543,17 @@
return err;
}

View File

@@ -1,235 +0,0 @@
diff -urN linux.old/drivers/mtd/devices/block2mtd.c linux.dev/drivers/mtd/devices/block2mtd.c
--- linux.old/drivers/mtd/devices/block2mtd.c 2006-07-29 19:53:54.000000000 +0200
+++ linux.dev/drivers/mtd/devices/block2mtd.c 2006-07-29 19:47:03.000000000 +0200
@@ -4,11 +4,10 @@
* block2mtd.c - create an mtd from a block device
*
* Copyright (C) 2001,2002 Simon Evans <spse@secret.org.uk>
- * Copyright (C) 2004,2005 J<>rn Engel <joern@wh.fh-wedel.de>
+ * Copyright (C) 2004-2006 Jörn Engel <joern@wh.fh-wedel.de>
*
* Licence: GPL
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/blkdev.h>
@@ -19,6 +18,7 @@ #include <linux/init.h>
#include <linux/mtd/mtd.h>
#include <linux/buffer_head.h>
#include <linux/mutex.h>
+#include <linux/mount.h>
#define VERSION "$Revision: 1.30 $"
@@ -62,10 +61,8 @@
read_lock_irq(&mapping->tree_lock);
for (i = 0; i < PAGE_READAHEAD; i++) {
pagei = index + i;
- if (pagei > end_index) {
- INFO("Overrun end of disk in cache readahead\n");
+ if (pagei > end_index)
break;
- }
page = radix_tree_lookup(&mapping->page_tree, pagei);
if (page && (!i))
break;
@@ -237,6 +237,8 @@ static int _block2mtd_write(struct block
}
return 0;
}
+
+
static int block2mtd_write(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const u_char *buf)
{
@@ -300,6 +302,19 @@ static struct block2mtd_dev *add_device(
/* Get a handle on the device */
bdev = open_bdev_excl(devname, O_RDWR, NULL);
+#ifndef MODULE
+ if (IS_ERR(bdev)) {
+
+ /* We might not have rootfs mounted at this point. Try
+ to resolve the device name by other means. */
+
+ dev_t dev = name_to_dev_t(devname);
+ if (dev != 0) {
+ bdev = open_by_devnum(dev, FMODE_WRITE | FMODE_READ);
+ }
+ }
+#endif
+
if (IS_ERR(bdev)) {
ERROR("error: cannot open device %s", devname);
goto devinit_err;
@@ -331,7 +347,6 @@ static struct block2mtd_dev *add_device(
dev->mtd.writev = default_mtd_writev;
dev->mtd.sync = block2mtd_sync;
dev->mtd.read = block2mtd_read;
- dev->mtd.readv = default_mtd_readv;
dev->mtd.priv = dev;
dev->mtd.owner = THIS_MODULE;
@@ -351,6 +366,12 @@ devinit_err:
}
+/* This function works similar to reguler strtoul. In addition, it
+ * allows some suffixes for a more human-readable number format:
+ * ki, Ki, kiB, KiB - multiply result with 1024
+ * Mi, MiB - multiply result with 1024^2
+ * Gi, GiB - multiply result with 1024^3
+ */
static int ustrtoul(const char *cp, char **endp, unsigned int base)
{
unsigned long result = simple_strtoul(cp, endp, base);
@@ -359,11 +380,16 @@ static int ustrtoul(const char *cp, char
result *= 1024;
case 'M':
result *= 1024;
+ case 'K':
case 'k':
result *= 1024;
/* By dwmw2 editorial decree, "ki", "Mi" or "Gi" are to be used. */
- if ((*endp)[1] == 'i')
- (*endp) += 2;
+ if ((*endp)[1] == 'i') {
+ if ((*endp)[2] == 'B')
+ (*endp) += 3;
+ else
+ (*endp) += 2;
+ }
}
return result;
}
@@ -383,26 +409,6 @@ static int parse_num(size_t *num, const
}
-static int parse_name(char **pname, const char *token, size_t limit)
-{
- size_t len;
- char *name;
-
- len = strlen(token) + 1;
- if (len > limit)
- return -ENOSPC;
-
- name = kmalloc(len, GFP_KERNEL);
- if (!name)
- return -ENOMEM;
-
- strcpy(name, token);
-
- *pname = name;
- return 0;
-}
-
-
static inline void kill_final_newline(char *str)
{
char *newline = strrchr(str, '\n');
@@ -416,9 +422,16 @@ #define parse_err(fmt, args...) do { \
return 0; \
} while (0)
-static int block2mtd_setup(const char *val, struct kernel_param *kp)
+#ifndef MODULE
+static int block2mtd_init_called = 0;
+static __initdata char block2mtd_paramline[80 + 12]; /* 80 for device, 12 for erase size */
+#endif
+
+
+static int block2mtd_setup2(const char *val)
{
- char buf[80+12], *str=buf; /* 80 for device, 12 for erase size */
+ char buf[80 + 12]; /* 80 for device, 12 for erase size */
+ char *str = buf;
char *token[2];
char *name;
size_t erase_size = PAGE_SIZE;
@@ -430,7 +443,7 @@ static int block2mtd_setup(const char *v
strcpy(str, val);
kill_final_newline(str);
- for (i=0; i<2; i++)
+ for (i = 0; i < 2; i++)
token[i] = strsep(&str, ",");
if (str)
@@ -439,18 +452,16 @@ static int block2mtd_setup(const char *v
if (!token[0])
parse_err("no argument");
- ret = parse_name(&name, token[0], 80);
- if (ret == -ENOMEM)
- parse_err("out of memory");
- if (ret == -ENOSPC)
- parse_err("name too long");
- if (ret)
- return 0;
+ name = token[0];
+ if (strlen(name) + 1 > 80)
+ parse_err("device name too long");
if (token[1]) {
ret = parse_num(&erase_size, token[1]);
- if (ret)
+ if (ret) {
+ kfree(name);
parse_err("illegal erase size");
+ }
}
add_device(name, erase_size);
@@ -459,13 +470,48 @@ static int block2mtd_setup(const char *v
}
+static int block2mtd_setup(const char *val, struct kernel_param *kp)
+{
+#ifdef MODULE
+ return block2mtd_setup2(val);
+#else
+ /* If more parameters are later passed in via
+ /sys/module/block2mtd/parameters/block2mtd
+ and block2mtd_init() has already been called,
+ we can parse the argument now. */
+
+ if (block2mtd_init_called)
+ return block2mtd_setup2(val);
+
+ /* During early boot stage, we only save the parameters
+ here. We must parse them later: if the param passed
+ from kernel boot command line, block2mtd_setup() is
+ called so early that it is not possible to resolve
+ the device (even kmalloc() fails). Deter that work to
+ block2mtd_setup2(). */
+
+ strlcpy(block2mtd_paramline, val, sizeof(block2mtd_paramline));
+
+ return 0;
+#endif
+}
+
+
module_param_call(block2mtd, block2mtd_setup, NULL, NULL, 0200);
MODULE_PARM_DESC(block2mtd, "Device to use. \"block2mtd=<dev>[,<erasesize>]\"");
static int __init block2mtd_init(void)
{
+ int ret = 0;
INFO("version " VERSION);
- return 0;
+
+#ifndef MODULE
+ if (strlen(block2mtd_paramline))
+ ret = block2mtd_setup2(block2mtd_paramline);
+ block2mtd_init_called = 1;
+#endif
+
+ return ret;
}

View File

@@ -1,12 +0,0 @@
--- linux-2.6.17/drivers/net/pppoe.c.old 2006-10-10 13:47:56.000000000 +0200
+++ linux-2.6.17/drivers/net/pppoe.c 2006-10-10 13:52:02.000000000 +0200
@@ -600,6 +600,9 @@
po->chan.hdrlen = (sizeof(struct pppoe_hdr) +
dev->hard_header_len);
+ if (po->chan.mtu > dev->mtu - sizeof(struct pppoe_hdr))
+ po->chan.mtu = dev->mtu - sizeof(struct pppoe_hdr);
+
po->chan.private = sk;
po->chan.ops = &pppoe_chan_ops;

View File

@@ -1,6 +1,6 @@
diff -ruN linux-2.6.17-orig/include/asm-powerpc/segment.h linux-2.6.17/include/asm-powerpc/segment.h
--- linux-2.6.17-orig/include/asm-powerpc/segment.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.17/include/asm-powerpc/segment.h 2006-06-18 03:49:35.000000000 +0200
diff -urN linux-2.6.19.old/include/asm-powerpc/segment.h linux-2.6.19.dev/include/asm-powerpc/segment.h
--- linux-2.6.19.old/include/asm-powerpc/segment.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/include/asm-powerpc/segment.h 2006-12-14 03:13:59.000000000 +0100
@@ -0,0 +1,6 @@
+#ifndef _ASM_SEGMENT_H
+#define _ASM_SEGMENT_H

View File

@@ -1,7 +1,7 @@
diff -Nur linux-2.6.17/drivers/net/r8169.c linux-2.6.17-owrt/drivers/net/r8169.c
--- linux-2.6.17/drivers/net/r8169.c 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/drivers/net/r8169.c 2006-10-27 13:18:46.000000000 +0200
@@ -483,7 +483,7 @@
diff -urN linux-2.6.19.old/drivers/net/r8169.c linux-2.6.19.dev/drivers/net/r8169.c
--- linux-2.6.19.old/drivers/net/r8169.c 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/drivers/net/r8169.c 2006-12-14 03:14:01.000000000 +0100
@@ -491,7 +491,7 @@
#endif
static const u16 rtl8169_intr_mask =
@@ -10,17 +10,7 @@ diff -Nur linux-2.6.17/drivers/net/r8169.c linux-2.6.17-owrt/drivers/net/r8169.c
static const u16 rtl8169_napi_event =
RxOK | RxOverflow | RxFIFOOver | TxOK | TxErr;
static const unsigned int rtl8169_rx_config =
@@ -1832,8 +1832,8 @@
*/
RTL_W16(IntrMitigate, 0x0000);
- RTL_W32(TxDescStartAddrLow, ((u64) tp->TxPhyAddr & DMA_32BIT_MASK));
RTL_W32(TxDescStartAddrHigh, ((u64) tp->TxPhyAddr >> 32));
+ RTL_W32(TxDescStartAddrLow, ((u64) tp->TxPhyAddr & DMA_32BIT_MASK));
RTL_W32(RxDescAddrLow, ((u64) tp->RxPhyAddr & DMA_32BIT_MASK));
RTL_W32(RxDescAddrHigh, ((u64) tp->RxPhyAddr >> 32));
RTL_W8(Cfg9346, Cfg9346_Lock);
@@ -2535,10 +2535,12 @@
@@ -2584,10 +2584,12 @@
if (!(status & rtl8169_intr_mask))
break;

View File

@@ -1,9 +1,9 @@
diff -urN linux.old/fs/Kconfig linux.dev/fs/Kconfig
--- linux.old/fs/Kconfig 2006-11-17 03:10:00.000000000 +0100
+++ linux.dev/fs/Kconfig 2006-11-17 03:12:36.000000000 +0100
@@ -356,6 +356,9 @@
- POSIX ACLs
- readpages / writepages (not user visible)
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:20.000000000 +0100
+++ linux-2.6.19.dev/fs/Kconfig 2006-12-14 03:14:03.000000000 +0100
@@ -468,6 +468,9 @@
This option will enlarge your kernel, but it allows debugging of
ocfs2 filesystem issues.
+config MINI_FO
+ tristate "Mini fanout overlay filesystem"
@@ -11,10 +11,10 @@ diff -urN linux.old/fs/Kconfig linux.dev/fs/Kconfig
config MINIX_FS
tristate "Minix fs support"
help
diff -urN linux.old/fs/Makefile linux.dev/fs/Makefile
--- linux.old/fs/Makefile 2006-11-17 03:10:00.000000000 +0100
+++ linux.dev/fs/Makefile 2006-11-17 03:13:05.000000000 +0100
@@ -60,6 +60,7 @@
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:20.000000000 +0100
+++ linux-2.6.19.dev/fs/Makefile 2006-12-14 03:14:03.000000000 +0100
@@ -71,6 +71,7 @@
obj-$(CONFIG_RAMFS) += ramfs/
obj-$(CONFIG_HUGETLBFS) += hugetlbfs/
obj-$(CONFIG_CODA_FS) += coda/
@@ -22,9 +22,9 @@ diff -urN linux.old/fs/Makefile linux.dev/fs/Makefile
obj-$(CONFIG_MINIX_FS) += minix/
obj-$(CONFIG_FAT_FS) += fat/
obj-$(CONFIG_MSDOS_FS) += msdos/
diff -urN linux.old/fs/mini_fo/aux.c linux.dev/fs/mini_fo/aux.c
--- linux.old/fs/mini_fo/aux.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/fs/mini_fo/aux.c 2006-11-17 03:11:48.000000000 +0100
diff -urN linux-2.6.19.old/fs/mini_fo/aux.c linux-2.6.19.dev/fs/mini_fo/aux.c
--- linux-2.6.19.old/fs/mini_fo/aux.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/mini_fo/aux.c 2006-12-14 03:14:03.000000000 +0100
@@ -0,0 +1,580 @@
+/*
+ * Copyright (c) 1997-2003 Erez Zadok
@@ -606,9 +606,9 @@ diff -urN linux.old/fs/mini_fo/aux.c linux.dev/fs/mini_fo/aux.c
+
+#endif /* unused */
+
diff -urN linux.old/fs/mini_fo/ChangeLog linux.dev/fs/mini_fo/ChangeLog
--- linux.old/fs/mini_fo/ChangeLog 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/fs/mini_fo/ChangeLog 2006-11-17 03:11:48.000000000 +0100
diff -urN linux-2.6.19.old/fs/mini_fo/ChangeLog linux-2.6.19.dev/fs/mini_fo/ChangeLog
--- linux-2.6.19.old/fs/mini_fo/ChangeLog 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/mini_fo/ChangeLog 2006-12-14 03:14:03.000000000 +0100
@@ -0,0 +1,281 @@
+2006-01-24 Markus Klotzbuecher <mk@mary.denx.de>
+
@@ -891,9 +891,9 @@ diff -urN linux.old/fs/mini_fo/ChangeLog linux.dev/fs/mini_fo/ChangeLog
+ * Implementation of mini_fo_mknod and mini_fo_rename, support
+ for device files.
+
diff -urN linux.old/fs/mini_fo/dentry.c linux.dev/fs/mini_fo/dentry.c
--- linux.old/fs/mini_fo/dentry.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/fs/mini_fo/dentry.c 2006-11-17 03:11:48.000000000 +0100
diff -urN linux-2.6.19.old/fs/mini_fo/dentry.c linux-2.6.19.dev/fs/mini_fo/dentry.c
--- linux-2.6.19.old/fs/mini_fo/dentry.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/mini_fo/dentry.c 2006-12-14 03:14:03.000000000 +0100
@@ -0,0 +1,244 @@
+/*
+ * Copyright (c) 1997-2003 Erez Zadok
@@ -1139,10 +1139,10 @@ diff -urN linux.old/fs/mini_fo/dentry.c linux.dev/fs/mini_fo/dentry.c
+ d_delete: mini_fo_d_delete,
+ d_iput: mini_fo_d_iput,
+};
diff -urN linux.old/fs/mini_fo/file.c linux.dev/fs/mini_fo/file.c
--- linux.old/fs/mini_fo/file.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/fs/mini_fo/file.c 2006-11-17 03:11:48.000000000 +0100
@@ -0,0 +1,690 @@
diff -urN linux-2.6.19.old/fs/mini_fo/file.c linux-2.6.19.dev/fs/mini_fo/file.c
--- linux-2.6.19.old/fs/mini_fo/file.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/mini_fo/file.c 2006-12-14 03:14:03.000000000 +0100
@@ -0,0 +1,713 @@
+/*
+ * Copyright (c) 1997-2003 Erez Zadok
+ * Copyright (c) 2001-2003 Stony Brook University
@@ -1382,12 +1382,15 @@ diff -urN linux.old/fs/mini_fo/file.c linux.dev/fs/mini_fo/file.c
+
+/* mainly copied from fs/readdir.c */
+STATIC int
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+mini_fo_filldir(void * __buf, const char * name, int namlen, loff_t offset,
+ u64 ino, unsigned int d_type)
+#else
+mini_fo_filldir(void * __buf, const char * name, int namlen, loff_t offset,
+ ino_t ino, unsigned int d_type)
+#endif
+{
+ struct linux_dirent *dirent, d;
+ struct getdents_callback * buf = (struct getdents_callback *) __buf;
+ int reclen;
+ file_t* file = mini_fo_filldir_file;
+
+ /* In theses states we filter meta files in storage (WOL) */
@@ -1640,7 +1643,11 @@ diff -urN linux.old/fs/mini_fo/file.c linux.dev/fs/mini_fo/file.c
+ /* If the base file has been opened, we need to close it here */
+ if(ftohf(file)) {
+ if (hidden_file->f_op && hidden_file->f_op->flush)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+ hidden_file->f_op->flush(hidden_file, NULL);
+#else
+ hidden_file->f_op->flush(hidden_file);
+#endif
+ dput(hidden_dentry);
+ }
+ goto out;
@@ -1658,7 +1665,11 @@ diff -urN linux.old/fs/mini_fo/file.c linux.dev/fs/mini_fo/file.c
+ /* close base file if open */
+ if(ftohf(file)) {
+ if (hidden_file->f_op && hidden_file->f_op->flush)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+ hidden_file->f_op->flush(hidden_file, NULL);
+#else
+ hidden_file->f_op->flush(hidden_file);
+#endif
+ dput(hidden_dentry);
+ }
+ goto out;
@@ -1673,7 +1684,11 @@ diff -urN linux.old/fs/mini_fo/file.c linux.dev/fs/mini_fo/file.c
+}
+
+STATIC int
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+mini_fo_flush(file_t *file, fl_owner_t id)
+#else
+mini_fo_flush(file_t *file)
+#endif
+{
+ int err1 = 0; /* assume ok (see open.c:close_fp) */
+ int err2 = 0;
@@ -1688,12 +1703,20 @@ diff -urN linux.old/fs/mini_fo/file.c linux.dev/fs/mini_fo/file.c
+ if(ftohf(file) != NULL) {
+ hidden_file = ftohf(file);
+ if (hidden_file->f_op && hidden_file->f_op->flush)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+ err1 = hidden_file->f_op->flush(hidden_file, id);
+#else
+ err1 = hidden_file->f_op->flush(hidden_file);
+#endif
+ }
+ if(ftohf2(file) != NULL) {
+ hidden_file = ftohf2(file);
+ if (hidden_file->f_op && hidden_file->f_op->flush)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+ err2 = hidden_file->f_op->flush(hidden_file, id);
+#else
+ err2 = hidden_file->f_op->flush(hidden_file);
+#endif
+ }
+ }
+ return (err1 | err2);
@@ -1833,10 +1856,10 @@ diff -urN linux.old/fs/mini_fo/file.c linux.dev/fs/mini_fo/file.c
+ /* not implemented: sendpage */
+ /* not implemented: get_unmapped_area */
+ };
diff -urN linux.old/fs/mini_fo/fist.h linux.dev/fs/mini_fo/fist.h
--- linux.old/fs/mini_fo/fist.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/fs/mini_fo/fist.h 2006-11-17 03:11:48.000000000 +0100
@@ -0,0 +1,248 @@
diff -urN linux-2.6.19.old/fs/mini_fo/fist.h linux-2.6.19.dev/fs/mini_fo/fist.h
--- linux-2.6.19.old/fs/mini_fo/fist.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/mini_fo/fist.h 2006-12-14 03:14:03.000000000 +0100
@@ -0,0 +1,252 @@
+/*
+ * Copyright (c) 1997-2003 Erez Zadok
+ * Copyright (c) 2001-2003 Stony Brook University
@@ -1868,8 +1891,12 @@ diff -urN linux.old/fs/mini_fo/fist.h linux.dev/fs/mini_fo/fist.h
+ * KERNEL ONLY CODE:
+ */
+#ifdef __KERNEL__
+#include <linux/config.h>
+#include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
+#include <linux/autoconf.h>
+#else
+#include <linux/config.h>
+#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+#ifdef CONFIG_MODVERSIONS
+# define MODVERSIONS
@@ -2085,9 +2112,9 @@ diff -urN linux.old/fs/mini_fo/fist.h linux.dev/fs/mini_fo/fist.h
+# define FIST_IOCTL_SET_DEBUG_VALUE _IOW(0x15, 2, int)
+
+#endif /* not __FIST_H_ */
diff -urN linux.old/fs/mini_fo/inode.c linux.dev/fs/mini_fo/inode.c
--- linux.old/fs/mini_fo/inode.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/fs/mini_fo/inode.c 2006-11-17 03:11:48.000000000 +0100
diff -urN linux-2.6.19.old/fs/mini_fo/inode.c linux-2.6.19.dev/fs/mini_fo/inode.c
--- linux-2.6.19.old/fs/mini_fo/inode.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/mini_fo/inode.c 2006-12-14 03:14:03.000000000 +0100
@@ -0,0 +1,1573 @@
+/*
+ * Copyright (c) 1997-2003 Erez Zadok
@@ -3662,10 +3689,10 @@ diff -urN linux.old/fs/mini_fo/inode.c linux.dev/fs/mini_fo/inode.c
+ removexattr: mini_fo_removexattr
+# endif /* XATTR && LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,20) */
+ };
diff -urN linux.old/fs/mini_fo/main.c linux.dev/fs/mini_fo/main.c
--- linux.old/fs/mini_fo/main.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/fs/mini_fo/main.c 2006-11-17 03:11:48.000000000 +0100
@@ -0,0 +1,414 @@
diff -urN linux-2.6.19.old/fs/mini_fo/main.c linux-2.6.19.dev/fs/mini_fo/main.c
--- linux-2.6.19.old/fs/mini_fo/main.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/mini_fo/main.c 2006-12-14 03:14:03.000000000 +0100
@@ -0,0 +1,423 @@
+/*
+ * Copyright (c) 1997-2003 Erez Zadok
+ * Copyright (c) 2001-2003 Stony Brook University
@@ -4023,12 +4050,21 @@ diff -urN linux.old/fs/mini_fo/main.c linux.dev/fs/mini_fo/main.c
+}
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+static int mini_fo_get_sb(struct file_system_type *fs_type,
+ int flags, const char *dev_name,
+ void *raw_data, struct vfsmount *mnt)
+{
+ return get_sb_nodev(fs_type, flags, raw_data, mini_fo_read_super, mnt);
+}
+#else
+static struct super_block *mini_fo_get_sb(struct file_system_type *fs_type,
+ int flags, const char *dev_name,
+ void *raw_data)
+{
+ return get_sb_nodev(fs_type, flags, raw_data, mini_fo_read_super);
+}
+#endif
+
+void mini_fo_kill_block_super(struct super_block *sb)
+{
@@ -4080,9 +4116,9 @@ diff -urN linux.old/fs/mini_fo/main.c linux.dev/fs/mini_fo/main.c
+
+module_init(init_mini_fo_fs)
+module_exit(exit_mini_fo_fs)
diff -urN linux.old/fs/mini_fo/Makefile linux.dev/fs/mini_fo/Makefile
--- linux.old/fs/mini_fo/Makefile 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/fs/mini_fo/Makefile 2006-11-17 03:11:48.000000000 +0100
diff -urN linux-2.6.19.old/fs/mini_fo/Makefile linux-2.6.19.dev/fs/mini_fo/Makefile
--- linux-2.6.19.old/fs/mini_fo/Makefile 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/mini_fo/Makefile 2006-12-14 03:14:03.000000000 +0100
@@ -0,0 +1,17 @@
+#
+# Makefile for mini_fo 2.4 and 2.6 Linux kernels
@@ -4101,9 +4137,9 @@ diff -urN linux.old/fs/mini_fo/Makefile linux.dev/fs/mini_fo/Makefile
+# dependencies
+${mini_fo-objs}: mini_fo.h fist.h
+
diff -urN linux.old/fs/mini_fo/meta.c linux.dev/fs/mini_fo/meta.c
--- linux.old/fs/mini_fo/meta.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/fs/mini_fo/meta.c 2006-11-17 03:11:48.000000000 +0100
diff -urN linux-2.6.19.old/fs/mini_fo/meta.c linux-2.6.19.dev/fs/mini_fo/meta.c
--- linux-2.6.19.old/fs/mini_fo/meta.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/mini_fo/meta.c 2006-12-14 03:14:03.000000000 +0100
@@ -0,0 +1,1000 @@
+/*
+ * Copyright (C) 2004, 2005 Markus Klotzbuecher <mk@creamnet.de>
@@ -5105,10 +5141,10 @@ diff -urN linux.old/fs/mini_fo/meta.c linux.dev/fs/mini_fo/meta.c
+ return 0;
+}
+
diff -urN linux.old/fs/mini_fo/mini_fo.h linux.dev/fs/mini_fo/mini_fo.h
--- linux.old/fs/mini_fo/mini_fo.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/fs/mini_fo/mini_fo.h 2006-11-17 03:11:48.000000000 +0100
@@ -0,0 +1,503 @@
diff -urN linux-2.6.19.old/fs/mini_fo/mini_fo.h linux-2.6.19.dev/fs/mini_fo/mini_fo.h
--- linux-2.6.19.old/fs/mini_fo/mini_fo.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/mini_fo/mini_fo.h 2006-12-14 03:14:03.000000000 +0100
@@ -0,0 +1,510 @@
+/*
+ * Copyright (c) 1997-2003 Erez Zadok
+ * Copyright (c) 2001-2003 Stony Brook University
@@ -5308,8 +5344,13 @@ diff -urN linux.old/fs/mini_fo/mini_fo.h linux.dev/fs/mini_fo/mini_fo.h
+# define ftohf2(file) ((ftopd(file))->wfi_file2)
+
+/* inode TO private_data */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+# define itopd(ino) ((struct mini_fo_inode_info *)(ino)->i_private)
+# define __itopd(ino) ((ino)->i_private)
+#else
+# define itopd(ino) ((struct mini_fo_inode_info *)(ino)->u.generic_ip)
+# define __itopd(ino) ((ino)->u.generic_ip)
+#endif
+/* inode TO hidden_inode */
+# define itohi(ino) (itopd(ino)->wii_inode)
+# define itohi2(ino) (itopd(ino)->wii_inode2)
@@ -5530,7 +5571,9 @@ diff -urN linux.old/fs/mini_fo/mini_fo.h linux.dev/fs/mini_fo/mini_fo.h
+ dest->i_atime = src->i_atime;
+ dest->i_mtime = src->i_mtime;
+ dest->i_ctime = src->i_ctime;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
+ dest->i_blksize = src->i_blksize;
+#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,12)
+ dest->i_blkbits = src->i_blkbits;
+# endif /* linux 2.4.12 and newer */
@@ -5612,9 +5655,9 @@ diff -urN linux.old/fs/mini_fo/mini_fo.h linux.dev/fs/mini_fo/mini_fo.h
+/* ioctls */
+
+#endif /* not __MINI_FO_H_ */
diff -urN linux.old/fs/mini_fo/mini_fo-merge linux.dev/fs/mini_fo/mini_fo-merge
--- linux.old/fs/mini_fo/mini_fo-merge 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/fs/mini_fo/mini_fo-merge 2006-11-17 03:11:48.000000000 +0100
diff -urN linux-2.6.19.old/fs/mini_fo/mini_fo-merge linux-2.6.19.dev/fs/mini_fo/mini_fo-merge
--- linux-2.6.19.old/fs/mini_fo/mini_fo-merge 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/mini_fo/mini_fo-merge 2006-12-14 03:14:03.000000000 +0100
@@ -0,0 +1,180 @@
+#!/bin/bash
+#
@@ -5796,9 +5839,9 @@ diff -urN linux.old/fs/mini_fo/mini_fo-merge linux.dev/fs/mini_fo/mini_fo-merge
+#rm $TMP/$SKIP_DEL_LIST
+
+echo "Done!"
diff -urN linux.old/fs/mini_fo/mini_fo-overlay linux.dev/fs/mini_fo/mini_fo-overlay
--- linux.old/fs/mini_fo/mini_fo-overlay 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/fs/mini_fo/mini_fo-overlay 2006-11-17 03:11:48.000000000 +0100
diff -urN linux-2.6.19.old/fs/mini_fo/mini_fo-overlay linux-2.6.19.dev/fs/mini_fo/mini_fo-overlay
--- linux-2.6.19.old/fs/mini_fo/mini_fo-overlay 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/mini_fo/mini_fo-overlay 2006-12-14 03:14:03.000000000 +0100
@@ -0,0 +1,130 @@
+#!/bin/bash
+#
@@ -5930,9 +5973,9 @@ diff -urN linux.old/fs/mini_fo/mini_fo-overlay linux.dev/fs/mini_fo/mini_fo-over
+if [ $? -ne 0 ]; then
+ echo "Error, mounting failed, maybe no permisson to mount?"
+fi
diff -urN linux.old/fs/mini_fo/mmap.c linux.dev/fs/mini_fo/mmap.c
--- linux.old/fs/mini_fo/mmap.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/fs/mini_fo/mmap.c 2006-11-17 03:11:48.000000000 +0100
diff -urN linux-2.6.19.old/fs/mini_fo/mmap.c linux-2.6.19.dev/fs/mini_fo/mmap.c
--- linux-2.6.19.old/fs/mini_fo/mmap.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/mini_fo/mmap.c 2006-12-14 03:14:03.000000000 +0100
@@ -0,0 +1,637 @@
+/*
+ * Copyright (c) 1997-2003 Erez Zadok
@@ -6571,9 +6614,9 @@ diff -urN linux.old/fs/mini_fo/mmap.c linux.dev/fs/mini_fo/mmap.c
+ print_exit_status(err);
+ return err;
+}
diff -urN linux.old/fs/mini_fo/README linux.dev/fs/mini_fo/README
--- linux.old/fs/mini_fo/README 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/fs/mini_fo/README 2006-11-17 03:11:48.000000000 +0100
diff -urN linux-2.6.19.old/fs/mini_fo/README linux-2.6.19.dev/fs/mini_fo/README
--- linux-2.6.19.old/fs/mini_fo/README 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/mini_fo/README 2006-12-14 03:14:03.000000000 +0100
@@ -0,0 +1,163 @@
+README for the mini_fo overlay file system
+=========================================
@@ -6738,9 +6781,9 @@ diff -urN linux.old/fs/mini_fo/README linux.dev/fs/mini_fo/README
+2 of the License, or (at your option) any later version.
+
+
diff -urN linux.old/fs/mini_fo/RELEASE_NOTES linux.dev/fs/mini_fo/RELEASE_NOTES
--- linux.old/fs/mini_fo/RELEASE_NOTES 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/fs/mini_fo/RELEASE_NOTES 2006-11-17 03:11:48.000000000 +0100
diff -urN linux-2.6.19.old/fs/mini_fo/RELEASE_NOTES linux-2.6.19.dev/fs/mini_fo/RELEASE_NOTES
--- linux-2.6.19.old/fs/mini_fo/RELEASE_NOTES 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/mini_fo/RELEASE_NOTES 2006-12-14 03:14:03.000000000 +0100
@@ -0,0 +1,111 @@
+Release: mini_fo-0.6.1 (v0-6-1)
+Date: 21.09.2005
@@ -6853,9 +6896,9 @@ diff -urN linux.old/fs/mini_fo/RELEASE_NOTES linux.dev/fs/mini_fo/RELEASE_NOTES
+original state. I hope to fix this someday. Please note that this does
+not effect the special hard links '.' and '..', that are handled
+seperately by the lower fs.
diff -urN linux.old/fs/mini_fo/state.c linux.dev/fs/mini_fo/state.c
--- linux.old/fs/mini_fo/state.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/fs/mini_fo/state.c 2006-11-17 03:11:48.000000000 +0100
diff -urN linux-2.6.19.old/fs/mini_fo/state.c linux-2.6.19.dev/fs/mini_fo/state.c
--- linux-2.6.19.old/fs/mini_fo/state.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/mini_fo/state.c 2006-12-14 03:14:03.000000000 +0100
@@ -0,0 +1,620 @@
+/*
+ * Copyright (C) 2005 Markus Klotzbuecher <mk@creamnet.de>
@@ -7477,10 +7520,10 @@ diff -urN linux.old/fs/mini_fo/state.c linux.dev/fs/mini_fo/state.c
+ return err;
+}
+
diff -urN linux.old/fs/mini_fo/super.c linux.dev/fs/mini_fo/super.c
--- linux.old/fs/mini_fo/super.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/fs/mini_fo/super.c 2006-11-17 03:11:48.000000000 +0100
@@ -0,0 +1,259 @@
diff -urN linux-2.6.19.old/fs/mini_fo/super.c linux-2.6.19.dev/fs/mini_fo/super.c
--- linux-2.6.19.old/fs/mini_fo/super.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.dev/fs/mini_fo/super.c 2006-12-14 03:14:03.000000000 +0100
@@ -0,0 +1,281 @@
+/*
+ * Copyright (c) 1997-2003 Erez Zadok
+ * Copyright (c) 2001-2003 Stony Brook University
@@ -7640,17 +7683,26 @@ diff -urN linux.old/fs/mini_fo/super.c linux.dev/fs/mini_fo/super.c
+
+
+STATIC int
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+mini_fo_statfs(struct dentry *d, struct kstatfs *buf)
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+mini_fo_statfs(super_block_t *sb, struct kstatfs *buf)
+#else
+mini_fo_statfs(super_block_t *sb, struct statfs *buf)
+#endif
+{
+ int err = 0;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+ struct dentry *hidden_d;
+
+ hidden_d = dtohd(d);
+ err = vfs_statfs(hidden_d, buf);
+#else
+ super_block_t *hidden_sb;
+
+ hidden_sb = stohs(sb);
+ err = vfs_statfs(hidden_sb, buf);
+#endif
+
+ return err;
+}
@@ -7712,6 +7764,18 @@ diff -urN linux.old/fs/mini_fo/super.c linux.dev/fs/mini_fo/super.c
+ * dies.
+ */
+STATIC void
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+mini_fo_umount_begin(struct vfsmount *mnt, int flags)
+{
+ struct vfsmount *hidden_mnt;
+
+ hidden_mnt = stopd(mnt->mnt_sb)->hidden_mnt;
+
+ if (hidden_mnt->mnt_sb->s_op->umount_begin)
+ hidden_mnt->mnt_sb->s_op->umount_begin(hidden_mnt, flags);
+
+}
+#else
+mini_fo_umount_begin(super_block_t *sb)
+{
+ super_block_t *hidden_sb;
@@ -7722,6 +7786,7 @@ diff -urN linux.old/fs/mini_fo/super.c linux.dev/fs/mini_fo/super.c
+ hidden_sb->s_op->umount_begin(hidden_sb);
+
+}
+#endif
+
+
+struct super_operations mini_fo_sops =

View File

@@ -1,8 +1,6 @@
Taken from Debian linux-kernel-headers package
Update 2005-05-05 gotom, add __extension__ for linux/types.h.
--- linux.old/include/linux/time.h 2006-06-05 13:18:23.000000000 -0400
+++ linux.dev/include/linux/time.h 2006-06-10 00:16:51.962628154 -0400
diff -urN linux-2.6.19.old/include/linux/time.h linux-2.6.19.dev/include/linux/time.h
--- linux-2.6.19.old/include/linux/time.h 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/include/linux/time.h 2006-12-14 03:14:05.000000000 +0100
@@ -1,6 +1,10 @@
#ifndef _LINUX_TIME_H
#define _LINUX_TIME_H
@@ -14,15 +12,16 @@ Update 2005-05-05 gotom, add __extension__ for linux/types.h.
#include <linux/types.h>
#ifdef __KERNEL__
@@ -196,4 +200,6 @@
@@ -223,4 +227,6 @@
*/
#define TIMER_ABSTIME 0x01
+#endif /* __KERNEL__ DEBIAN */
+
#endif
--- linux.old/include/linux/types.h 2006-06-05 13:18:23.000000000 -0400
+++ linux.dev/include/linux/types.h 2006-06-10 00:16:51.962628154 -0400
diff -urN linux-2.6.19.old/include/linux/types.h linux-2.6.19.dev/include/linux/types.h
--- linux-2.6.19.old/include/linux/types.h 2006-11-29 22:57:37.000000000 +0100
+++ linux-2.6.19.dev/include/linux/types.h 2006-12-14 03:14:05.000000000 +0100
@@ -1,6 +1,14 @@
#ifndef _LINUX_TYPES_H
#define _LINUX_TYPES_H
@@ -36,9 +35,9 @@ Update 2005-05-05 gotom, add __extension__ for linux/types.h.
+#else
+
#ifdef __KERNEL__
#include <linux/config.h>
@@ -147,6 +157,8 @@
#define BITS_TO_LONGS(bits) \
@@ -156,6 +164,8 @@
#endif /* __KERNEL_STRICT_NAMES */

View File

@@ -1,7 +1,8 @@
--- linux.old/include/asm-mips/bitops.h 2006-12-08 17:09:09.035003456 +0100
+++ linux.dev/include/asm-mips/bitops.h 2006-12-08 17:09:25.539494392 +0100
@@ -12,6 +12,7 @@
#include <linux/config.h>
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>