restructure; cleanup
authorMike Baker <mbm@openwrt.org>
Sat, 31 Jul 2004 07:30:57 +0000 (07:30 +0000)
committerMike Baker <mbm@openwrt.org>
Sat, 31 Jul 2004 07:30:57 +0000 (07:30 +0000)
SVN-Revision: 120

142 files changed:
obsolete-buildroot/make/busybox.mk
obsolete-buildroot/make/openssh.mk
obsolete-buildroot/make/openssl.mk
obsolete-buildroot/make/openwrt.mk
obsolete-buildroot/make/zlib.mk
obsolete-buildroot/sources/addpattern.c [deleted file]
obsolete-buildroot/sources/busybox-openwrt-100-killall5.patch [deleted file]
obsolete-buildroot/sources/busybox-openwrt-110-telnetd.patch [deleted file]
obsolete-buildroot/sources/busybox-openwrt-120-udhcp.patch [deleted file]
obsolete-buildroot/sources/busybox-openwrt-130-resetmon.patch [deleted file]
obsolete-buildroot/sources/busybox.config [deleted file]
obsolete-buildroot/sources/compressed-20040531.tar.bz2 [deleted file]
obsolete-buildroot/sources/cramfs.patch [deleted file]
obsolete-buildroot/sources/device_table.txt [deleted file]
obsolete-buildroot/sources/dnsmasq1-openwrt.patch [deleted file]
obsolete-buildroot/sources/ebtables-brnf-5.patch [deleted file]
obsolete-buildroot/sources/kernel-patches/001-patch-2.4.26-pre5.bz2 [deleted file]
obsolete-buildroot/sources/kernel-patches/006-ieee1394-hotplug.bz2 [deleted file]
obsolete-buildroot/sources/kernel-patches/007-scsi_add_remove_single.bz2 [deleted file]
obsolete-buildroot/sources/kernel-patches/008-ieee1394-fix.bz2 [deleted file]
obsolete-buildroot/sources/kernel-patches/009-always-inline.bz2 [deleted file]
obsolete-buildroot/sources/kernel-patches/010-optimize-for-size.bz2 [deleted file]
obsolete-buildroot/sources/kernel-patches/012-x86-check_gcc.bz2 [deleted file]
obsolete-buildroot/sources/kernel-patches/017-printk.bz2 [deleted file]
obsolete-buildroot/sources/kernel-patches/018-slab-loop-init.bz2 [deleted file]
obsolete-buildroot/sources/kernel-patches/041-changeloop.patch.bz2 [deleted file]
obsolete-buildroot/sources/kernel-patches/042-loopfixes.patch.bz2 [deleted file]
obsolete-buildroot/sources/kernel-patches/044-streaming_io.bz2 [deleted file]
obsolete-buildroot/sources/kernel-patches/062-silence-blk-queue.bz2 [deleted file]
obsolete-buildroot/sources/kernel-patches/063-silence.kbd.patch.bz2 [deleted file]
obsolete-buildroot/sources/kernel-patches/064-shutup-md.bz2 [deleted file]
obsolete-buildroot/sources/kernel-patches/079-jiffies64.bz2 [deleted file]
obsolete-buildroot/sources/kernel-patches/089-no-touch-makedep.bz2 [deleted file]
obsolete-buildroot/sources/kernel-patches/100_VERSION.bz2 [deleted file]
obsolete-buildroot/sources/linux.config [deleted file]
obsolete-buildroot/sources/openssh.client.conffiles [deleted file]
obsolete-buildroot/sources/openssh.client.control [deleted file]
obsolete-buildroot/sources/openssh.client.ex.control [deleted file]
obsolete-buildroot/sources/openssh.client.preinst [deleted file]
obsolete-buildroot/sources/openssh.client.ssh_config [deleted file]
obsolete-buildroot/sources/openssh.patch [deleted file]
obsolete-buildroot/sources/openssh.server.S50sshd-ipk [deleted file]
obsolete-buildroot/sources/openssh.server.conffiles [deleted file]
obsolete-buildroot/sources/openssh.server.control [deleted file]
obsolete-buildroot/sources/openssh.server.postinst [deleted file]
obsolete-buildroot/sources/openssh.server.preinst [deleted file]
obsolete-buildroot/sources/openssh.server.sshd_config [deleted file]
obsolete-buildroot/sources/openssh.sftp-client.control [deleted file]
obsolete-buildroot/sources/openssh.sftp-server.control [deleted file]
obsolete-buildroot/sources/openssl.control [deleted file]
obsolete-buildroot/sources/openssl.patch [deleted file]
obsolete-buildroot/sources/openwrt-diag.c [deleted file]
obsolete-buildroot/sources/openwrt-linux-netfilter.patch [deleted file]
obsolete-buildroot/sources/openwrt-linux-sch_htb.patch [deleted file]
obsolete-buildroot/sources/openwrt-wrt54g-linux.config [deleted file]
obsolete-buildroot/sources/openwrt-wrt54g-linux.patch [deleted file]
obsolete-buildroot/sources/openwrt-wrt54g-nfsswap.patch [deleted file]
obsolete-buildroot/sources/openwrt-wrt54g-router.patch [deleted file]
obsolete-buildroot/sources/openwrt-wrt54g-shared.patch [deleted file]
obsolete-buildroot/sources/openwrt/busybox/busybox.config [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/busybox/patches/100-killall5.patch [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/busybox/patches/110-telnetd.patch [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/busybox/patches/130-resetmon.patch [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.conffiles [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.control [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.ex.control [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.preinst [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.ssh_config [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.patch [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.S50sshd-ipk [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.conffiles [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.control [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.postinst [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.preinst [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.sshd_config [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.sftp-client.control [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.sftp-server.control [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/openssl/control [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/openssl/openssl.patch [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/pppoecd/CONTROL/conffiles [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/pppoecd/CONTROL/control [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/pppoecd/CONTROL/postrm [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/pppoecd/CONTROL/prerm [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/pppoecd/pppoecd-pathnames.patch [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/pppoecd/pppoecd.patch [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/pppoecd/root/etc/ppp/ip-up [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/ipkg/zlib/control [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/kernel/compressed-20040531.tar.bz2 [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/kernel/diag.c [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/kernel/linux.config [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/kernel/patches/100-revert_netfilter.patch [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/kernel/patches/110-sch_htb.patch [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/kernel/patches/120-openwrt.patch [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/kernel/patches/130-nfsswap.patch [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/kernel/patches/140-ebtables-brnf-5.patch [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/patches/wrt54g-router.patch [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/patches/wrt54g-shared.patch [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/tools/addpattern.c [new file with mode: 0644]
obsolete-buildroot/sources/openwrt/tools/trx.c [new file with mode: 0644]
obsolete-buildroot/sources/pppoecd-pathnames.patch [deleted file]
obsolete-buildroot/sources/pppoecd.conffiles [deleted file]
obsolete-buildroot/sources/pppoecd.control [deleted file]
obsolete-buildroot/sources/pppoecd.ip-up [deleted file]
obsolete-buildroot/sources/pppoecd.patch [deleted file]
obsolete-buildroot/sources/pppoecd.postrm [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/TZ [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/fstab [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/group [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/hostname [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/hosts [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/init.d/S20urandom [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/init.d/S40network [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/init.d/rcS [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/inittab [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/inputrc [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/issue [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/network/interfaces [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/passwd [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/profile [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/protocols [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/random-seed [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/resolv.conf [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/securetty [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/services [deleted file]
obsolete-buildroot/sources/target_skeleton/etc/shadow [deleted file]
obsolete-buildroot/sources/target_skeleton/root/.bash_history [deleted file]
obsolete-buildroot/sources/target_skeleton/root/.bash_logout [deleted file]
obsolete-buildroot/sources/target_skeleton/root/.bash_profile [deleted file]
obsolete-buildroot/sources/target_skeleton/root/.bashrc [deleted file]
obsolete-buildroot/sources/target_skeleton/usr/share/terminfo/a/ansi [deleted file]
obsolete-buildroot/sources/target_skeleton/usr/share/terminfo/d/dumb [deleted file]
obsolete-buildroot/sources/target_skeleton/usr/share/terminfo/l/linux [deleted file]
obsolete-buildroot/sources/target_skeleton/usr/share/terminfo/r/rxvt [deleted file]
obsolete-buildroot/sources/target_skeleton/usr/share/terminfo/s/screen [deleted file]
obsolete-buildroot/sources/target_skeleton/usr/share/terminfo/s/screen-w [deleted file]
obsolete-buildroot/sources/target_skeleton/usr/share/terminfo/s/sun [deleted file]
obsolete-buildroot/sources/target_skeleton/usr/share/terminfo/v/vt100 [deleted file]
obsolete-buildroot/sources/target_skeleton/usr/share/terminfo/v/vt220 [deleted file]
obsolete-buildroot/sources/target_skeleton/usr/share/terminfo/v/vt52 [deleted file]
obsolete-buildroot/sources/target_skeleton/usr/share/terminfo/x/xterm [deleted file]
obsolete-buildroot/sources/target_skeleton/usr/share/terminfo/x/xterm-xfree86 [deleted file]
obsolete-buildroot/sources/target_skeleton/usr/share/udhcpc/default.script [deleted file]

index 510489d..baeb952 100644 (file)
@@ -15,7 +15,7 @@ BUSYBOX_SOURCE:=busybox-1.00-pre8.tar.bz2
 BUSYBOX_SITE:=http://www.busybox.net/downloads
 endif
 BUSYBOX_UNZIP=bzcat
-BUSYBOX_CONFIG:=$(SOURCE_DIR)/busybox.config
+BUSYBOX_CONFIG:=$(SOURCE_DIR)/openwrt/busybox/busybox.config
 
 $(DL_DIR)/$(BUSYBOX_SOURCE):
         $(WGET) -P $(DL_DIR) $(BUSYBOX_SITE)/$(BUSYBOX_SOURCE)
@@ -25,7 +25,7 @@ busybox-source: $(DL_DIR)/$(BUSYBOX_SOURCE) $(BUSYBOX_CONFIG)
 $(BUSYBOX_DIR)/.configured: $(DL_DIR)/$(BUSYBOX_SOURCE) $(BUSYBOX_CONFIG)
        $(BUSYBOX_UNZIP) $(DL_DIR)/$(BUSYBOX_SOURCE) | tar -C $(BUILD_DIR) -xvf -
        # Allow busybox patches.
-       $(SOURCE_DIR)/patch-kernel.sh $(BUSYBOX_DIR) $(SOURCE_DIR) busybox-*.patch
+       $(SOURCE_DIR)/patch-kernel.sh $(BUSYBOX_DIR) $(SOURCE_DIR)/openwrt/busybox/patches
        cp $(BUSYBOX_CONFIG) $(BUSYBOX_DIR)/.config
        $(SED) "s,^CROSS.*,CROSS=$(TARGET_CROSS)\n\
                PREFIX=$(TARGET_DIR),;" $(BUSYBOX_DIR)/Rules.mak
index 7fdb73e..6c5ba7a 100644 (file)
@@ -93,15 +93,15 @@ $(OPENSSH_IPK_DIR)/usr/bin/ssh: $(OPENSSH_DIR)/ssh
 $(OPENSSH_SERVER_IPK): $(OPENSSH_IPK_DIR)/usr/bin/ssh
        rm -rf $(OPENSSH_IPK_DIR)/build
        mkdir -p $(OPENSSH_IPK_DIR)/build/CONTROL
-       cp $(SOURCE_DIR)/openssh.server.control $(OPENSSH_IPK_DIR)/build/CONTROL/control
-       cp $(SOURCE_DIR)/openssh.server.conffiles $(OPENSSH_IPK_DIR)/build/CONTROL/conffiles
-       cp $(SOURCE_DIR)/openssh.server.preinst $(OPENSSH_IPK_DIR)/build/CONTROL/preinst
+       cp $(SOURCE_DIR)/openwrt/ipkg/openssh/openssh.server.control $(OPENSSH_IPK_DIR)/build/CONTROL/control
+       cp $(SOURCE_DIR)/openwrt/ipkg/openssh/openssh.server.conffiles $(OPENSSH_IPK_DIR)/build/CONTROL/conffiles
+       cp $(SOURCE_DIR)/openwrt/ipkg/openssh/openssh.server.preinst $(OPENSSH_IPK_DIR)/build/CONTROL/preinst
        chmod a+x $(OPENSSH_IPK_DIR)/build/CONTROL/preinst
-       cp $(SOURCE_DIR)/openssh.server.postinst $(OPENSSH_IPK_DIR)/build/CONTROL/postinst
+       cp $(SOURCE_DIR)/openwrt/ipkg/openssh/openssh.server.postinst $(OPENSSH_IPK_DIR)/build/CONTROL/postinst
        chmod a+x $(OPENSSH_IPK_DIR)/build/CONTROL/postinst
        mkdir -p $(OPENSSH_IPK_DIR)/build/etc/init.d
-       cp $(SOURCE_DIR)/openssh.server.sshd_config $(OPENSSH_IPK_DIR)/build/etc/sshd_config
-       cp $(SOURCE_DIR)/openssh.server.S50sshd-ipk $(OPENSSH_IPK_DIR)/build/etc/init.d/S50sshd
+       cp $(SOURCE_DIR)/openwrt/ipkg/openssh/openssh.server.sshd_config $(OPENSSH_IPK_DIR)/build/etc/sshd_config
+       cp $(SOURCE_DIR)/openwrt/ipkg/openssh/openssh.server.S50sshd-ipk $(OPENSSH_IPK_DIR)/build/etc/init.d/S50sshd
        chmod a+x $(OPENSSH_IPK_DIR)/build/etc/init.d/S50sshd
        mkdir -p $(OPENSSH_IPK_DIR)/build/usr/sbin
        cp $(OPENSSH_IPK_DIR)/usr/sbin/sshd $(OPENSSH_IPK_DIR)/build/usr/sbin
@@ -113,12 +113,12 @@ $(OPENSSH_SERVER_IPK): $(OPENSSH_IPK_DIR)/usr/bin/ssh
 $(OPENSSH_CLIENT_IPK): $(OPENSSH_IPK_DIR)/usr/bin/ssh
        rm -rf $(OPENSSH_IPK_DIR)/build
        mkdir -p $(OPENSSH_IPK_DIR)/build/CONTROL
-       cp $(SOURCE_DIR)/openssh.client.control $(OPENSSH_IPK_DIR)/build/CONTROL/control
-       cp $(SOURCE_DIR)/openssh.client.conffiles $(OPENSSH_IPK_DIR)/build/CONTROL/conffiles
-       cp $(SOURCE_DIR)/openssh.client.preinst $(OPENSSH_IPK_DIR)/build/CONTROL/preinst
+       cp $(SOURCE_DIR)/openwrt/ipkg/openssh/openssh.client.control $(OPENSSH_IPK_DIR)/build/CONTROL/control
+       cp $(SOURCE_DIR)/openwrt/ipkg/openssh/openssh.client.conffiles $(OPENSSH_IPK_DIR)/build/CONTROL/conffiles
+       cp $(SOURCE_DIR)/openwrt/ipkg/openssh/openssh.client.preinst $(OPENSSH_IPK_DIR)/build/CONTROL/preinst
        chmod a+x $(OPENSSH_IPK_DIR)/build/CONTROL/preinst
        mkdir -p $(OPENSSH_IPK_DIR)/build/etc
-       cp $(SOURCE_DIR)/openssh.client.ssh_config $(OPENSSH_IPK_DIR)/build/etc/ssh_config
+       cp $(SOURCE_DIR)/openwrt/ipkg/openssh/openssh.client.ssh_config $(OPENSSH_IPK_DIR)/build/etc/ssh_config
        mkdir -p $(OPENSSH_IPK_DIR)/build/usr/bin
        cp $(OPENSSH_IPK_DIR)/usr/bin/ssh $(OPENSSH_IPK_DIR)/build/usr/bin
        cp $(OPENSSH_IPK_DIR)/usr/bin/scp $(OPENSSH_IPK_DIR)/build/usr/bin
@@ -128,7 +128,7 @@ $(OPENSSH_CLIENT_IPK): $(OPENSSH_IPK_DIR)/usr/bin/ssh
 $(OPENSSH_SFTP_SERVER_IPK): $(OPENSSH_IPK_DIR)/usr/bin/ssh
        rm -rf $(OPENSSH_IPK_DIR)/build
        mkdir -p $(OPENSSH_IPK_DIR)/build/CONTROL
-       cp $(SOURCE_DIR)/openssh.sftp-server.control $(OPENSSH_IPK_DIR)/build/CONTROL/control
+       cp $(SOURCE_DIR)/openwrt/ipkg/openssh/openssh.sftp-server.control $(OPENSSH_IPK_DIR)/build/CONTROL/control
        mkdir -p $(OPENSSH_IPK_DIR)/build/usr/sbin
        cp $(OPENSSH_IPK_DIR)/usr/sbin/sftp-server $(OPENSSH_IPK_DIR)/build/usr/sbin
        cd $(BUILD_DIR); $(STAGING_DIR)/bin/ipkg-build -c -o root -g root $(OPENSSH_IPK_DIR)/build
@@ -137,7 +137,7 @@ $(OPENSSH_SFTP_SERVER_IPK): $(OPENSSH_IPK_DIR)/usr/bin/ssh
 $(OPENSSH_SFTP_CLIENT_IPK): $(OPENSSH_IPK_DIR)/usr/bin/ssh
        rm -rf $(OPENSSH_IPK_DIR)/build
        mkdir -p $(OPENSSH_IPK_DIR)/build/CONTROL
-       cp $(SOURCE_DIR)/openssh.sftp-client.control $(OPENSSH_IPK_DIR)/build/CONTROL/control
+       cp $(SOURCE_DIR)/openwrt/ipkg/openssh/openssh.sftp-client.control $(OPENSSH_IPK_DIR)/build/CONTROL/control
        mkdir -p $(OPENSSH_IPK_DIR)/build/usr/bin
        cp $(OPENSSH_IPK_DIR)/usr/bin/sftp $(OPENSSH_IPK_DIR)/build/usr/bin
        cd $(BUILD_DIR); $(STAGING_DIR)/bin/ipkg-build -c -o root -g root $(OPENSSH_IPK_DIR)/build
@@ -146,7 +146,7 @@ $(OPENSSH_SFTP_CLIENT_IPK): $(OPENSSH_IPK_DIR)/usr/bin/ssh
 $(OPENSSH_CLIENT_EX_IPK): $(OPENSSH_IPK_DIR)/usr/bin/ssh
        rm -rf $(OPENSSH_IPK_DIR)/build
        mkdir -p $(OPENSSH_IPK_DIR)/build/CONTROL
-       cp $(SOURCE_DIR)/openssh.client.ex.control $(OPENSSH_IPK_DIR)/build/CONTROL/control
+       cp $(SOURCE_DIR)/openwrt/ipkg/openssh/openssh.client.ex.control $(OPENSSH_IPK_DIR)/build/CONTROL/control
        mkdir -p $(OPENSSH_IPK_DIR)/build/usr/bin
        cp $(OPENSSH_IPK_DIR)/usr/bin/ssh-add $(OPENSSH_IPK_DIR)/build/usr/bin
        cp $(OPENSSH_IPK_DIR)/usr/bin/ssh-agent $(OPENSSH_IPK_DIR)/build/usr/bin
index e20c8b9..3fa273f 100644 (file)
@@ -70,7 +70,7 @@ openssl: uclibc $(TARGET_DIR)/usr/lib/libcrypto.so.0.9.7
 
 $(LIBSSL_IPK): uclibc $(STAGING_DIR)/usr/lib/libcrypto.a
        mkdir -p $(OPENSSL_IPK_DIR)/CONTROL
-       cp $(SOURCE_DIR)/libssl.control $(OPENSSL_IPK_DIR)/CONTROL/control
+       cp $(SOURCE_DIR)/openwrt/openssl/control $(OPENSSL_IPK_DIR)/CONTROL/control
        mkdir -p $(OPENSSL_IPK_DIR)/usr/lib
        cp -fa $(STAGING_DIR)/lib/libcrypto.so* $(OPENSSL_IPK_DIR)/usr/lib/
        cp -fa $(STAGING_DIR)/lib/libssl.so* $(OPENSSL_IPK_DIR)/usr/lib/
index 6889e1e..e839a0a 100644 (file)
@@ -36,22 +36,10 @@ openwrt-base: $(OPENWRT_TARGETS)
 
 ifneq ($(filter $(TARGETS),openwrt-base),)
 
-# WRT54G_SOURCE=wrt54gv2.2.02.2.tgz
-# WRT54G_SITE=http://www.linksys.com/support/opensourcecode/wrt54gv2/2.02.2
-
-# WRT54G_SOURCE=wrt54g.2.02.7.tgz
-# WRT54G_SITE=http://www.linksys.com/support/opensourcecode/wrt54gv2/2.02.7
-# WRT54G_DIR=$(BUILD_DIR)/WRT54G
-
 WRT54G_SOURCE=wrt54gs.2.07.1.tgz
 WRT54G_SITE=http://www.linksys.com/support/opensourcecode/wrt54gs/2.07.1
-
 WRT54G_DIR=$(BUILD_DIR)/WRT54GS
 
-# OPENWRT_ROOT=openwrt-root.tar.bz2
-# OPENWRT_SITE=http://127.0.0.1
-# OPENWRT_DIR=$(BUILD_DIR)/openwrt
-
 LINUX_DIR=$(WRT54G_DIR)/release/src/linux/linux
 LINUX_FORMAT=zImage
 LINUX_BINLOC=arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz
@@ -63,17 +51,14 @@ $(LINUX_DIR)/.unpacked: $(WRT54G_DIR)/.prepared
        touch $(LINUX_DIR)/.unpacked
 
 $(LINUX_DIR)/.patched: $(WRT54G_DIR)/.prepared
-       $(SOURCE_DIR)/patch-kernel.sh $(LINUX_DIR)/../.. $(SOURCE_DIR) openwrt-linux-netfilter.patch
-       $(SOURCE_DIR)/patch-kernel.sh $(LINUX_DIR)/../.. $(SOURCE_DIR) openwrt-linux-sch_htb.patch
-       $(SOURCE_DIR)/patch-kernel.sh $(LINUX_DIR)/../.. $(SOURCE_DIR) openwrt-wrt54g-linux.patch
-       $(SOURCE_DIR)/patch-kernel.sh $(LINUX_DIR)/../.. $(SOURCE_DIR) openwrt-wrt54g-nfsswap.patch
+       $(SOURCE_DIR)/patch-kernel.sh $(LINUX_DIR)/../.. $(SOURCE_DIR)/openwrt/kernel/patches
        # use replacement diag module code
-       cp -f $(SOURCE_DIR)/openwrt-diag.c $(LINUX_DIR)/drivers/net/diag/diag_led.c
-       cp -f $(SOURCE_DIR)/openwrt-wrt54g-linux.config $(LINUX_DIR)/.config
+       cp -f $(SOURCE_DIR)/openwrt/kernel/diag.c $(LINUX_DIR)/drivers/net/diag/diag_led.c
+       cp -f $(SOURCE_DIR)/openwrt/kernel/linux.config $(LINUX_DIR)/.config
        -(cd $(BUILD_DIR); ln -sf $(LINUX_DIR) linux)
        -(cd $(LINUX_DIR)/arch/mips/brcm-boards/bcm947xx/; \
        rm -rf compressed; \
-       tar jxvf $(SOURCE_DIR)/compressed-20040531.tar.bz2; \
+       tar jxvf $(SOURCE_DIR)/openwrt/kernel/compressed-20040531.tar.bz2; \
        )
        touch $(LINUX_DIR)/.patched
 
@@ -107,8 +92,7 @@ $(WRT54G_DIR)/.source: $(DL_DIR)/$(WRT54G_SOURCE)
        touch $(WRT54G_DIR)/.source
 
 $(WRT54G_DIR)/.prepared: $(WRT54G_DIR)/.source
-       $(SOURCE_DIR)/patch-kernel.sh $(WRT54G_DIR) $(SOURCE_DIR) openwrt-wrt54g-router.patch
-       $(SOURCE_DIR)/patch-kernel.sh $(WRT54G_DIR) $(SOURCE_DIR) openwrt-wrt54g-shared.patch
+       $(SOURCE_DIR)/patch-kernel.sh $(WRT54G_DIR) $(SOURCE_DIR)/openwrt/patches
        touch $(WRT54G_DIR)/.prepared
 
 ######################################################################
@@ -236,8 +220,8 @@ openwrt-prune:
 ######################################################################
 
 wrt-tools:
-       $(CC) -o $(WRT54G_DIR)/release/tools/trx $(SOURCE_DIR)/trx.c
-       $(CC) -o $(WRT54G_DIR)/release/tools/addpattern $(SOURCE_DIR)/addpattern.c
+       $(CC) -o $(WRT54G_DIR)/release/tools/trx $(SOURCE_DIR)/openwrt/tools/trx.c
+       $(CC) -o $(WRT54G_DIR)/release/tools/addpattern $(SOURCE_DIR)/openwrt/tools/addpattern.c
 
 openwrt-linux.trx:  openwrt-prune squashfsroot wrt-tools
        $(WRT54G_DIR)/release/tools/trx -o openwrt-linux.trx \
@@ -253,24 +237,4 @@ openwrt-g-code.bin: openwrt-gs-code.bin
 openwrt-code.bin: openwrt-gs-code.bin openwrt-g-code.bin
 
 ######################################################################
-
-openwrt-sourceball:
-       tar cjf buildroot-openwrt.tar.bz2 \
-               README.openwrt \
-               Makefile \
-               Makefile-openwrt \
-               make/openwrt.mk \
-               make/uclibc.mk \
-               make/busybox.mk \
-               sources/uClibc.config \
-               sources/uClibc.config-openwrt \
-               sources/busybox-openwrt-*.patch \
-               sources/busybox.config \
-               sources/busybox.config-openwrt \
-               sources/dnsmasq1-openwrt.patch \
-               sources/iptables-openwrt-extensions.patch \
-               sources/openwrt-wrt54g-linux.config \
-               sources/openwrt-wrt54g-*.patch \
-               sources/openwrt-diag.c
-
 endif
index 5500fec..48e7b32 100644 (file)
@@ -66,7 +66,7 @@ zlib: uclibc $(TARGET_DIR)/lib/libz.so.1.1.4
 
 $(ZLIB_IPK): uclibc $(STAGING_DIR)/lib/libz.so.1.1.4
        mkdir -p $(ZLIB_IPK_DIR)/CONTROL
-       cp $(SOURCE_DIR)/zlib.control $(ZLIB_IPK_DIR)/CONTROL/control
+       cp $(SOURCE_DIR)/openwrt/ipkg/zlib/control $(ZLIB_IPK_DIR)/CONTROL/control
        mkdir -p $(ZLIB_IPK_DIR)/lib
        cp -dpf $(STAGING_DIR)/lib/libz.so* $(ZLIB_IPK_DIR)/lib;
        -$(STRIP) --strip-unneeded $(ZLIB_IPK_DIR)/lib/libz.so*
diff --git a/obsolete-buildroot/sources/addpattern.c b/obsolete-buildroot/sources/addpattern.c
deleted file mode 100644 (file)
index dbf8ed6..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright (C) 2004  Manuel Novoa III  <mjn3@codepoet.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* July 29, 2004
- *
- * This is a hacked replacement for the 'addpattern' utility used to
- * create wrt54g .bin firmware files.  It isn't pretty, but it does
- * the job for me.
- *
- * Extensions:
- *  -v allows setting the version string on the command line.
- *  -{0|1} sets the (currently ignored) hw_ver flag in the header
- *      to 0 or 1 respectively.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-#include <sys/stat.h>
-
-/**********************************************************************/
-
-#define CODE_ID                "U2ND"          /* from code_pattern.h */
-#define CODE_PATTERN   "W54S"  /* from code_pattern.h */
-
-#define CYBERTAN_VERSION       "v2.07.1" /* from cyutils.h */
-/* #define CYBERTAN_VERSION    "v2.04.3" */
-
-struct code_header {                   /* from cyutils.h */
-       char magic[4];
-       char res1[4];                           /* for extra magic */
-       char fwdate[3];
-       char fwvern[3];
-       char id[4];                                     /* U2ND */
-#if 0
-       unsigned char res2[14];
-#else
-       char hw_ver;                            /* 0: for 4702, 1: for 4712 -- new in 2.04.3 */
-       unsigned char res2[13];
-#endif
-} ;
-
-/**********************************************************************/
-
-void usage(void) __attribute__ (( __noreturn__ ));
-
-void usage(void)
-{
-       fprintf(stderr, "Usage: addpattern [-i trxfile] [-o binfile] [-p pattern] [-g] [-v v#.#.#] [-{0|1}]\n");
-       exit(EXIT_FAILURE);
-}
-
-int main(int argc, char **argv)
-{
-       char buf[1024]; /* keep this at 1k or adjust garbage calc below */
-       struct code_header *hdr;
-       FILE *in = stdin;
-       FILE *out = stdout;
-       char *ifn = NULL;
-       char *ofn = NULL;
-       char *pattern = CODE_PATTERN;
-       char *version = CYBERTAN_VERSION;
-       int gflag = 0;
-       int c;
-       int v0, v1, v2;
-       size_t off, n;
-       time_t t;
-       struct tm *ptm;
-
-       fprintf(stderr, "mjn3's addpattern replacement - v0.80\n");
-
-       hdr = (struct code_header *) buf;
-
-       while ((c = getopt(argc, argv, "i:o:p:gv:01")) != -1) {
-               switch (c) {
-                       case 'i':
-                               ifn = optarg;
-                               break;
-                       case 'o':
-                               ofn = optarg;
-                               break;
-                       case 'p':
-                               pattern = optarg;
-                               break;
-                       case 'g':
-                               gflag = 1;
-                               break;
-                       case 'v':                       /* extension to allow setting version */
-                               version = optarg;
-                               break;
-                       case '0':
-                               hdr->hw_ver = 0;
-                               break;
-                       case '1':
-                               hdr->hw_ver = 1;
-                               break;
-                       default:
-                               usage();
-               }
-       }
-
-       if (optind != argc) {
-               fprintf(stderr, "illegal arg \"%s\"\n", argv[optind]);
-               usage();
-       }
-
-       if (strlen(pattern) != 4) {
-               fprintf(stderr, "illegal pattern \"%s\": length != 4\n", pattern);
-               usage();
-       }
-
-       if (ifn && !(in = fopen(ifn, "r"))) {
-               fprintf(stderr, "can not open \"%s\" for reading\n", ifn);
-               usage();
-       }
-
-       if (ofn && !(out = fopen(ofn, "w"))) {
-               fprintf(stderr, "can not open \"%s\" for writing\n", ofn);
-               usage();
-       }
-
-       if (time(&t) == (time_t)(-1)) {
-               fprintf(stderr, "time call failed\n");
-               return EXIT_FAILURE;
-       }
-
-       ptm = localtime(&t);
-
-       if (3 != sscanf(version, "v%d.%d.%d", &v0, &v1, &v2)) {
-               fprintf(stderr, "bad version string \"%s\"\n", version);
-               return EXIT_FAILURE;
-       }
-
-       memset(hdr, 0, sizeof(struct code_header));
-       memcpy(&hdr->magic, pattern, 4);
-       hdr->fwdate[0] = ptm->tm_year % 100;
-       hdr->fwdate[1] = ptm->tm_mon + 1;
-       hdr->fwdate[2] = ptm->tm_mday;
-       hdr->fwvern[0] = v0;
-       hdr->fwvern[1] = v1;
-       hdr->fwvern[2] = v2;
-       memcpy(&hdr->id, CODE_ID, strlen(CODE_ID));
-
-       off = sizeof(struct code_header);
-
-       fprintf(stderr, "writing firmware v%d.%d.%d on %d/%d/%d (y/m/d)\n",
-                       v0, v1, v2,
-                       hdr->fwdate[0], hdr->fwdate[1], hdr->fwdate[2]);
-
-
-       while ((n = fread(buf + off, 1, sizeof(buf)-off, in) + off) > 0) {
-               off = 0;
-               if (n < sizeof(buf)) {
-                       if (ferror(in)) {
-                       FREAD_ERROR:
-                               fprintf(stderr, "fread error\n");
-                               return EXIT_FAILURE;
-                       }
-                       if (gflag) {
-                               gflag = sizeof(buf) - n;
-                               memset(buf + n, 0xff, gflag);
-                               fprintf(stderr, "adding %d bytes of garbage\n", gflag);
-                               n = sizeof(buf);
-                       }
-               }
-               if (!fwrite(buf, n, 1, out)) {
-               FWRITE_ERROR:
-                       fprintf(stderr, "fwrite error\n");
-                       return EXIT_FAILURE;
-               }
-       }
-       
-       if (ferror(in)) {
-               goto FREAD_ERROR;
-       }
-
-       if (fflush(out)) {
-               goto FWRITE_ERROR;
-       }
-
-       fclose(in);
-       fclose(out);
-
-       return EXIT_SUCCESS;
-}
diff --git a/obsolete-buildroot/sources/busybox-openwrt-100-killall5.patch b/obsolete-buildroot/sources/busybox-openwrt-100-killall5.patch
deleted file mode 100644 (file)
index 161b7e6..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-diff -urN busybox-dist/include/applets.h busybox/include/applets.h
---- busybox-dist/include/applets.h     2004-03-13 02:33:09.000000000 -0600
-+++ busybox/include/applets.h  2004-03-16 09:45:29.000000000 -0600
-@@ -313,6 +313,9 @@
- #ifdef CONFIG_KILLALL
-       APPLET(killall, kill_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
- #endif
-+#ifdef CONFIG_KILLALL5
-+      APPLET(killall5, kill_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
-+#endif
- #ifdef CONFIG_KLOGD
-       APPLET(klogd, klogd_main, _BB_DIR_SBIN, _BB_SUID_NEVER)
- #endif
-diff -urN busybox-dist/include/usage.h busybox/include/usage.h
---- busybox-dist/include/usage.h       2004-03-13 02:33:09.000000000 -0600
-+++ busybox/include/usage.h    2004-03-16 09:45:29.000000000 -0600
-@@ -1389,6 +1389,13 @@
- #define killall_example_usage \
-       "$ killall apache\n"
-+#define killall5_trivial_usage \
-+      ""
-+#define killall5_full_usage \
-+      ""
-+#define killall5_example_usage \
-+      ""
-+
- #define klogd_trivial_usage \
-       "[-c n] [-n]"
- #define klogd_full_usage \
-diff -urN busybox-dist/procps/Config.in busybox/procps/Config.in
---- busybox-dist/procps/Config.in      2003-12-24 00:02:11.000000000 -0600
-+++ busybox/procps/Config.in   2004-03-16 09:45:29.000000000 -0600
-@@ -30,6 +30,11 @@
-         specified commands.  If no signal name is specified, SIGTERM is
-         sent.
-+config CONFIG_KILLALL5
-+      bool "killall5"
-+      default n
-+      depends on CONFIG_KILL
-+      
- config CONFIG_PIDOF
-       bool "pidof"
-       default n
-diff -urN busybox-dist/procps/kill.c busybox/procps/kill.c
---- busybox-dist/procps/kill.c 2004-03-15 02:29:03.000000000 -0600
-+++ busybox/procps/kill.c      2004-03-16 09:45:29.000000000 -0600
-@@ -34,6 +34,7 @@
- #define KILL 0
- #define KILLALL 1
-+#define KILLALL5 2
- extern int kill_main(int argc, char **argv)
- {
-@@ -47,6 +48,9 @@
- #else
-       whichApp = KILL;
- #endif
-+#ifdef CONFIG_KILLALL5
-+      whichApp = (strcmp(bb_applet_name, "killall5") == 0)? KILLALL5 : whichApp;
-+#endif
-       /* Parse any options */
-       if (argc < 2)
-@@ -119,6 +123,20 @@
-               }
-       }
-+#ifdef CONFIG_KILLALL5
-+      else if (whichApp == KILLALL5) {
-+              procps_status_t * p;
-+              pid_t myPid=getpid();
-+              while ((p = procps_scan(0)) != 0) {
-+                      if (p->pid != 1 && p->pid != myPid && p->pid != p->ppid) {
-+                              if (kill(p->pid, signo) != 0) {
-+                                      bb_perror_msg( "Could not kill pid '%d'", p->pid);
-+                                      errors++;
-+                              }
-+                      }
-+              }
-+      }
-+#endif
- #ifdef CONFIG_KILLALL
-       else {
-               pid_t myPid=getpid();
diff --git a/obsolete-buildroot/sources/busybox-openwrt-110-telnetd.patch b/obsolete-buildroot/sources/busybox-openwrt-110-telnetd.patch
deleted file mode 100644 (file)
index e95757e..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-diff -urN busybox-1.00-pre8/networking/telnetd.c busybox-1.00-pre8-openwrt/networking/telnetd.c
---- busybox-1.00-pre8/networking/telnetd.c     2004-02-22 03:45:57.000000000 -0600
-+++ busybox-1.00-pre8-openwrt/networking/telnetd.c     2004-03-05 01:32:57.000000000 -0600
-@@ -44,6 +44,8 @@
- #include <arpa/telnet.h>
- #include <ctype.h>
- #include <sys/syslog.h>
-+#include <net/if.h>
-+
- #include "busybox.h"
-@@ -384,11 +386,13 @@
-       int portnbr = 23;
- #endif /* CONFIG_FEATURE_TELNETD_INETD */
-       int c;
-+      char *interface_name = NULL;
-+      struct ifreq interface;
-       static const char options[] =
- #ifdef CONFIG_FEATURE_TELNETD_INETD
--              "f:l:";
--#else /* CONFIG_EATURE_TELNETD_INETD */
--              "f:l:p:";
-+              "i:f:l:";
-+#else /* CONFIG_FEATURE_TELNETD_INETD */
-+              "i:f:l:p:";
- #endif /* CONFIG_FEATURE_TELNETD_INETD */
-       int maxlen, w, r;
-@@ -403,6 +407,9 @@
-                       case 'f':
-                               issuefile = strdup (optarg);
-                               break;
-+                        case 'i':
-+                                interface_name = strdup(optarg);
-+                                break;
-                       case 'l':
-                               loginpath = strdup (optarg);
-                               break;
-@@ -442,6 +449,13 @@
-       sa.sin_family = AF_INET;
-       sa.sin_port = htons(portnbr);
-+        /* Set it to listen on the specified interface */
-+        if (interface_name) {
-+                strncpy(interface.ifr_ifrn.ifrn_name, interface_name, IFNAMSIZ);
-+                (void)setsockopt(master_fd, SOL_SOCKET,
-+                                SO_BINDTODEVICE, &interface, sizeof(interface));
-+        }
-+
-       if (bind(master_fd, (struct sockaddr *) &sa, sizeof(sa)) < 0) {
-               bb_perror_msg_and_die("bind");
-       }
diff --git a/obsolete-buildroot/sources/busybox-openwrt-120-udhcp.patch b/obsolete-buildroot/sources/busybox-openwrt-120-udhcp.patch
deleted file mode 100644 (file)
index f8e8d33..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-diff -urN busybox-dist/networking/udhcp/dumpleases.c busybox/networking/udhcp/dumpleases.c
---- busybox-dist/networking/udhcp/dumpleases.c 2004-03-15 02:29:00.000000000 -0600
-+++ busybox/networking/udhcp/dumpleases.c      2004-03-16 09:52:32.000000000 -0600
-@@ -42,7 +42,7 @@
- #endif
- {
-       FILE *fp;
--      int i, c, mode = REMAINING;
-+      int i, c, mode = ABSOLUTE;
-       long expires;
-       const char *file = LEASES_FILE;
-       struct dhcpOfferedAddr lease;
-@@ -73,7 +73,7 @@
-       fp = xfopen(file, "r");
--      printf("Mac Address       IP-Address      Expires %s\n", mode == REMAINING ? "in" : "at");
-+      printf("Mac Address       IP-Address      Hostname        Expires %s\n", mode == REMAINING ? "in" : "at");
-       /*     "00:00:00:00:00:00 255.255.255.255 Wed Jun 30 21:49:08 1993" */
-       while (fread(&lease, sizeof(lease), 1, fp)) {
-@@ -84,7 +84,8 @@
-               addr.s_addr = lease.yiaddr;
-               printf(" %-15s", inet_ntoa(addr));
-               expires = ntohl(lease.expires);
--              printf(" ");
-+              //expires = lease.expires;
-+              printf(" %-15s ",lease.hostname);
-               if (mode == REMAINING) {
-                       if (!expires) printf("expired\n");
-                       else {
-diff -urN busybox-dist/networking/udhcp/files.c busybox/networking/udhcp/files.c
---- busybox-dist/networking/udhcp/files.c      2004-03-15 02:29:00.000000000 -0600
-+++ busybox/networking/udhcp/files.c   2004-03-16 09:50:04.000000000 -0600
-@@ -281,7 +281,7 @@
-               if (lease.yiaddr >= server_config.start && lease.yiaddr <= server_config.end) {
-                       lease.expires = ntohl(lease.expires);
-                       if (!server_config.remaining) lease.expires -= time(0);
--                      if (!(add_lease(lease.chaddr, lease.yiaddr, lease.expires))) {
-+                      if (!(add_lease(lease.hostname, lease.chaddr, lease.yiaddr, lease.expires))) {
-                               LOG(LOG_WARNING, "Too many leases while loading %s\n", file);
-                               break;
-                       }
-diff -urN busybox-dist/networking/udhcp/leases.c busybox/networking/udhcp/leases.c
---- busybox-dist/networking/udhcp/leases.c     2004-03-15 02:29:00.000000000 -0600
-+++ busybox/networking/udhcp/leases.c  2004-03-16 09:50:04.000000000 -0600
-@@ -35,7 +35,7 @@
- /* add a lease into the table, clearing out any old ones */
--struct dhcpOfferedAddr *add_lease(uint8_t *chaddr, uint32_t yiaddr, unsigned long lease)
-+struct dhcpOfferedAddr *add_lease(uint8_t *hostname, uint8_t *chaddr, uint32_t yiaddr, unsigned long lease)
- {
-       struct dhcpOfferedAddr *oldest;
-@@ -45,6 +45,13 @@
-       oldest = oldest_expired_lease();
-       if (oldest) {
-+              if (hostname) {
-+                      uint8_t length = *(hostname-1);
-+                      if (length>15) length=15;
-+                      memcpy(oldest->hostname,hostname,length);
-+                      oldest->hostname[length]=0;
-+              }
-+              
-               memcpy(oldest->chaddr, chaddr, 16);
-               oldest->yiaddr = yiaddr;
-               oldest->expires = time(0) + lease;
-@@ -112,7 +119,7 @@
-               temp.s_addr = addr;
-               LOG(LOG_INFO, "%s belongs to someone, reserving it for %ld seconds",
-                       inet_ntoa(temp), server_config.conflict_time);
--              add_lease(blank_chaddr, addr, server_config.conflict_time);
-+              add_lease(blank_chaddr, blank_chaddr, addr, server_config.conflict_time);
-               return 1;
-       } else return 0;
- }
-diff -urN busybox-dist/networking/udhcp/leases.h busybox/networking/udhcp/leases.h
---- busybox-dist/networking/udhcp/leases.h     2004-01-30 17:45:12.000000000 -0600
-+++ busybox/networking/udhcp/leases.h  2004-03-16 09:50:04.000000000 -0600
-@@ -4,6 +4,7 @@
- struct dhcpOfferedAddr {
-+      uint8_t hostname[16];
-       uint8_t chaddr[16];
-       uint32_t yiaddr;        /* network order */
-       uint32_t expires;       /* host order */
-@@ -12,7 +13,7 @@
- extern uint8_t blank_chaddr[];
- void clear_lease(uint8_t *chaddr, uint32_t yiaddr);
--struct dhcpOfferedAddr *add_lease(uint8_t *chaddr, uint32_t yiaddr, unsigned long lease);
-+struct dhcpOfferedAddr *add_lease(uint8_t *hostname, uint8_t *chaddr, uint32_t yiaddr, unsigned long lease);
- int lease_expired(struct dhcpOfferedAddr *lease);
- struct dhcpOfferedAddr *oldest_expired_lease(void);
- struct dhcpOfferedAddr *find_lease_by_chaddr(uint8_t *chaddr);
-diff -urN busybox-dist/networking/udhcp/serverpacket.c busybox/networking/udhcp/serverpacket.c
---- busybox-dist/networking/udhcp/serverpacket.c       2004-03-15 02:29:01.000000000 -0600
-+++ busybox/networking/udhcp/serverpacket.c    2004-03-16 09:51:36.000000000 -0600
-@@ -29,6 +29,7 @@
- #include "dhcpd.h"
- #include "options.h"
- #include "common.h"
-+#include "files.h"
- /* send a packet to giaddr using the kernel ip stack */
- static int send_packet_to_relay(struct dhcpMessage *payload)
-@@ -152,7 +153,7 @@
-               return -1;
-       }
--      if (!add_lease(packet.chaddr, packet.yiaddr, server_config.offer_time)) {
-+      if (!add_lease(get_option(oldpacket, DHCP_HOST_NAME), packet.chaddr, packet.yiaddr, server_config.offer_time)) {
-               LOG(LOG_WARNING, "lease pool is full -- OFFER abandoned");
-               return -1;
-       }
-@@ -233,7 +234,9 @@
-       if (send_packet(&packet, 0) < 0)
-               return -1;
--      add_lease(packet.chaddr, packet.yiaddr, lease_time_align);
-+      add_lease(get_option(oldpacket, DHCP_HOST_NAME), packet.chaddr, packet.yiaddr, lease_time_align);
-+
-+      write_leases();
-       return 0;
- }
diff --git a/obsolete-buildroot/sources/busybox-openwrt-130-resetmon.patch b/obsolete-buildroot/sources/busybox-openwrt-130-resetmon.patch
deleted file mode 100644 (file)
index b41315e..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-diff -urN busybox-dist/include/applets.h busybox/include/applets.h
---- busybox-dist/include/applets.h     2004-03-16 09:56:27.000000000 -0600
-+++ busybox/include/applets.h  2004-03-16 10:00:14.000000000 -0600
-@@ -484,6 +484,9 @@
- #ifdef CONFIG_RESET
-       APPLET(reset, reset_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
- #endif
-+#ifdef CONFIG_RESETMON
-+      APPLET(resetmon, resetmon_main, _BB_DIR_SBIN, _BB_SUID_NEVER)
-+#endif
- #ifdef CONFIG_RM
-       APPLET(rm, rm_main, _BB_DIR_BIN, _BB_SUID_NEVER)
- #endif
-diff -urN busybox-dist/include/usage.h busybox/include/usage.h
---- busybox-dist/include/usage.h       2004-03-16 09:56:27.000000000 -0600
-+++ busybox/include/usage.h    2004-03-16 10:00:14.000000000 -0600
-@@ -2024,6 +2024,11 @@
- #define reset_full_usage \
-       "Resets the screen."
-+#define resetmon_trivial_usage \
-+      ""
-+#define resetmon_full_usage \
-+      "Return an exit code of TRUE (0) if reset is NOT pressed."
-+
- #define rm_trivial_usage \
-       "[OPTION]... FILE..."
- #define rm_full_usage \
-diff -urN busybox-dist/miscutils/Config.in busybox/miscutils/Config.in
---- busybox-dist/miscutils/Config.in   2004-03-15 02:28:46.000000000 -0600
-+++ busybox/miscutils/Config.in        2004-03-16 10:00:14.000000000 -0600
-@@ -156,6 +156,12 @@
-         to advance or rewind a tape past a specified number of archive
-         files on the tape.
-+config CONFIG_RESETMON
-+        bool "resetmon"
-+      default y
-+      help
-+        Linksys wrt54g reset button monitor.  Returns TRUE if NOT pressed.
-+
- config CONFIG_RX
-         bool "rx"
-       default n
-diff -urN busybox-dist/miscutils/Makefile.in busybox/miscutils/Makefile.in
---- busybox-dist/miscutils/Makefile.in 2004-03-15 02:28:46.000000000 -0600
-+++ busybox/miscutils/Makefile.in      2004-03-16 10:00:14.000000000 -0600
-@@ -33,6 +33,7 @@
- MISCUTILS-$(CONFIG_LAST)              += last.o
- MISCUTILS-$(CONFIG_MAKEDEVS)          += makedevs.o
- MISCUTILS-$(CONFIG_MT)                        += mt.o
-+MISCUTILS-$(CONFIG_RESETMON)          += resetmon.o
- MISCUTILS-$(CONFIG_RX)                        += rx.o
- MISCUTILS-$(CONFIG_STRINGS)           += strings.o
- MISCUTILS-$(CONFIG_TIME)              += time.o
-diff -urN busybox-dist/miscutils/resetmon.c busybox/miscutils/resetmon.c
---- busybox-dist/miscutils/resetmon.c  1969-12-31 18:00:00.000000000 -0600
-+++ busybox/miscutils/resetmon.c       2004-03-16 10:00:14.000000000 -0600
-@@ -0,0 +1,30 @@
-+#include <unistd.h>
-+#include <fcntl.h>
-+#include "busybox.h"
-+
-+#define RESET (1<<6) 
-+
-+int resetmon_main(int argc, char **argv) {
-+      int fd = -1;
-+      unsigned int val=0;
-+
-+#if 0
-+      if ((fd = open("/dev/gpio/control",O_RDWR))<0) goto error;
-+      read(fd,&val,4);
-+      val|=RESET;
-+      write(fd,&val,4);
-+
-+      if ((fd = open("/dev/gpio/outen",O_RDWR))<0) goto error;
-+      read(fd,&val,4);
-+      val&=~RESET;
-+      write(fd,&val,4);
-+#endif
-+
-+      if ((fd = open("/dev/gpio/in",O_RDONLY))<0) goto error;
-+      read(fd,&val,4);
-+      
-+      return !(val&RESET);
-+
-+error:
-+      return 1;
-+}
diff --git a/obsolete-buildroot/sources/busybox.config b/obsolete-buildroot/sources/busybox.config
deleted file mode 100644 (file)
index 2d7c51f..0000000
+++ /dev/null
@@ -1,459 +0,0 @@
-#
-# Automatically generated make config: don't edit
-#
-HAVE_DOT_CONFIG=y
-
-#
-# General Configuration
-#
-# CONFIG_FEATURE_BUFFERS_USE_MALLOC is not set
-CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y
-# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
-CONFIG_FEATURE_VERBOSE_USAGE=y
-# CONFIG_FEATURE_INSTALLER is not set
-# CONFIG_LOCALE_SUPPORT is not set
-CONFIG_FEATURE_DEVFS=y
-CONFIG_FEATURE_DEVPTS=y
-# CONFIG_FEATURE_CLEAN_UP is not set
-# CONFIG_FEATURE_SUID is not set
-# CONFIG_SELINUX is not set
-
-#
-# Build Options
-#
-# CONFIG_STATIC is not set
-CONFIG_LFS=y
-USING_CROSS_COMPILER=y
-CROSS_COMPILER_PREFIX="mipsel-uclibc-"
-EXTRA_CFLAGS_OPTIONS="-Os "
-
-#
-# Installation Options
-#
-# CONFIG_INSTALL_NO_USR is not set
-PREFIX="./_install"
-
-#
-# Archival Utilities
-#
-# CONFIG_AR is not set
-CONFIG_BUNZIP2=y
-# CONFIG_CPIO is not set
-# CONFIG_DPKG is not set
-# CONFIG_DPKG_DEB is not set
-CONFIG_GUNZIP=y
-CONFIG_FEATURE_GUNZIP_UNCOMPRESS=y
-CONFIG_GZIP=y
-# CONFIG_RPM2CPIO is not set
-# CONFIG_RPM is not set
-CONFIG_TAR=y
-CONFIG_FEATURE_TAR_CREATE=y
-CONFIG_FEATURE_TAR_BZIP2=y
-# CONFIG_FEATURE_TAR_FROM is not set
-CONFIG_FEATURE_TAR_GZIP=y
-# CONFIG_FEATURE_TAR_COMPRESS is not set
-# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
-CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
-# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set
-# CONFIG_UNCOMPRESS is not set
-# CONFIG_UNZIP is not set
-
-#
-# Common options for cpio and tar
-#
-# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
-
-#
-# Coreutils
-#
-CONFIG_BASENAME=y
-# CONFIG_CAL is not set
-CONFIG_CAT=y
-CONFIG_CHGRP=y
-CONFIG_CHMOD=y
-CONFIG_CHOWN=y
-CONFIG_CHROOT=y
-# CONFIG_CMP is not set
-CONFIG_CP=y
-CONFIG_CUT=y
-CONFIG_DATE=y
-CONFIG_FEATURE_DATE_ISOFMT=y
-CONFIG_DD=y
-CONFIG_DF=y
-# CONFIG_DIRNAME is not set
-# CONFIG_DOS2UNIX is not set
-# CONFIG_DU is not set
-CONFIG_ECHO=y
-CONFIG_FEATURE_FANCY_ECHO=y
-CONFIG_ENV=y
-CONFIG_EXPR=y
-CONFIG_FALSE=y
-# CONFIG_FOLD is not set
-CONFIG_HEAD=y
-# CONFIG_FEATURE_FANCY_HEAD is not set
-CONFIG_HOSTID=y
-# CONFIG_ID is not set
-CONFIG_INSTALL=y
-CONFIG_LENGTH=y
-CONFIG_LN=y
-# CONFIG_LOGNAME is not set
-CONFIG_LS=y
-CONFIG_FEATURE_LS_FILETYPES=y
-CONFIG_FEATURE_LS_FOLLOWLINKS=y
-CONFIG_FEATURE_LS_RECURSIVE=y
-CONFIG_FEATURE_LS_SORTFILES=y
-CONFIG_FEATURE_LS_TIMESTAMPS=y
-CONFIG_FEATURE_LS_USERNAME=y
-CONFIG_FEATURE_LS_COLOR=y
-CONFIG_MD5SUM=y
-CONFIG_MKDIR=y
-CONFIG_MKFIFO=y
-# CONFIG_MKNOD is not set
-CONFIG_MV=y
-# CONFIG_OD is not set
-# CONFIG_PRINTF is not set
-CONFIG_PWD=y
-# CONFIG_REALPATH is not set
-CONFIG_RM=y
-CONFIG_RMDIR=y
-# CONFIG_SEQ is not set
-# CONFIG_SHA1SUM is not set
-CONFIG_SLEEP=y
-CONFIG_FEATURE_FANCY_SLEEP=y
-CONFIG_SORT=y
-# CONFIG_STTY is not set
-CONFIG_SYNC=y
-CONFIG_TAIL=y
-CONFIG_FEATURE_FANCY_TAIL=y
-CONFIG_TEE=y
-CONFIG_FEATURE_TEE_USE_BLOCK_IO=y
-CONFIG_TEST=y
-
-#
-# test (forced enabled for use with shell)
-#
-CONFIG_TOUCH=y
-# CONFIG_TR is not set
-CONFIG_TRUE=y
-# CONFIG_TTY is not set
-CONFIG_UNAME=y
-CONFIG_UNIQ=y
-# CONFIG_USLEEP is not set
-# CONFIG_UUDECODE is not set
-# CONFIG_UUENCODE is not set
-# CONFIG_WATCH is not set
-CONFIG_WC=y
-# CONFIG_WHO is not set
-# CONFIG_WHOAMI is not set
-CONFIG_YES=y
-
-#
-# Common options for cp and mv
-#
-CONFIG_FEATURE_PRESERVE_HARDLINKS=y
-
-#
-# Common options for ls and more
-#
-CONFIG_FEATURE_AUTOWIDTH=y
-
-#
-# Common options for df, du, ls
-#
-CONFIG_FEATURE_HUMAN_READABLE=y
-
-#
-# Common options for md5sum, sha1sum
-#
-CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y
-
-#
-# Console Utilities
-#
-# CONFIG_CHVT is not set
-CONFIG_CLEAR=y
-# CONFIG_DEALLOCVT is not set
-# CONFIG_DUMPKMAP is not set
-# CONFIG_LOADFONT is not set
-# CONFIG_LOADKMAP is not set
-# CONFIG_OPENVT is not set
-CONFIG_RESET=y
-# CONFIG_SETKEYCODES is not set
-
-#
-# Debian Utilities
-#
-CONFIG_MKTEMP=y
-# CONFIG_PIPE_PROGRESS is not set
-# CONFIG_READLINK is not set
-CONFIG_RUN_PARTS=y
-# CONFIG_START_STOP_DAEMON is not set
-CONFIG_WHICH=y
-
-#
-# Editors
-#
-CONFIG_AWK=y
-CONFIG_FEATURE_AWK_MATH=y
-# CONFIG_PATCH is not set
-CONFIG_SED=y
-CONFIG_VI=y
-CONFIG_FEATURE_VI_COLON=y
-CONFIG_FEATURE_VI_YANKMARK=y
-CONFIG_FEATURE_VI_SEARCH=y
-CONFIG_FEATURE_VI_USE_SIGNALS=y
-CONFIG_FEATURE_VI_DOT_CMD=y
-CONFIG_FEATURE_VI_READONLY=y
-CONFIG_FEATURE_VI_SETOPTS=y
-CONFIG_FEATURE_VI_SET=y
-CONFIG_FEATURE_VI_WIN_RESIZE=y
-CONFIG_FEATURE_VI_OPTIMIZE_CURSOR=y
-
-#
-# Finding Utilities
-#
-CONFIG_FIND=y
-# CONFIG_FEATURE_FIND_MTIME is not set
-CONFIG_FEATURE_FIND_PERM=y
-CONFIG_FEATURE_FIND_TYPE=y
-CONFIG_FEATURE_FIND_XDEV=y
-# CONFIG_FEATURE_FIND_NEWER is not set
-# CONFIG_FEATURE_FIND_INUM is not set
-CONFIG_GREP=y
-CONFIG_FEATURE_GREP_EGREP_ALIAS=y
-CONFIG_FEATURE_GREP_FGREP_ALIAS=y
-CONFIG_FEATURE_GREP_CONTEXT=y
-CONFIG_XARGS=y
-CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y
-CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y
-CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y
-CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y
-
-#
-# Init Utilities
-#
-CONFIG_INIT=y
-CONFIG_FEATURE_USE_INITTAB=y
-# CONFIG_FEATURE_INITRD is not set
-# CONFIG_FEATURE_INIT_COREDUMPS is not set
-# CONFIG_FEATURE_EXTRA_QUIET is not set
-# CONFIG_HALT is not set
-# CONFIG_POWEROFF is not set
-CONFIG_REBOOT=y
-CONFIG_MESG=y
-
-#
-# Login/Password Management Utilities
-#
-# CONFIG_USE_BB_PWD_GRP is not set
-# CONFIG_ADDGROUP is not set
-# CONFIG_DELGROUP is not set
-# CONFIG_ADDUSER is not set
-# CONFIG_DELUSER is not set
-# CONFIG_GETTY is not set
-# CONFIG_LOGIN is not set
-CONFIG_PASSWD=y
-# CONFIG_SU is not set
-# CONFIG_SULOGIN is not set
-# CONFIG_VLOCK is not set
-
-#
-# Miscellaneous Utilities
-#
-# CONFIG_ADJTIMEX is not set
-CONFIG_CROND=y
-# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
-CONFIG_CRONTAB=y
-# CONFIG_DC is not set
-# CONFIG_DEVFSD is not set
-# CONFIG_LAST is not set
-# CONFIG_HDPARM is not set
-# CONFIG_MAKEDEVS is not set
-# CONFIG_MT is not set
-CONFIG_RESETMON=y
-# CONFIG_RX is not set
-CONFIG_STRINGS=y
-CONFIG_TIME=y
-# CONFIG_WATCHDOG is not set
-
-#
-# Linux Module Utilities
-#
-CONFIG_INSMOD=y
-CONFIG_FEATURE_2_4_MODULES=y
-# CONFIG_FEATURE_2_6_MODULES is not set
-# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
-# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
-# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
-# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
-CONFIG_LSMOD=y
-CONFIG_FEATURE_QUERY_MODULE_INTERFACE=y
-# CONFIG_MODPROBE is not set
-CONFIG_RMMOD=y
-# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set
-
-#
-# Networking Utilities
-#
-CONFIG_FEATURE_IPV6=y
-CONFIG_ARPING=y
-# CONFIG_FTPGET is not set
-# CONFIG_FTPPUT is not set
-# CONFIG_HOSTNAME is not set
-CONFIG_HTTPD=y
-# CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY is not set
-CONFIG_FEATURE_HTTPD_BASIC_AUTH=y
-CONFIG_FEATURE_HTTPD_AUTH_MD5=y
-CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP=y
-# CONFIG_FEATURE_HTTPD_SETUID is not set
-CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES=y
-CONFIG_FEATURE_HTTPD_CGI=y
-CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV=y
-CONFIG_FEATURE_HTTPD_ENCODE_URL_STR=y
-CONFIG_IFCONFIG=y
-CONFIG_FEATURE_IFCONFIG_STATUS=y
-# CONFIG_FEATURE_IFCONFIG_SLIP is not set
-# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
-CONFIG_FEATURE_IFCONFIG_HW=y
-CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y
-# CONFIG_IFUPDOWN is not set
-# CONFIG_INETD is not set
-# CONFIG_IP is not set
-CONFIG_IPCALC=y
-CONFIG_FEATURE_IPCALC_FANCY=y
-# CONFIG_IPADDR is not set
-# CONFIG_IPLINK is not set
-# CONFIG_IPROUTE is not set
-# CONFIG_IPTUNNEL is not set
-# CONFIG_NAMEIF is not set
-CONFIG_NC=y
-CONFIG_NETSTAT=y
-CONFIG_NSLOOKUP=y
-CONFIG_PING=y
-CONFIG_FEATURE_FANCY_PING=y
-CONFIG_PING6=y
-CONFIG_FEATURE_FANCY_PING6=y
-CONFIG_ROUTE=y
-# CONFIG_TELNET is not set
-CONFIG_TELNETD=y
-# CONFIG_FEATURE_TELNETD_INETD is not set
-# CONFIG_TFTP is not set
-CONFIG_TRACEROUTE=y
-CONFIG_FEATURE_TRACEROUTE_VERBOSE=y
-CONFIG_VCONFIG=y
-CONFIG_WGET=y
-CONFIG_FEATURE_WGET_STATUSBAR=y
-CONFIG_FEATURE_WGET_AUTHENTICATION=y
-CONFIG_FEATURE_WGET_IP6_LITERAL=y
-
-#
-# udhcp Server/Client
-#
-# CONFIG_UDHCPD is not set
-CONFIG_UDHCPC=y
-# CONFIG_FEATURE_UDHCP_SYSLOG is not set
-# CONFIG_FEATURE_UDHCP_DEBUG is not set
-
-#
-# Process Utilities
-#
-CONFIG_FREE=y
-CONFIG_KILL=y
-CONFIG_KILLALL=y
-CONFIG_KILLALL5=y
-CONFIG_PIDOF=y
-CONFIG_PS=y
-# CONFIG_RENICE is not set
-CONFIG_TOP=y
-FEATURE_CPU_USAGE_PERCENTAGE=y
-CONFIG_UPTIME=y
-CONFIG_SYSCTL=y
-
-#
-# Another Bourne-like Shell
-#
-CONFIG_FEATURE_SH_IS_ASH=y
-# CONFIG_FEATURE_SH_IS_HUSH is not set
-# CONFIG_FEATURE_SH_IS_LASH is not set
-# CONFIG_FEATURE_SH_IS_MSH is not set
-# CONFIG_FEATURE_SH_IS_NONE is not set
-CONFIG_ASH=y
-
-#
-# Ash Shell Options
-#
-CONFIG_ASH_JOB_CONTROL=y
-CONFIG_ASH_ALIAS=y
-CONFIG_ASH_MATH_SUPPORT=y
-# CONFIG_ASH_MATH_SUPPORT_64 is not set
-CONFIG_ASH_GETOPTS=y
-CONFIG_ASH_CMDCMD=y
-# CONFIG_ASH_MAIL is not set
-CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
-# CONFIG_ASH_RANDOM_SUPPORT is not set
-# CONFIG_HUSH is not set
-# CONFIG_LASH is not set
-# CONFIG_MSH is not set
-
-#
-# Bourne Shell Options
-#
-# CONFIG_FEATURE_SH_EXTRA_QUIET is not set
-# CONFIG_FEATURE_SH_STANDALONE_SHELL is not set
-CONFIG_FEATURE_COMMAND_EDITING=y
-CONFIG_FEATURE_COMMAND_HISTORY=15
-# CONFIG_FEATURE_COMMAND_SAVEHISTORY is not set
-CONFIG_FEATURE_COMMAND_TAB_COMPLETION=y
-# CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION is not set
-CONFIG_FEATURE_SH_FANCY_PROMPT=y
-
-#
-# System Logging Utilities
-#
-CONFIG_SYSLOGD=y
-CONFIG_FEATURE_ROTATE_LOGFILE=y
-CONFIG_FEATURE_REMOTE_LOG=y
-CONFIG_FEATURE_IPC_SYSLOG=y
-CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=16
-CONFIG_LOGREAD=y
-# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set
-CONFIG_KLOGD=y
-CONFIG_LOGGER=y
-
-#
-# Linux System Utilities
-#
-CONFIG_DMESG=y
-# CONFIG_FBSET is not set
-# CONFIG_FDFLUSH is not set
-# CONFIG_FDFORMAT is not set
-# CONFIG_FDISK is not set
-FDISK_SUPPORT_LARGE_DISKS=y
-# CONFIG_FREERAMDISK is not set
-# CONFIG_FSCK_MINIX is not set
-# CONFIG_MKFS_MINIX is not set
-# CONFIG_GETOPT is not set
-CONFIG_HEXDUMP=y
-# CONFIG_HWCLOCK is not set
-# CONFIG_LOSETUP is not set
-# CONFIG_MKSWAP is not set
-CONFIG_MORE=y
-CONFIG_FEATURE_USE_TERMIOS=y
-CONFIG_PIVOT_ROOT=y
-CONFIG_RDATE=y
-# CONFIG_SWAPONOFF is not set
-CONFIG_MOUNT=y
-CONFIG_NFSMOUNT=y
-CONFIG_UMOUNT=y
-CONFIG_FEATURE_MOUNT_FORCE=y
-
-#
-# Common options for mount/umount
-#
-CONFIG_FEATURE_MOUNT_LOOP=y
-# CONFIG_FEATURE_MTAB_SUPPORT is not set
-
-#
-# Debugging Options
-#
-# CONFIG_DEBUG is not set
diff --git a/obsolete-buildroot/sources/compressed-20040531.tar.bz2 b/obsolete-buildroot/sources/compressed-20040531.tar.bz2
deleted file mode 100644 (file)
index c8e06b8..0000000
Binary files a/obsolete-buildroot/sources/compressed-20040531.tar.bz2 and /dev/null differ
diff --git a/obsolete-buildroot/sources/cramfs.patch b/obsolete-buildroot/sources/cramfs.patch
deleted file mode 100644 (file)
index 884eb8c..0000000
+++ /dev/null
@@ -1,1269 +0,0 @@
---- cramfs-1.1.orig/cramfsck.c 2002-02-22 17:00:42.000000000 -0700
-+++ cramfs-1.1/cramfsck.c      2002-12-21 01:25:17.000000000 -0700
-@@ -51,10 +51,11 @@
- #include <utime.h>
- #include <sys/ioctl.h>
- #define _LINUX_STRING_H_
--#include <linux/fs.h>
--#include <linux/cramfs_fs.h>
-+#include "linux/cramfs_fs.h"
- #include <zlib.h>
-+#define BLKGETSIZE    _IO(0x12,96) /* return device size /512 (long *arg) */
-+
- /* Exit codes used by fsck-type programs */
- #define FSCK_OK          0    /* No errors */
- #define FSCK_NONDESTRUCT 1    /* File system errors corrected */
-@@ -75,7 +76,7 @@
- static int opt_verbose = 0;   /* 1 = verbose (-v), 2+ = very verbose (-vv) */
- #ifdef INCLUDE_FS_TESTS
- static int opt_extract = 0;           /* extract cramfs (-x) */
--static char *extract_dir = "root";    /* extraction directory (-x) */
-+static char *extract_dir = "/";       /* extraction directory (-x) */
- static uid_t euid;                    /* effective UID */
- /* (cramfs_super + start) <= start_dir < end_dir <= start_data <= end_data */
-@@ -155,7 +156,7 @@
-       }
-       if (*length < sizeof(struct cramfs_super)) {
--              die(FSCK_UNCORRECTED, 0, "file length too short");
-+              die(FSCK_UNCORRECTED, 0, "filesystem smaller than a cramfs superblock!");
-       }
-       /* find superblock */
-@@ -190,7 +191,8 @@
-                       die(FSCK_UNCORRECTED, 0, "zero file count");
-               }
-               if (*length < super.size) {
--                      die(FSCK_UNCORRECTED, 0, "file length too short");
-+                      die(FSCK_UNCORRECTED, 0, "file length too short, %lu is smaller than %lu",
-+                              *length, super.size);
-               }
-               else if (*length > super.size) {
-                       fprintf(stderr, "warning: file extends past end of filesystem\n");
-@@ -267,11 +269,11 @@
- #ifdef INCLUDE_FS_TESTS
- static void print_node(char type, struct cramfs_inode *i, char *name)
- {
--      char info[10];
-+      char info[11];
-       if (S_ISCHR(i->mode) || (S_ISBLK(i->mode))) {
-               /* major/minor numbers can be as high as 2^12 or 4096 */
--              snprintf(info, 10, "%4d,%4d", major(i->size), minor(i->size));
-+              snprintf(info, 11, "%4d,%4d", major(i->size), minor(i->size));
-       }
-       else {
-               /* size be as high as 2^24 or 16777216 */
-@@ -445,8 +447,10 @@
-       }
-       /* TODO: Do we need to check end_dir for empty case? */
-       memcpy(newpath, path, pathlen);
--      newpath[pathlen] = '/';
--      pathlen++;
-+      if (pathlen > 1) {
-+          newpath[pathlen] = '/';
-+          pathlen++;
-+      }
-       if (opt_verbose) {
-               print_node('d', i, path);
-       }
---- cramfs-1.1.orig/device_table.txt   1969-12-31 17:00:00.000000000 -0700
-+++ cramfs-1.1/device_table.txt        2003-01-01 05:13:44.000000000 -0700
-@@ -0,0 +1,129 @@
-+# When building a target filesystem, it is desirable to not have to
-+# become root and then run 'mknod' a thousand times.  Using a device 
-+# table you can create device nodes and directories "on the fly".
-+#
-+# This is a sample device table file for use with mkcramfs.  You can
-+# do all sorts of interesting things with a device table file.  For
-+# example, if you want to adjust the permissions on a particular file
-+# you can just add an entry like:
-+#   /sbin/foobar      f       2755    0       0       -       -       -       -       -
-+# and (assuming the file /sbin/foobar exists) it will be made setuid
-+# root (regardless of what its permissions are on the host filesystem.
-+# Furthermore, you can use a single table entry to create a many device
-+# minors.  For example, if I wanted to create /dev/hda and /dev/hda[0-15]
-+# I could just use the following two table entries:
-+#   /dev/hda  b       640     0       0       3       0       0       0       -
-+#   /dev/hda  b       640     0       0       3       1       1       1       15
-+# 
-+# Device table entries take the form of:
-+# <name>    <type>    <mode>  <uid>   <gid>   <major> <minor> <start> <inc>   <count>
-+# where name is the file name,  type can be one of: 
-+#     f       A regular file
-+#     d       Directory
-+#     c       Character special device file
-+#     b       Block special device file
-+#     p       Fifo (named pipe)
-+# uid is the user id for the target file, gid is the group id for the
-+# target file.  The rest of the entries (major, minor, etc) apply only 
-+# to device special files.
-+
-+# Have fun
-+# -Erik Andersen <andersen@codepoet.org>
-+#
-+
-+#<name>               <type>  <mode>  <uid>   <gid>   <major> <minor> <start> <inc>   <count>
-+/dev          d       755     0       0       -       -       -       -       -
-+/dev/mem      c       640     0       0       1       1       0       0       -
-+/dev/kmem     c       640     0       0       1       2       0       0       -
-+/dev/null     c       640     0       0       1       3       0       0       -
-+/dev/zero     c       640     0       0       1       5       0       0       -
-+/dev/random   c       640     0       0       1       8       0       0       -
-+/dev/urandom  c       640     0       0       1       9       0       0       -
-+/dev/tty      c       666     0       0       5       0       0       0       -
-+/dev/tty      c       666     0       0       4       0       0       1       6
-+/dev/console  c       640     0       0       5       1       0       0       -
-+/dev/ram      b       640     0       0       1       1       0       0       -
-+/dev/ram      b       640     0       0       1       0       0       1       4
-+/dev/loop     b       640     0       0       7       0       0       1       2
-+/dev/ptmx     c       666     0       0       5       2       0       0       -
-+#/dev/ttyS    c       640     0       0       4       64      0       1       4
-+#/dev/psaux   c       640     0       0       10      1       0       0       -
-+#/dev/rtc     c       640     0       0       10      135     0       0       -
-+
-+# Adjust permissions on some normal files
-+#/etc/shadow  f       600     0       0       -       -       -       -       -
-+#/bin/tinylogin       f       4755    0       0       -       -       -       -       -
-+
-+# User-mode Linux stuff
-+/dev/ubda     b       640     0       0       98      0       0       0       -
-+/dev/ubda     b       640     0       0       98      1       1       1       15
-+
-+# IDE Devices
-+/dev/hda      b       640     0       0       3       0       0       0       -
-+/dev/hda      b       640     0       0       3       1       1       1       15
-+/dev/hdb      b       640     0       0       3       64      0       0       -
-+/dev/hdb      b       640     0       0       3       65      1       1       15
-+#/dev/hdc     b       640     0       0       22      0       0       0       -
-+#/dev/hdc     b       640     0       0       22      1       1       1       15
-+#/dev/hdd     b       640     0       0       22      64      0       0       -
-+#/dev/hdd     b       640     0       0       22      65      1       1       15
-+#/dev/hde     b       640     0       0       33      0       0       0       -
-+#/dev/hde     b       640     0       0       33      1       1       1       15
-+#/dev/hdf     b       640     0       0       33      64      0       0       -
-+#/dev/hdf     b       640     0       0       33      65      1       1       15
-+#/dev/hdg     b       640     0       0       34      0       0       0       -
-+#/dev/hdg     b       640     0       0       34      1       1       1       15
-+#/dev/hdh     b       640     0       0       34      64      0       0       -
-+#/dev/hdh     b       640     0       0       34      65      1       1       15
-+
-+# SCSI Devices
-+#/dev/sda     b       640     0       0       8       0       0       0       -
-+#/dev/sda     b       640     0       0       8       1       1       1       15
-+#/dev/sdb     b       640     0       0       8       16      0       0       -
-+#/dev/sdb     b       640     0       0       8       17      1       1       15
-+#/dev/sdc     b       640     0       0       8       32      0       0       -
-+#/dev/sdc     b       640     0       0       8       33      1       1       15
-+#/dev/sdd     b       640     0       0       8       48      0       0       -
-+#/dev/sdd     b       640     0       0       8       49      1       1       15
-+#/dev/sde     b       640     0       0       8       64      0       0       -
-+#/dev/sde     b       640     0       0       8       65      1       1       15
-+#/dev/sdf     b       640     0       0       8       80      0       0       -
-+#/dev/sdf     b       640     0       0       8       81      1       1       15
-+#/dev/sdg     b       640     0       0       8       96      0       0       -
-+#/dev/sdg     b       640     0       0       8       97      1       1       15
-+#/dev/sdh     b       640     0       0       8       112     0       0       -
-+#/dev/sdh     b       640     0       0       8       113     1       1       15
-+#/dev/sg              c       640     0       0       21      0       0       1       15
-+#/dev/scd     b       640     0       0       11      0       0       1       15
-+#/dev/st              c       640     0       0       9       0       0       1       8
-+#/dev/nst     c       640     0       0       9       128     0       1       8
-+#/dev/st      c       640     0       0       9       32      1       1       4
-+#/dev/st      c       640     0       0       9       64      1       1       4
-+#/dev/st      c       640     0       0       9       96      1       1       4
-+
-+# Floppy disk devices
-+#/dev/fd              b       640     0       0       2       0       0       1       2
-+#/dev/fd0d360 b       640     0       0       2       4       0       0       -
-+#/dev/fd1d360 b       640     0       0       2       5       0       0       -
-+#/dev/fd0h1200        b       640     0       0       2       8       0       0       -
-+#/dev/fd1h1200        b       640     0       0       2       9       0       0       -
-+#/dev/fd0u1440        b       640     0       0       2       28      0       0       -
-+#/dev/fd1u1440        b       640     0       0       2       29      0       0       -
-+#/dev/fd0u2880        b       640     0       0       2       32      0       0       -
-+#/dev/fd1u2880        b       640     0       0       2       33      0       0       -
-+
-+# All the proprietary cdrom devices in the world
-+#/dev/aztcd   b       640     0       0       29      0       0       0       -
-+#/dev/bpcd    b       640     0       0       41      0       0       0       -
-+#/dev/capi20  c       640     0       0       68      0       0       1       2
-+#/dev/cdu31a  b       640     0       0       15      0       0       0       -
-+#/dev/cdu535  b       640     0       0       24      0       0       0       -
-+#/dev/cm206cd b       640     0       0       32      0       0       0       -
-+#/dev/sjcd    b       640     0       0       18      0       0       0       -
-+#/dev/sonycd  b       640     0       0       15      0       0       0       -
-+#/dev/gscd    b       640     0       0       16      0       0       0       -
-+#/dev/sbpcd   b       640     0       0       25      0       0       0       -
-+#/dev/sbpcd   b       640     0       0       25      0       0       1       4
-+#/dev/mcd     b       640     0       0       23      0       0       0       -
-+#/dev/optcd   b       640     0       0       17      0       0       0       -
-+
---- cramfs-1.1.orig/mkcramfs.c 2002-02-20 01:03:32.000000000 -0700
-+++ cramfs-1.1/mkcramfs.c      2002-12-21 01:25:17.000000000 -0700
-@@ -1,3 +1,4 @@
-+/* vi: set sw=8 ts=8: */
- /*
-  * mkcramfs - make a cramfs file system
-  *
-@@ -16,12 +17,21 @@
-  * You should have received a copy of the GNU General Public License
-  * along with this program; if not, write to the Free Software
-  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-+ *
-+ * Added device table support (code taken from mkfs.jffs2.c, credit to
-+ * Erik Andersen <andersen@codepoet.org>) as well as an option to squash
-+ * permissions. - Russ Dill <Russ.Dill@asu.edu> September 2002
-+ *
-+ * Reworked, cleaned up, and updated for cramfs-1.1, December 2002
-+ *  - Erik Andersen <andersen@codepoet.org>
-+ *
-  */
- /*
-  * If you change the disk format of cramfs, please update fs/cramfs/README.
-  */
-+#define _GNU_SOURCE
- #include <sys/types.h>
- #include <stdio.h>
- #include <sys/stat.h>
-@@ -33,8 +43,15 @@
- #include <errno.h>
- #include <string.h>
- #include <stdarg.h>
-+#include <libgen.h>
-+#include <ctype.h>
-+#include <assert.h>
-+#include <getopt.h>
- #include <linux/cramfs_fs.h>
- #include <zlib.h>
-+#ifdef DMALLOC
-+#include <dmalloc.h>
-+#endif
- /* Exit codes used by mkfs-type programs */
- #define MKFS_OK          0    /* No errors */
-@@ -71,11 +88,17 @@
-                 + (1 << CRAMFS_SIZE_WIDTH) - 1 /* filesize */ \
-                 + (1 << CRAMFS_SIZE_WIDTH) * 4 / PAGE_CACHE_SIZE /* block pointers */ )
-+
-+/* The kernel assumes PAGE_CACHE_SIZE as block size. */
-+#define PAGE_CACHE_SIZE (4096)
-+
-+
- static const char *progname = "mkcramfs";
- static unsigned int blksize = PAGE_CACHE_SIZE;
- static long total_blocks = 0, total_nodes = 1; /* pre-count the root node */
- static int image_length = 0;
-+
- /*
-  * If opt_holes is set, then mkcramfs can create explicit holes in the
-  * data, which saves 26 bytes per hole (which is a lot smaller a
-@@ -91,10 +114,12 @@
- static int opt_holes = 0;
- static int opt_pad = 0;
- static int opt_verbose = 0;
-+static int opt_squash = 0;
- static char *opt_image = NULL;
- static char *opt_name = NULL;
- static int warn_dev, warn_gid, warn_namelen, warn_skip, warn_size, warn_uid;
-+static const char *const memory_exhausted = "memory exhausted";
- /* In-core version of inode / directory entry. */
- struct entry {
-@@ -123,7 +148,7 @@
- {
-       FILE *stream = status ? stderr : stdout;
--      fprintf(stream, "usage: %s [-h] [-e edition] [-i file] [-n name] dirname outfile\n"
-+      fprintf(stream, "usage: %s [-h] [-e edition] [-i file] [-n name] [-D file] dirname outfile\n"
-               " -h         print this help\n"
-               " -E         make all warnings errors (non-zero exit status)\n"
-               " -e edition set edition number (part of fsid)\n"
-@@ -133,39 +158,157 @@
-               " -s         sort directory entries (old option, ignored)\n"
-               " -v         be more verbose\n"
-               " -z         make explicit holes (requires >= 2.3.39)\n"
--              " dirname    root of the directory tree to be compressed\n"
-+              " -D         Use the named FILE as a device table file\n"
-+              " -q         squash permissions (make everything owned by root)\n"
-+              " dirname    root of the filesystem to be compressed\n"
-               " outfile    output file\n", progname, PAD_SIZE);
-       exit(status);
- }
--static void die(int status, int syserr, const char *fmt, ...)
-+static void verror_msg(const char *s, va_list p)
-+{
-+      fflush(stdout);
-+      fprintf(stderr, "mkcramfs: ");
-+      vfprintf(stderr, s, p);
-+}
-+
-+static void vperror_msg(const char *s, va_list p)
-+{
-+      int err = errno;
-+
-+      if (s == 0)
-+              s = "";
-+      verror_msg(s, p);
-+      if (*s)
-+              s = ": ";
-+      fprintf(stderr, "%s%s\n", s, strerror(err));
-+}
-+
-+static void perror_msg(const char *s, ...)
-+{
-+      va_list p;
-+
-+      va_start(p, s);
-+      vperror_msg(s, p);
-+      va_end(p);
-+}
-+
-+static void error_msg_and_die(const char *s, ...)
-+{
-+      va_list p;
-+
-+      va_start(p, s);
-+      verror_msg(s, p);
-+      va_end(p);
-+      putc('\n', stderr);
-+      exit(MKFS_ERROR);
-+}
-+
-+static void perror_msg_and_die(const char *s, ...)
-+{
-+      va_list p;
-+
-+      va_start(p, s);
-+      vperror_msg(s, p);
-+      va_end(p);
-+      exit(MKFS_ERROR);
-+}
-+#ifndef DMALLOC
-+extern char *xstrdup(const char *s)
-+{
-+      char *t;
-+
-+      if (s == NULL)
-+              return NULL;
-+      t = strdup(s);
-+      if (t == NULL)
-+              error_msg_and_die(memory_exhausted);
-+      return t;
-+}
-+
-+extern void *xmalloc(size_t size)
-+{
-+      void *ptr = malloc(size);
-+
-+      if (ptr == NULL && size != 0)
-+              error_msg_and_die(memory_exhausted);
-+      return ptr;
-+}
-+
-+extern void *xcalloc(size_t nmemb, size_t size)
-+{
-+      void *ptr = calloc(nmemb, size);
-+
-+      if (ptr == NULL && nmemb != 0 && size != 0)
-+              error_msg_and_die(memory_exhausted);
-+      return ptr;
-+}
-+
-+extern void *xrealloc(void *ptr, size_t size)
-+{
-+      ptr = realloc(ptr, size);
-+      if (ptr == NULL && size != 0)
-+              error_msg_and_die(memory_exhausted);
-+      return ptr;
-+}
-+#endif
-+
-+static FILE *xfopen(const char *path, const char *mode)
- {
--      va_list arg_ptr;
--      int save = errno;
-+      FILE *fp;
-+
-+      if ((fp = fopen(path, mode)) == NULL)
-+              perror_msg_and_die("%s", path);
-+      return fp;
-+}
--      fflush(0);
--      va_start(arg_ptr, fmt);
--      fprintf(stderr, "%s: ", progname);
--      vfprintf(stderr, fmt, arg_ptr);
--      if (syserr) {
--              fprintf(stderr, ": %s", strerror(save));
-+extern int xopen(const char *pathname, int flags, mode_t mode)
-+{
-+      int ret;
-+      
-+      if (flags & O_CREAT)
-+              ret = open(pathname, flags, mode);
-+      else
-+              ret = open(pathname, flags);
-+      if (ret == -1) {
-+              perror_msg_and_die("%s", pathname);
-       }
--      fprintf(stderr, "\n");
--      va_end(arg_ptr);
--      exit(status);
-+      return ret;
- }
-+extern char *xreadlink(const char *path)
-+{                       
-+      static const int GROWBY = 80; /* how large we will grow strings by */
-+
-+      char *buf = NULL;   
-+      int bufsize = 0, readsize = 0;
-+
-+      do {
-+              buf = xrealloc(buf, bufsize += GROWBY);
-+              readsize = readlink(path, buf, bufsize); /* 1st try */
-+              if (readsize == -1) {
-+                  perror_msg("%s:%s", progname, path);
-+                  return NULL;
-+              }
-+      }           
-+      while (bufsize < readsize + 1);
-+
-+      buf[readsize] = '\0';
-+
-+      return buf;
-+}       
-+
- static void map_entry(struct entry *entry)
- {
-       if (entry->path) {
-               entry->fd = open(entry->path, O_RDONLY);
-               if (entry->fd < 0) {
--                      die(MKFS_ERROR, 1, "open failed: %s", entry->path);
-+                      error_msg_and_die("open failed: %s", entry->path);
-               }
-               entry->uncompressed = mmap(NULL, entry->size, PROT_READ, MAP_PRIVATE, entry->fd, 0);
-               if (entry->uncompressed == MAP_FAILED) {
--                      die(MKFS_ERROR, 1, "mmap failed: %s", entry->path);
-+                      error_msg_and_die("mmap failed: %s", entry->path);
-               }
-       }
- }
-@@ -174,8 +317,9 @@
- {
-       if (entry->path) {
-               if (munmap(entry->uncompressed, entry->size) < 0) {
--                      die(MKFS_ERROR, 1, "munmap failed: %s", entry->path);
-+                      error_msg_and_die("munmap failed: %s", entry->path);
-               }
-+              entry->uncompressed=NULL;
-               close(entry->fd);
-       }
- }
-@@ -204,7 +348,8 @@
-               find_identical_file(orig->next, newfile));
- }
--static void eliminate_doubles(struct entry *root, struct entry *orig) {
-+static void eliminate_doubles(struct entry *root, struct entry *orig) 
-+{
-       if (orig) {
-               if (orig->size && (orig->path || orig->uncompressed))
-                       find_identical_file(root, orig);
-@@ -232,10 +377,7 @@
-       /* Set up the path. */
-       /* TODO: Reuse the parent's buffer to save memcpy'ing and duplication. */
--      path = malloc(len + 1 + MAX_INPUT_NAMELEN + 1);
--      if (!path) {
--              die(MKFS_ERROR, 1, "malloc failed");
--      }
-+      path = xmalloc(len + 1 + MAX_INPUT_NAMELEN + 1);
-       memcpy(path, name, len);
-       endpath = path + len;
-       *endpath = '/';
-@@ -245,7 +387,7 @@
-       dircount = scandir(name, &dirlist, 0, cramsort);
-       if (dircount < 0) {
--              die(MKFS_ERROR, 1, "scandir failed: %s", name);
-+              error_msg_and_die("scandir failed: %s", name);
-       }
-       /* process directory */
-@@ -269,25 +411,20 @@
-               }
-               namelen = strlen(dirent->d_name);
-               if (namelen > MAX_INPUT_NAMELEN) {
--                      die(MKFS_ERROR, 0,
--                              "very long (%u bytes) filename found: %s\n"
--                              "please increase MAX_INPUT_NAMELEN in mkcramfs.c and recompile",
-+                      error_msg_and_die(
-+                              "Very long (%u bytes) filename `%s' found.\n"
-+                              " Please increase MAX_INPUT_NAMELEN in mkcramfs.c and recompile.  Exiting.\n",
-                               namelen, dirent->d_name);
-               }
-               memcpy(endpath, dirent->d_name, namelen + 1);
-               if (lstat(path, &st) < 0) {
-+                      perror(endpath);
-                       warn_skip = 1;
-                       continue;
-               }
--              entry = calloc(1, sizeof(struct entry));
--              if (!entry) {
--                      die(MKFS_ERROR, 1, "calloc failed");
--              }
--              entry->name = strdup(dirent->d_name);
--              if (!entry->name) {
--                      die(MKFS_ERROR, 1, "strdup failed");
--              }
-+              entry = xcalloc(1, sizeof(struct entry));
-+              entry->name = xstrdup(dirent->d_name);
-               /* truncate multi-byte UTF-8 filenames on character boundary */
-               if (namelen > CRAMFS_MAXPATHLEN) {
-                       namelen = CRAMFS_MAXPATHLEN;
-@@ -297,24 +434,25 @@
-                               namelen--;
-                               /* are we reasonably certain it was UTF-8 ? */
-                               if (entry->name[namelen] < 0x80 || !namelen) {
--                                      die(MKFS_ERROR, 0, "cannot truncate filenames not encoded in UTF-8");
-+                                      error_msg_and_die("cannot truncate filenames not encoded in UTF-8");
-                               }
-                       }
-                       entry->name[namelen] = '\0';
-               }
-               entry->mode = st.st_mode;
-               entry->size = st.st_size;
--              entry->uid = st.st_uid;
-+              entry->uid = opt_squash ? 0 : st.st_uid;
-               if (entry->uid >= 1 << CRAMFS_UID_WIDTH)
-                       warn_uid = 1;
--              entry->gid = st.st_gid;
--              if (entry->gid >= 1 << CRAMFS_GID_WIDTH)
-+              entry->gid = opt_squash ? 0 : st.st_gid;
-+              if (entry->gid >= 1 << CRAMFS_GID_WIDTH) {
-                       /* TODO: We ought to replace with a default
-                          gid instead of truncating; otherwise there
-                          are security problems.  Maybe mode should
-                          be &= ~070.  Same goes for uid once Linux
-                          supports >16-bit uids. */
-                       warn_gid = 1;
-+              }
-               size = sizeof(struct cramfs_inode) + ((namelen + 3) & ~3);
-               *fslen_ub += size;
-               if (S_ISDIR(st.st_mode)) {
-@@ -325,21 +463,15 @@
-                                       warn_skip = 1;
-                                       continue;
-                               }
--                              entry->path = strdup(path);
--                              if (!entry->path) {
--                                      die(MKFS_ERROR, 1, "strdup failed");
--                              }
-+                              entry->path = xstrdup(path);
-                               if ((entry->size >= 1 << CRAMFS_SIZE_WIDTH)) {
-                                       warn_size = 1;
-                                       entry->size = (1 << CRAMFS_SIZE_WIDTH) - 1;
-                               }
-                       }
-               } else if (S_ISLNK(st.st_mode)) {
--                      entry->uncompressed = malloc(entry->size);
-+                      entry->uncompressed = xreadlink(path);
-                       if (!entry->uncompressed) {
--                              die(MKFS_ERROR, 1, "malloc failed");
--                      }
--                      if (readlink(path, entry->uncompressed, entry->size) < 0) {
-                               warn_skip = 1;
-                               continue;
-                       }
-@@ -351,7 +483,7 @@
-                       if (entry->size & -(1<<CRAMFS_SIZE_WIDTH))
-                               warn_dev = 1;
-               } else {
--                      die(MKFS_ERROR, 0, "bogus file type: %s", entry->name);
-+                      error_msg_and_die("bogus file type: %s", entry->name);
-               }
-               if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) {
-@@ -378,7 +510,9 @@
-       struct cramfs_super *super = (struct cramfs_super *) base;
-       unsigned int offset = sizeof(struct cramfs_super) + image_length;
--      offset += opt_pad;      /* 0 if no padding */
-+      if (opt_pad) {
-+              offset += opt_pad;      /* 0 if no padding */
-+      }
-       super->magic = CRAMFS_MAGIC;
-       super->flags = CRAMFS_FLAG_FSID_VERSION_2 | CRAMFS_FLAG_SORTED_DIRS;
-@@ -414,10 +548,10 @@
-       struct cramfs_inode *inode = (struct cramfs_inode *) (base + entry->dir_offset);
-       if ((offset & 3) != 0) {
--              die(MKFS_ERROR, 0, "illegal offset of %lu bytes", offset);
-+              error_msg_and_die("illegal offset of %lu bytes", offset);
-       }
-       if (offset >= (1 << (2 + CRAMFS_OFFSET_WIDTH))) {
--              die(MKFS_ERROR, 0, "filesystem too big");
-+              error_msg_and_die("filesystem too big");
-       }
-       inode->offset = (offset >> 2);
- }
-@@ -429,7 +563,7 @@
-  */
- static void print_node(struct entry *e)
- {
--      char info[10];
-+      char info[12];
-       char type = '?';
-       if (S_ISREG(e->mode)) type = 'f';
-@@ -442,11 +576,11 @@
-       if (S_ISCHR(e->mode) || (S_ISBLK(e->mode))) {
-               /* major/minor numbers can be as high as 2^12 or 4096 */
--              snprintf(info, 10, "%4d,%4d", major(e->size), minor(e->size));
-+              snprintf(info, 11, "%4d,%4d", major(e->size), minor(e->size));
-       }
-       else {
-               /* size be as high as 2^24 or 16777216 */
--              snprintf(info, 10, "%9d", e->size);
-+              snprintf(info, 11, "%9d", e->size);
-       }
-       printf("%c %04o %s %5d:%-3d %s\n",
-@@ -462,17 +596,9 @@
- {
-       int stack_entries = 0;
-       int stack_size = 64;
--      struct entry **entry_stack;
--
--      entry_stack = malloc(stack_size * sizeof(struct entry *));
--      if (!entry_stack) {
--              die(MKFS_ERROR, 1, "malloc failed");
--      }
--
--      if (opt_verbose) {
--              printf("root:\n");
--      }
-+      struct entry **entry_stack = NULL;
-+      entry_stack = xmalloc(stack_size * sizeof(struct entry *));
-       for (;;) {
-               int dir_start = stack_entries;
-               while (entry) {
-@@ -506,10 +632,7 @@
-                       if (entry->child) {
-                               if (stack_entries >= stack_size) {
-                                       stack_size *= 2;
--                                      entry_stack = realloc(entry_stack, stack_size * sizeof(struct entry *));
--                                      if (!entry_stack) {
--                                              die(MKFS_ERROR, 1, "realloc failed");
--                                      }
-+                                      entry_stack = xrealloc(entry_stack, stack_size * sizeof(struct entry *));
-                               }
-                               entry_stack[stack_entries] = entry;
-                               stack_entries++;
-@@ -543,7 +666,7 @@
-               set_data_offset(entry, base, offset);
-               if (opt_verbose) {
--                      printf("%s:\n", entry->name);
-+                  printf("'%s':\n", entry->name);
-               }
-               entry = entry->child;
-       }
-@@ -553,16 +676,21 @@
- static int is_zero(char const *begin, unsigned len)
- {
--      /* Returns non-zero iff the first LEN bytes from BEGIN are all NULs. */
--      return (len-- == 0 ||
--              (begin[0] == '\0' &&
--               (len-- == 0 ||
--                (begin[1] == '\0' &&
--                 (len-- == 0 ||
--                  (begin[2] == '\0' &&
--                   (len-- == 0 ||
--                    (begin[3] == '\0' &&
--                     memcmp(begin, begin + 4, len) == 0))))))));
-+      if (opt_holes)
-+              /* Returns non-zero iff the first LEN bytes from BEGIN are
-+                 all NULs. */
-+              return (len-- == 0 ||
-+                      (begin[0] == '\0' &&
-+                       (len-- == 0 ||
-+                        (begin[1] == '\0' &&
-+                         (len-- == 0 ||
-+                          (begin[2] == '\0' &&
-+                           (len-- == 0 ||
-+                            (begin[3] == '\0' &&
-+                             memcmp(begin, begin + 4, len) == 0))))))));
-+      else
-+              /* Never create holes. */
-+              return 0;
- }
- /*
-@@ -575,37 +703,34 @@
-  * Note that size > 0, as a zero-sized file wouldn't ever
-  * have gotten here in the first place.
-  */
--static unsigned int do_compress(char *base, unsigned int offset, char const *name, char *uncompressed, unsigned int size)
-+static unsigned int do_compress(char *base, unsigned int offset, struct entry *entry)
- {
-+      unsigned int size = entry->size;
-       unsigned long original_size = size;
-       unsigned long original_offset = offset;
-       unsigned long new_size;
-       unsigned long blocks = (size - 1) / blksize + 1;
-       unsigned long curr = offset + 4 * blocks;
-       int change;
-+      char *uncompressed = entry->uncompressed;
--      total_blocks += blocks;
-+      total_blocks += blocks; 
-       do {
-               unsigned long len = 2 * blksize;
-               unsigned int input = size;
--              int err;
--
-               if (input > blksize)
-                       input = blksize;
-               size -= input;
--              if (!(opt_holes && is_zero (uncompressed, input))) {
--                      err = compress2(base + curr, &len, uncompressed, input, Z_BEST_COMPRESSION);
--                      if (err != Z_OK) {
--                              die(MKFS_ERROR, 0, "compression error: %s", zError(err));
--                      }
-+              if (!is_zero (uncompressed, input)) {
-+                      compress(base + curr, &len, uncompressed, input);
-                       curr += len;
-               }
-               uncompressed += input;
-               if (len > blksize*2) {
-                       /* (I don't think this can happen with zlib.) */
--                      die(MKFS_ERROR, 0, "AIEEE: block \"compressed\" to > 2*blocklength (%ld)", len);
-+                      error_msg_and_die("AIEEE: block \"compressed\" to > 2*blocklength (%ld)\n", len);
-               }
-               *(u32 *) (base + offset) = curr;
-@@ -618,10 +743,12 @@
-          st_blocks * 512.  But if you say that then perhaps
-          administrative data should also be included in both. */
-       change = new_size - original_size;
--      if (opt_verbose > 1) {
--              printf("%6.2f%% (%+d bytes)\t%s\n",
--                     (change * 100) / (double) original_size, change, name);
-+#if 0
-+      if (opt_verbose) {
-+          printf("%6.2f%% (%+d bytes)\t%s\n",
-+                  (change * 100) / (double) original_size, change, entry->name);
-       }
-+#endif
-       return curr;
- }
-@@ -644,7 +771,7 @@
-                               set_data_offset(entry, base, offset);
-                               entry->offset = offset;
-                               map_entry(entry);
--                              offset = do_compress(base, offset, entry->name, entry->uncompressed, entry->size);
-+                              offset = do_compress(base, offset, entry);
-                               unmap_entry(entry);
-                       }
-               }
-@@ -660,13 +787,10 @@
-       int fd;
-       char *buf;
--      fd = open(file, O_RDONLY);
--      if (fd < 0) {
--              die(MKFS_ERROR, 1, "open failed: %s", file);
--      }
-+      fd = xopen(file, O_RDONLY, 0);
-       buf = mmap(NULL, image_length, PROT_READ, MAP_PRIVATE, fd, 0);
-       if (buf == MAP_FAILED) {
--              die(MKFS_ERROR, 1, "mmap failed");
-+              error_msg_and_die("mmap failed");
-       }
-       memcpy(base + offset, buf, image_length);
-       munmap(buf, image_length);
-@@ -679,6 +803,328 @@
-       return (offset + image_length);
- }
-+static struct entry *find_filesystem_entry(struct entry *dir, char *name, mode_t type)
-+{
-+      struct entry *e = dir;
-+
-+      if (S_ISDIR(dir->mode)) {
-+              e = dir->child;
-+      }
-+      while (e) {
-+              /* Only bother to do the expensive strcmp on matching file types */
-+              if (type == (e->mode & S_IFMT) && e->name) {
-+                      if (S_ISDIR(e->mode)) {
-+                              int len = strlen(e->name);
-+
-+                              /* Check if we are a parent of the correct path */
-+                              if (strncmp(e->name, name, len) == 0) {
-+                                      /* Is this an _exact_ match? */
-+                                      if (strcmp(name, e->name) == 0) {
-+                                              return (e);
-+                                      }
-+                                      /* Looks like we found a parent of the correct path */
-+                                      if (name[len] == '/') {
-+                                              if (e->child) {
-+                                                      return (find_filesystem_entry (e, name + len + 1, type));
-+                                              } else {
-+                                                      return NULL;
-+                                              }
-+                                      }
-+                              }
-+                      } else {
-+                              if (strcmp(name, e->name) == 0) {
-+                                      return (e);
-+                              }
-+                      }
-+              }
-+              e = e->next;
-+      }
-+      return (NULL);
-+}
-+
-+void modify_entry(char *full_path, unsigned long uid, unsigned long gid, 
-+      unsigned long mode, unsigned long rdev, struct entry *root, loff_t *fslen_ub)
-+{
-+      char *name, *path, *full;
-+      struct entry *curr, *parent, *entry, *prev;
-+      
-+      full = xstrdup(full_path);
-+      path = xstrdup(dirname(full));
-+      name = full_path + strlen(path) + 1;
-+      free(full);
-+      if (strcmp(path, "/") == 0) {
-+              parent = root;
-+              name = full_path + 1;
-+      } else {
-+              if (!(parent = find_filesystem_entry(root, path+1, S_IFDIR)))
-+                      error_msg_and_die("%s/%s: could not find parent\n", path, name);
-+      }
-+      if ((entry = find_filesystem_entry(parent, name, (mode & S_IFMT)))) {
-+              /* its there, just modify permissions */
-+              entry->mode = mode;
-+              entry->uid = uid;
-+              entry->gid = gid;
-+      } else { /* make a new entry */
-+      
-+              /* code partially replicated from parse_directory() */
-+              size_t namelen;
-+              if (S_ISREG(mode)) {
-+                      error_msg_and_die("%s: regular file from device_table file must exist on disk!", full_path);
-+              }
-+
-+              namelen = strlen(name);
-+              if (namelen > MAX_INPUT_NAMELEN) {
-+                      error_msg_and_die(
-+                              "Very long (%u bytes) filename `%s' found.\n"
-+                              " Please increase MAX_INPUT_NAMELEN in mkcramfs.c and recompile.  Exiting.\n",
-+                              namelen, name);
-+              }
-+              entry = xcalloc(1, sizeof(struct entry));
-+              entry->name = xstrdup(name);
-+              /* truncate multi-byte UTF-8 filenames on character boundary */
-+              if (namelen > CRAMFS_MAXPATHLEN) {
-+                      namelen = CRAMFS_MAXPATHLEN;
-+                      warn_namelen = 1;
-+                      /* the first lost byte must not be a trail byte */
-+                      while ((entry->name[namelen] & 0xc0) == 0x80) {
-+                              namelen--;
-+                              /* are we reasonably certain it was UTF-8 ? */
-+                              if (entry->name[namelen] < 0x80 || !namelen) {
-+                                      error_msg_and_die("cannot truncate filenames not encoded in UTF-8");
-+                              }
-+                      }
-+                      entry->name[namelen] = '\0';
-+              }
-+              entry->mode = mode;
-+              entry->uid = uid;
-+              entry->gid = gid;
-+              entry->size = 0;
-+              if (S_ISBLK(mode) || S_ISCHR(mode)) {
-+                      entry->size = rdev;
-+                      if (entry->size & -(1<<CRAMFS_SIZE_WIDTH))
-+                              warn_dev = 1;
-+              }
-+              
-+              /* ok, now we have to backup and correct the size of all the entries above us */
-+              *fslen_ub += sizeof(struct cramfs_inode) + ((namelen + 3) & ~3);
-+              parent->size += sizeof(struct cramfs_inode) + ((namelen + 3) & ~3);
-+
-+              /* alright, time to link us in */
-+              curr = parent->child;
-+              prev = NULL;
-+              while (curr && strcmp(name, curr->name) > 0) {
-+                      prev = curr;
-+                      curr = curr->next;
-+              }
-+              if (!prev) parent->child = entry;
-+              else prev->next = entry;
-+              entry->next = curr;
-+              entry->child = NULL;
-+      }
-+      if (entry->uid >= 1 << CRAMFS_UID_WIDTH)
-+              warn_uid = 1;
-+      if (entry->gid >= 1 << CRAMFS_GID_WIDTH) {
-+              /* TODO: We ought to replace with a default
-+                 gid instead of truncating; otherwise there
-+                 are security problems.  Maybe mode should
-+                 be &= ~070.  Same goes for uid once Linux
-+                 supports >16-bit uids. */
-+              warn_gid = 1;
-+      }
-+      free(path);
-+}
-+
-+/* the GNU C library has a wonderful scanf("%as", string) which will
-+ allocate the string with the right size, good to avoid buffer overruns. 
-+ the following macros use it if available or use a hacky workaround...
-+ */
-+
-+#ifdef __GNUC__
-+#define SCANF_PREFIX "a"
-+#define SCANF_STRING(s) (&s)
-+#define GETCWD_SIZE 0
-+#else
-+#define SCANF_PREFIX "511"
-+#define SCANF_STRING(s) (s = xmalloc(512))
-+#define GETCWD_SIZE -1
-+inline int snprintf(char *str, size_t n, const char *fmt, ...)
-+{
-+      int ret;
-+      va_list ap;
-+
-+      va_start(ap, fmt);
-+      ret = vsprintf(str, fmt, ap);
-+      va_end(ap);
-+      return ret;
-+}
-+#endif
-+
-+/*  device table entries take the form of:
-+    <path>    <type> <mode>   <uid>   <gid>   <major> <minor> <start> <inc>   <count>
-+    /dev/mem     c    640       0       0         1       1       0     0         -
-+
-+    type can be one of: 
-+      f       A regular file
-+      d       Directory
-+      c       Character special device file
-+      b       Block special device file
-+      p       Fifo (named pipe)
-+
-+    I don't bother with symlinks (permissions are irrelevant), hard
-+    links (special cases of regular files), or sockets (why bother).
-+
-+    Regular files must exist in the target root directory.  If a char,
-+    block, fifo, or directory does not exist, it will be created.
-+*/
-+
-+static int interpret_table_entry(char *line, struct entry *root, loff_t *fslen_ub)
-+{
-+      char type, *name = NULL;
-+      unsigned long mode = 0755, uid = 0, gid = 0, major = 0, minor = 0;
-+      unsigned long start = 0, increment = 1, count = 0;
-+
-+      if (sscanf (line, "%" SCANF_PREFIX "s %c %lo %lu %lu %lu %lu %lu %lu %lu",
-+               SCANF_STRING(name), &type, &mode, &uid, &gid, &major, &minor,
-+               &start, &increment, &count) < 0) 
-+      {
-+              return 1;
-+      }
-+
-+      if (!strcmp(name, "/")) {
-+              error_msg_and_die("Device table entries require absolute paths");
-+      }
-+
-+      switch (type) {
-+      case 'd':
-+              mode |= S_IFDIR;
-+              modify_entry(name, uid, gid, mode, 0, root, fslen_ub);
-+              break;
-+      case 'f':
-+              mode |= S_IFREG;
-+              modify_entry(name, uid, gid, mode, 0, root, fslen_ub);
-+              break;
-+      case 'p':
-+              mode |= S_IFIFO;
-+              modify_entry(name, uid, gid, mode, 0, root, fslen_ub);
-+              break;
-+      case 'c':
-+      case 'b':
-+              mode |= (type == 'c') ? S_IFCHR : S_IFBLK;
-+              if (count > 0) {
-+                      char *buf;
-+                      unsigned long i;
-+                      dev_t rdev;
-+
-+                      for (i = start; i < count; i++) {
-+                              asprintf(&buf, "%s%lu", name, i);
-+                              rdev = makedev(major, minor + (i * increment - start));
-+                              modify_entry(buf, uid, gid, mode, rdev, root, fslen_ub);
-+                              free(buf);
-+                      }
-+              } else {
-+                      dev_t rdev = makedev(major, minor);
-+                      modify_entry(name, uid, gid, mode, rdev, root, fslen_ub);
-+              }
-+              break;
-+      default:
-+              error_msg_and_die("Unsupported file type");
-+      }
-+      free(name);
-+      return 0;
-+}
-+
-+static int parse_device_table(FILE *file, struct entry *root, loff_t *fslen_ub)
-+{
-+      char *line;
-+      int status = 0;
-+      size_t length = 0;
-+
-+      /* Turn off squash, since we must ensure that values
-+       * entered via the device table are not squashed */
-+      opt_squash = 0;
-+
-+      /* Looks ok so far.  The general plan now is to read in one
-+       * line at a time, check for leading comment delimiters ('#'),
-+       * then try and parse the line as a device table.  If we fail
-+       * to parse things, try and help the poor fool to fix their
-+       * device table with a useful error msg... */
-+      line = NULL;
-+      while (getline(&line, &length, file) != -1) {
-+              /* First trim off any whitespace */
-+              int len = strlen(line);
-+
-+              /* trim trailing whitespace */
-+              while (len > 0 && isspace(line[len - 1]))
-+                      line[--len] = '\0';
-+              /* trim leading whitespace */
-+              memmove(line, &line[strspn(line, " \n\r\t\v")], len);
-+
-+              /* How long are we after trimming? */
-+              len = strlen(line);
-+
-+              /* If this is NOT a comment line, try to interpret it */
-+              if (len && *line != '#') {
-+                      if (interpret_table_entry(line, root, fslen_ub))
-+                              status = 1;
-+              }
-+
-+              free(line);
-+              line = NULL;
-+      }
-+      free(line);
-+      fclose(file);
-+
-+      return status;
-+}
-+
-+void traverse(struct entry *entry, int depth)
-+{
-+      struct entry *curr = entry;
-+      int i;
-+
-+      while (curr) {
-+              for (i = 0; i < depth; i++) putchar(' ');
-+              printf("%s: size=%d mode=%d same=%p\n",
-+                      (curr->name)? (char*)curr->name : "/", 
-+                      curr->size, curr->mode, curr->same);
-+              if (curr->child) traverse(curr->child, depth + 4);
-+              curr = curr->next;
-+      }
-+}
-+
-+static void free_filesystem_entry(struct entry *dir)
-+{
-+      struct entry *e = dir, *last;
-+
-+      if (S_ISDIR(dir->mode)) {
-+              e = dir->child;
-+      }
-+      while (e) {
-+              if (e->name)
-+                      free(e->name);
-+              if (e->path)
-+                      free(e->path);
-+              if (e->uncompressed)
-+                      free(e->uncompressed);
-+              last = e;
-+              if (e->child) {
-+                      free_filesystem_entry(e);
-+              }
-+              e = e->next;
-+              free(last);
-+      }
-+}
-+
-+
-+/*
-+ * Usage:
-+ *
-+ *      mkcramfs directory-name outfile
-+ *
-+ * where "directory-name" is simply the root of the directory
-+ * tree that we want to generate a compressed filesystem out
-+ * of.
-+ */
- int main(int argc, char **argv)
- {
-       struct stat st;         /* used twice... */
-@@ -692,6 +1138,7 @@
-       u32 crc;
-       int c;                  /* for getopt */
-       char *ep;               /* for strtoul */
-+      FILE *devtable = NULL;
-       total_blocks = 0;
-@@ -699,7 +1146,7 @@
-               progname = argv[0];
-       /* command line options */
--      while ((c = getopt(argc, argv, "hEe:i:n:psvz")) != EOF) {
-+      while ((c = getopt(argc, argv, "hEe:i:n:psvzD:q")) != EOF) {
-               switch (c) {
-               case 'h':
-                       usage(MKFS_OK);
-@@ -715,7 +1162,7 @@
-               case 'i':
-                       opt_image = optarg;
-                       if (lstat(opt_image, &st) < 0) {
--                              die(MKFS_ERROR, 1, "lstat failed: %s", opt_image);
-+                              error_msg_and_die("lstat failed: %s", opt_image);
-                       }
-                       image_length = st.st_size; /* may be padded later */
-                       fslen_ub += (image_length + 3); /* 3 is for padding */
-@@ -736,6 +1183,16 @@
-               case 'z':
-                       opt_holes = 1;
-                       break;
-+              case 'q':
-+                      opt_squash = 1;
-+                      break;
-+              case 'D':
-+                      devtable = xfopen(optarg, "r");
-+                      if (fstat(fileno(devtable), &st) < 0)
-+                              perror_msg_and_die(optarg);
-+                      if (st.st_size < 10)
-+                              error_msg_and_die("%s: not a proper device table file\n", optarg);
-+                      break;
-               }
-       }
-@@ -745,25 +1202,23 @@
-       outfile = argv[optind + 1];
-       if (stat(dirname, &st) < 0) {
--              die(MKFS_USAGE, 1, "stat failed: %s", dirname);
--      }
--      fd = open(outfile, O_WRONLY | O_CREAT | O_TRUNC, 0666);
--      if (fd < 0) {
--              die(MKFS_USAGE, 1, "open failed: %s", outfile);
-+              error_msg_and_die("stat failed: %s", dirname);
-       }
-+      fd = xopen(outfile, O_WRONLY | O_CREAT | O_TRUNC, 0666);
--      root_entry = calloc(1, sizeof(struct entry));
--      if (!root_entry) {
--              die(MKFS_ERROR, 1, "calloc failed");
--      }
-+      root_entry = xcalloc(1, sizeof(struct entry));
-       root_entry->mode = st.st_mode;
-       root_entry->uid = st.st_uid;
-       root_entry->gid = st.st_gid;
-       root_entry->size = parse_directory(root_entry, dirname, &root_entry->child, &fslen_ub);
-+      if (devtable) {
-+              parse_device_table(devtable, root_entry, &fslen_ub);
-+      }
-+
-       /* always allocate a multiple of blksize bytes because that's
--         what we're going to write later on */
-+           what we're going to write later on */
-       fslen_ub = ((fslen_ub - 1) | (blksize - 1)) + 1;
-       if (fslen_ub > MAXFSLEN) {
-@@ -790,7 +1245,7 @@
-       rom_image = mmap(NULL, fslen_ub?fslen_ub:1, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-       if (rom_image == MAP_FAILED) {
--              die(MKFS_ERROR, 1, "mmap failed");
-+              error_msg_and_die("mmap failed");
-       }
-       /* Skip the first opt_pad bytes for boot loader code */
-@@ -807,6 +1262,7 @@
-       }
-       offset = write_directory_structure(root_entry->child, rom_image, offset);
-+      if (opt_verbose)
-       printf("Directory data: %d bytes\n", offset);
-       offset = write_data(root_entry, rom_image, offset);
-@@ -814,30 +1270,38 @@
-       /* We always write a multiple of blksize bytes, so that
-          losetup works. */
-       offset = ((offset - 1) | (blksize - 1)) + 1;
-+      if (opt_verbose)
-       printf("Everything: %d kilobytes\n", offset >> 10);
-       /* Write the superblock now that we can fill in all of the fields. */
-       write_superblock(root_entry, rom_image+opt_pad, offset);
-+      if (opt_verbose)
-       printf("Super block: %d bytes\n", sizeof(struct cramfs_super));
-       /* Put the checksum in. */
-       crc = crc32(0L, Z_NULL, 0);
-       crc = crc32(crc, (rom_image+opt_pad), (offset-opt_pad));
-       ((struct cramfs_super *) (rom_image+opt_pad))->fsid.crc = crc;
-+      if (opt_verbose)
-       printf("CRC: %x\n", crc);
-       /* Check to make sure we allocated enough space. */
-       if (fslen_ub < offset) {
--              die(MKFS_ERROR, 0, "not enough space allocated for ROM image (%Ld allocated, %d used)", fslen_ub, offset);
-+              error_msg_and_die("not enough space allocated for ROM "
-+                      "image (%Ld allocated, %d used)", fslen_ub, offset);
-       }
-       written = write(fd, rom_image, offset);
-       if (written < 0) {
--              die(MKFS_ERROR, 1, "write failed");
-+              error_msg_and_die("write failed");
-       }
-       if (offset != written) {
--              die(MKFS_ERROR, 0, "ROM image write failed (wrote %d of %d bytes)", written, offset);
-+              error_msg_and_die("ROM image write failed (wrote %d of %d bytes)", written, offset);
-       }
-+      
-+      /* Free up memory */
-+      free_filesystem_entry(root_entry);
-+      free(root_entry);
-       /* (These warnings used to come at the start, but they scroll off the
-          screen too quickly.) */
diff --git a/obsolete-buildroot/sources/device_table.txt b/obsolete-buildroot/sources/device_table.txt
deleted file mode 100644 (file)
index 75d8068..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-# When building a target filesystem, it is desirable to not have to
-# become root and then run 'mknod' a thousand times.  Using a device 
-# table you can create device nodes and directories "on the fly".
-#
-# This is a sample device table file for use with genext2fs.  You can
-# do all sorts of interesting things with a device table file.  For
-# example, if you want to adjust the permissions on a particular file
-# you can just add an entry like:
-#   /sbin/foobar        f       2755    0       0       -       -       -       -       -
-# and (assuming the file /sbin/foobar exists) it will be made setuid
-# root (regardless of what its permissions are on the host filesystem.
-# Furthermore, you can use a single table entry to create a many device
-# minors.  For example, if I wanted to create /dev/hda and /dev/hda[0-15]
-# I could just use the following two table entries:
-#   /dev/hda    b       640     0       0       3       0       0       0       -
-#   /dev/hda    b       640     0       0       3       1       1       1       15
-# 
-# Device table entries take the form of:
-# <name>    <type>      <mode>  <uid>   <gid>   <major> <minor> <start> <inc>   <count>
-# where name is the file name,  type can be one of: 
-#       f       A regular file
-#       d       Directory
-#       c       Character special device file
-#       b       Block special device file
-#       p       Fifo (named pipe)
-# uid is the user id for the target file, gid is the group id for the
-# target file.  The rest of the entries (major, minor, etc) apply only 
-# to device special files.
-
-# Have fun
-# -Erik Andersen <andersen@codepoet.org>
-#
-
-#<name>                <type>  <mode>  <uid>   <gid>   <major> <minor> <start> <inc>   <count>
-/dev           d       755     0       0       -       -       -       -       -
-/dev           d       755     0       0       -       -       -       -       -
-/dev/pts       d       755     0       0       -       -       -       -       -
-/tmp           d       1777    0       0       -       -       -       -       -
-/etc           d       755     0       0       -       -       -       -       -
-/home/default  d       2755    1000    1000    -       -       -       -       -
-/etc/network/if-up.d           d       755     0       0       -       -       -       -       -
-/etc/network/if-pre-up.d       d       755     0       0       -       -       -       -       -
-/etc/network/if-down.d         d       755     0       0       -       -       -       -       -
-/etc/network/if-post-down.d    d       755     0       0       -       -       -       -       -
-# Adjust permissions on some normal files
-/etc/shadow    f       600     0       0       -       -       -       -       -
-/etc/passwd    f       644     0       0       -       -       -       -       -
-/bin/busybox   f       4755    0       0       -       -       -       -       -
-# uncomment this to allow starting x as non-root
-#/usr/X11R6/bin/Xfbdev         f       4755    0       0       -       -       -       -       -
-
-# Normal system devices
-/dev/mem       c       640     0       0       1       1       0       0       -
-/dev/kmem      c       640     0       0       1       2       0       0       -
-/dev/null      c       666     0       0       1       3       0       0       -
-/dev/zero      c       666     0       0       1       5       0       0       -
-/dev/random    c       666     0       0       1       8       0       0       -
-/dev/urandom   c       666     0       0       1       9       0       0       -
-/dev/ram       b       640     0       0       1       1       0       0       -
-/dev/ram       b       640     0       0       1       0       0       1       4
-/dev/loop      b       640     0       0       7       0       0       1       2
-/dev/rtc       c       640     0       0       10      135     -       -       -
-/dev/console   c       666     0       0       5       1       -       -       -
-/dev/tty       c       666     0       0       5       0       -       -       -
-/dev/tty       c       666     0       0       4       0       0       1       8
-/dev/ttyp      c       666     0       0       3       0       0       1       10
-/dev/ptyp      c       666     0       0       2       0       0       1       10
-/dev/ptmx      c       666     0       0       5       2       -       -       -
-/dev/ttyP      c       666     0       0       57      0       0       1       4
-/dev/ttyS      c       666     0       0       4       64      0       1       4
-/dev/fb                c       640     0       5       29      0       0       32      4
-#/dev/ttySA    c       666     0       0       204     5       0       1       3
-/dev/psaux     c       666     0       0       10      1       0       0       -
-#/dev/ppp      c       666     0       0       108     0       -       -       -
-
-# MTD stuff
-/dev/mtd       c       640     0       0       90      0       0       2       4
-/dev/mtdblock  b       640     0       0       31      0       0       1       4
-
-#Tun/tap driver
-/dev/net       d       755     0       0       -       -       -       -       -
-/dev/net/tun   c       660     0       0       10      200     -       -       -
-
-# Audio stuff
-#/dev/audio    c       666     0       29      14      4       -       -       -
-#/dev/audio1   c       666     0       29      14      20      -       -       -
-#/dev/dsp      c       666     0       29      14      3       -       -       -
-#/dev/dsp1     c       666     0       29      14      19      -       -       -
-#/dev/sndstat  c       666     0       29      14      6       -       -       -
-
-# User-mode Linux stuff
-/dev/ubda      b       640     0       0       98      0       0       0       -
-/dev/ubda      b       640     0       0       98      1       1       1       15
-
-# IDE Devices
-/dev/hda       b       640     0       0       3       0       0       0       -
-/dev/hda       b       640     0       0       3       1       1       1       15
-/dev/hdb       b       640     0       0       3       64      0       0       -
-/dev/hdb       b       640     0       0       3       65      1       1       15
-#/dev/hdc      b       640     0       0       22      0       0       0       -
-#/dev/hdc      b       640     0       0       22      1       1       1       15
-#/dev/hdd      b       640     0       0       22      64      0       0       -
-#/dev/hdd      b       640     0       0       22      65      1       1       15
-#/dev/hde      b       640     0       0       33      0       0       0       -
-#/dev/hde      b       640     0       0       33      1       1       1       15
-#/dev/hdf      b       640     0       0       33      64      0       0       -
-#/dev/hdf      b       640     0       0       33      65      1       1       15
-#/dev/hdg      b       640     0       0       34      0       0       0       -
-#/dev/hdg      b       640     0       0       34      1       1       1       15
-#/dev/hdh      b       640     0       0       34      64      0       0       -
-#/dev/hdh      b       640     0       0       34      65      1       1       15
-
-# SCSI Devices
-#/dev/sda      b       640     0       0       8       0       0       0       -
-#/dev/sda      b       640     0       0       8       1       1       1       15
-#/dev/sdb      b       640     0       0       8       16      0       0       -
-#/dev/sdb      b       640     0       0       8       17      1       1       15
-#/dev/sdc      b       640     0       0       8       32      0       0       -
-#/dev/sdc      b       640     0       0       8       33      1       1       15
-#/dev/sdd      b       640     0       0       8       48      0       0       -
-#/dev/sdd      b       640     0       0       8       49      1       1       15
-#/dev/sde      b       640     0       0       8       64      0       0       -
-#/dev/sde      b       640     0       0       8       65      1       1       15
-#/dev/sdf      b       640     0       0       8       80      0       0       -
-#/dev/sdf      b       640     0       0       8       81      1       1       15
-#/dev/sdg      b       640     0       0       8       96      0       0       -
-#/dev/sdg      b       640     0       0       8       97      1       1       15
-#/dev/sdh      b       640     0       0       8       112     0       0       -
-#/dev/sdh      b       640     0       0       8       113     1       1       15
-#/dev/sg       c       640     0       0       21      0       0       1       15
-#/dev/scd      b       640     0       0       11      0       0       1       15
-#/dev/st       c       640     0       0       9       0       0       1       8
-#/dev/nst      c       640     0       0       9       128     0       1       8
-#/dev/st       c       640     0       0       9       32      1       1       4
-#/dev/st       c       640     0       0       9       64      1       1       4
-#/dev/st       c       640     0       0       9       96      1       1       4
-
-# Floppy disk devices
-#/dev/fd       b       640     0       0       2       0       0       1       2
-#/dev/fd0d360  b       640     0       0       2       4       0       0       -
-#/dev/fd1d360  b       640     0       0       2       5       0       0       -
-#/dev/fd0h1200 b       640     0       0       2       8       0       0       -
-#/dev/fd1h1200 b       640     0       0       2       9       0       0       -
-#/dev/fd0u1440 b       640     0       0       2       28      0       0       -
-#/dev/fd1u1440 b       640     0       0       2       29      0       0       -
-#/dev/fd0u2880 b       640     0       0       2       32      0       0       -
-#/dev/fd1u2880 b       640     0       0       2       33      0       0       -
-
-# All the proprietary cdrom devices in the world
-#/dev/aztcd    b       640     0       0       29      0       0       0       -
-#/dev/bpcd     b       640     0       0       41      0       0       0       -
-#/dev/capi20   c       640     0       0       68      0       0       1       2
-#/dev/cdu31a   b       640     0       0       15      0       0       0       -
-#/dev/cdu535   b       640     0       0       24      0       0       0       -
-#/dev/cm206cd  b       640     0       0       32      0       0       0       -
-#/dev/sjcd     b       640     0       0       18      0       0       0       -
-#/dev/sonycd   b       640     0       0       15      0       0       0       -
-#/dev/gscd     b       640     0       0       16      0       0       0       -
-#/dev/sbpcd    b       640     0       0       25      0       0       0       -
-#/dev/sbpcd    b       640     0       0       25      0       0       1       4
-#/dev/mcd      b       640     0       0       23      0       0       0       -
-#/dev/optcd    b       640     0       0       17      0       0       0       -
-
diff --git a/obsolete-buildroot/sources/dnsmasq1-openwrt.patch b/obsolete-buildroot/sources/dnsmasq1-openwrt.patch
deleted file mode 100644 (file)
index e1741a2..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-diff -x CVS -urN dnsmasq-1.18/dhcp.c dnsmasq.old/dhcp.c
---- dnsmasq-1.18/dhcp.c        2003-11-05 08:30:20.000000000 -0600
-+++ dnsmasq.old/dhcp.c 2004-01-05 23:40:11.000000000 -0600
-@@ -15,14 +15,20 @@
- #include "dnsmasq.h"
--static int next_token (char *token, int buffsize, FILE * fp);
-+struct dhcpOfferedAddr {
-+        u_int8_t hostname[16];
-+        u_int8_t chaddr[16];
-+        u_int32_t yiaddr;       /* network order */
-+        u_int32_t expires;      /* host order */
-+};
- void load_dhcp(char *file, char *suffix, time_t now, char *hostname)
- {
--  char token[MAXTOK], *dot;
-+  char *dot;
-   struct all_addr host_address;
--  time_t ttd, tts;
-+  time_t ttd;
-   FILE *fp = fopen (file, "r");
-+  struct dhcpOfferedAddr lease;
-   
-   if (!fp)
-     {
-@@ -34,154 +40,45 @@
-   /* remove all existing DHCP cache entries */
-   cache_unhash_dhcp();
--  
--  while ((next_token(token, MAXTOK, fp)))
--    {
--      if (strcmp(token, "lease") == 0)
--        {
--          hostname[0] = '\0';
--        ttd = tts = (time_t)(-1);
--#ifdef HAVE_IPV6
--          if (next_token(token, MAXTOK, fp) && 
--            inet_pton(AF_INET, token, &host_address))
--#else
--        if (next_token(token, MAXTOK, fp) && 
--            (host_address.addr4.s_addr = inet_addr(token)) != (in_addr_t) -1)
--#endif
--            {
--              if (next_token(token, MAXTOK, fp) && *token == '{')
--                {
--                  while (next_token(token, MAXTOK, fp) && *token != '}')
-+
-+  while (fread(&lease, sizeof(lease), 1, fp)) {  
-+        host_address.addr.addr4.s_addr = lease.yiaddr;
-+
-+      strcpy(hostname,lease.hostname);
-+      if (lease.expires>(unsigned)now)
-+      ttd = lease.expires;
-+      else
-+      ttd = -1;
-+                  dot = strchr(hostname, '.');
-+                  if (suffix)
-                     {
--                      if ((strcmp(token, "client-hostname") == 0) ||
--                        (strcmp(token, "hostname") == 0))
--                      {
--                        if (next_token(hostname, MAXDNAME, fp))
--                          if (!canonicalise(hostname))
--                            {
--                              *hostname = 0;
--                              syslog(LOG_ERR, "bad name in %s", file); 
--                            }
--                      }
--                      else if ((strcmp(token, "ends") == 0) ||
--                             (strcmp(token, "starts") == 0))
--                        {
--                          struct tm lease_time;
--                        int is_ends = (strcmp(token, "ends") == 0);
--                        if (next_token(token, MAXTOK, fp) &&  /* skip weekday */
--                            next_token(token, MAXTOK, fp) &&  /* Get date from lease file */
--                            sscanf (token, "%d/%d/%d", 
--                                    &lease_time.tm_year,
--                                    &lease_time.tm_mon,
--                                    &lease_time.tm_mday) == 3 &&
--                            next_token(token, MAXTOK, fp) &&
--                            sscanf (token, "%d:%d:%d:", 
--                                    &lease_time.tm_hour,
--                                    &lease_time.tm_min, 
--                                    &lease_time.tm_sec) == 3)
--                          {
--                            /* There doesn't seem to be a universally available library function
--                               which converts broken-down _GMT_ time to seconds-in-epoch.
--                               The following was borrowed from ISC dhcpd sources, where
--                                 it is noted that it might not be entirely accurate for odd seconds.
--                               Since we're trying to get the same answer as dhcpd, that's just
--                               fine here. */
--                            static int months [11] = { 31, 59, 90, 120, 151, 181,
--                                                       212, 243, 273, 304, 334 };
--                            time_t time = ((((((365 * (lease_time.tm_year - 1970) + /* Days in years since '70 */
--                                                (lease_time.tm_year - 1969) / 4 +   /* Leap days since '70 */
--                                                (lease_time.tm_mon > 1                /* Days in months this year */
--                                                 ? months [lease_time.tm_mon - 2]
--                                                 : 0) +
--                                                (lease_time.tm_mon > 2 &&         /* Leap day this year */
--                                                 !((lease_time.tm_year - 1972) & 3)) +
--                                                lease_time.tm_mday - 1) * 24) +   /* Day of month */
--                                              lease_time.tm_hour) * 60) +
--                                            lease_time.tm_min) * 60) + lease_time.tm_sec;
--                            if (is_ends)
--                              ttd = time;
--                            else
--                              tts = time;                         }
-+                      if (dot)
-+                        { /* suffix and lease has ending: must match */
-+                          if (strcmp(dot+1, suffix) != 0)
-+                            syslog(LOG_WARNING,
-+                                   "Ignoring DHCP lease for %s because it has an illegal domain part", hostname);
-+                          else
-+                            cache_add_dhcp_entry(hostname, &host_address, ttd, F_REVERSE);
-                         }
--                  }
--                
--                /* missing info? */
--                if (!*hostname)
--                  continue;
--                if (ttd == (time_t)(-1))
--                  continue;
--                
--                /* infinite lease to is represented by -1 */
--                /* This makes is to the lease file as 
--                   start time one less than end time. */
--                /* We use -1 as infinite in ttd */
--                if ((tts != -1) && (ttd == tts - 1))
--                  ttd = (time_t)(-1);
--                else if (ttd < now)
--                  continue;
--
--                dot = strchr(hostname, '.');
--                if (suffix)
--                  { 
--                    if (dot) 
--                      { /* suffix and lease has ending: must match */
--                        if (strcmp(dot+1, suffix) != 0)
--                          syslog(LOG_WARNING, 
--                                 "Ignoring DHCP lease for %s because it has an illegal domain part", hostname);
--                        else
--                          cache_add_dhcp_entry(hostname, &host_address, ttd, F_REVERSE);
--                      }
--                    else
--                      { /* suffix exists but lease has no ending - add lease and lease.suffix */
--                        cache_add_dhcp_entry(hostname, &host_address, ttd, 0);
--                        strncat(hostname, ".", MAXDNAME);
--                        strncat(hostname, suffix, MAXDNAME);
--                        hostname[MAXDNAME-1] = 0; /* in case strncat hit limit */
--                        /* Make FQDN canonical for reverse lookups */
--                        cache_add_dhcp_entry(hostname, &host_address, ttd, F_REVERSE);
--                      }
--                  }
--                else
--                  { /* no suffix */
--                    if (dot) /* no lease ending allowed */
--                      syslog(LOG_WARNING, 
--                             "Ignoring DHCP lease for %s because it has a domain part", hostname);
--                    else
--                      cache_add_dhcp_entry(hostname, &host_address, ttd, F_REVERSE);
--                  }
--              }
--          }
--      }
--    }
-+                      else
-+                        { /* suffix exists but lease has no ending - add lease and lease.suffix */
-+                          cache_add_dhcp_entry(hostname, &host_address, ttd, 0);
-+                          strncat(hostname, ".", MAXDNAME);
-+                          strncat(hostname, suffix, MAXDNAME);
-+                          hostname[MAXDNAME-1] = 0; /* in case strncat hit limit */
-+                          /* Make FQDN canonical for reverse lookups */
-+                          cache_add_dhcp_entry(hostname, &host_address, ttd, F_REVERSE);
-+                        }
-+                    }
-+                  else
-+                    { /* no suffix */
-+                      if (dot) /* no lease ending allowed */
-+                        syslog(LOG_WARNING,
-+                               "Ignoring DHCP lease for %s because it has a domain part", hostname);
-+                      else
-+                        cache_add_dhcp_entry(hostname, &host_address, ttd, F_REVERSE);
-+                    }
-+  }
-   fclose(fp);
-   
- }
--
--static int next_token (char *token, int buffsize, FILE * fp)
--{
--  int c, count = 0;
--  char *cp = token;
--  
--  while((c = getc(fp)) != EOF)
--    {
--      if (c == '#')
--      do { c = getc(fp); } while (c != '\n' && c != EOF);
--      
--      if (c == ' ' || c == '\t' || c == '\n' || c == ';')
--      {
--        if (count)
--          break;
--      }
--      else if ((c != '"') && (count<buffsize-1))
--      {
--        *cp++ = c;
--        count++;
--      }
--    }
--  
--  *cp = 0;
--  return count ? 1 : 0;
--}
--
--
--
diff --git a/obsolete-buildroot/sources/ebtables-brnf-5.patch b/obsolete-buildroot/sources/ebtables-brnf-5.patch
deleted file mode 100644 (file)
index 707919e..0000000
+++ /dev/null
@@ -1,6336 +0,0 @@
-diff -Nurb src/linux/linux.stock/include/linux/if_bridge.h src/linux/linux/include/linux/if_bridge.h
---- src/linux/linux.stock/include/linux/if_bridge.h    2003-10-14 04:09:25.000000000 -0400
-+++ src/linux/linux/include/linux/if_bridge.h  2004-07-10 23:46:39.000000000 -0400
-@@ -102,7 +102,8 @@
- struct net_bridge_port;
- extern int (*br_ioctl_hook)(unsigned long arg);
--extern void (*br_handle_frame_hook)(struct sk_buff *skb);
-+extern int (*br_handle_frame_hook)(struct sk_buff *skb);
-+extern int (*br_should_route_hook)(struct sk_buff **pskb);
- #endif
-diff -Nurb src/linux/linux.stock/include/linux/netfilter.h src/linux/linux/include/linux/netfilter.h
---- src/linux/linux.stock/include/linux/netfilter.h    2004-07-10 23:30:09.000000000 -0400
-+++ src/linux/linux/include/linux/netfilter.h  2004-07-10 23:46:39.000000000 -0400
-@@ -119,17 +119,23 @@
- /* This is gross, but inline doesn't cut it for avoiding the function
-    call in fast path: gcc doesn't inline (needs value tracking?). --RR */
- #ifdef CONFIG_NETFILTER_DEBUG
--#define NF_HOOK nf_hook_slow
-+#define NF_HOOK(pf, hook, skb, indev, outdev, okfn)                   \
-+nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), INT_MIN)
-+#define NF_HOOK_THRESH nf_hook_slow
- #else
- #define NF_HOOK(pf, hook, skb, indev, outdev, okfn)                   \
- (list_empty(&nf_hooks[(pf)][(hook)])                                  \
-  ? (okfn)(skb)                                                                \
-- : nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn)))
-+ : nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), INT_MIN))
-+#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh)    \
-+(list_empty(&nf_hooks[(pf)][(hook)])                                  \
-+ ? (okfn)(skb)                                                                \
-+ : nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), (thresh)))
- #endif
- int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb,
-                struct net_device *indev, struct net_device *outdev,
--               int (*okfn)(struct sk_buff *));
-+               int (*okfn)(struct sk_buff *), int thresh);
- /* Call setsockopt() */
- int nf_setsockopt(struct sock *sk, int pf, int optval, char *opt, 
-diff -Nurb src/linux/linux.stock/include/linux/netfilter_bridge/ebt_802_3.h src/linux/linux/include/linux/netfilter_bridge/ebt_802_3.h
---- src/linux/linux.stock/include/linux/netfilter_bridge/ebt_802_3.h   1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/netfilter_bridge/ebt_802_3.h 2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,60 @@
-+#ifndef __LINUX_BRIDGE_EBT_802_3_H
-+#define __LINUX_BRIDGE_EBT_802_3_H
-+
-+#define EBT_802_3_SAP 0x01
-+#define EBT_802_3_TYPE 0x02
-+
-+#define EBT_802_3_MATCH "802_3"
-+
-+/*
-+ * If frame has DSAP/SSAP value 0xaa you must check the SNAP type
-+ * to discover what kind of packet we're carrying. 
-+ */
-+#define CHECK_TYPE 0xaa
-+
-+/*
-+ * Control field may be one or two bytes.  If the first byte has
-+ * the value 0x03 then the entire length is one byte, otherwise it is two.
-+ * One byte controls are used in Unnumbered Information frames.
-+ * Two byte controls are used in Numbered Information frames.
-+ */
-+#define IS_UI 0x03
-+
-+#define EBT_802_3_MASK (EBT_802_3_SAP | EBT_802_3_TYPE | EBT_802_3)
-+
-+/* ui has one byte ctrl, ni has two */
-+struct hdr_ui {
-+      uint8_t dsap;
-+      uint8_t ssap;
-+      uint8_t ctrl;
-+      uint8_t orig[3];
-+      uint16_t type;
-+};
-+
-+struct hdr_ni {
-+      uint8_t dsap;
-+      uint8_t ssap;
-+      uint16_t ctrl;
-+      uint8_t  orig[3];
-+      uint16_t type;
-+};
-+
-+struct ebt_802_3_hdr {
-+      uint8_t  daddr[6];
-+      uint8_t  saddr[6];
-+      uint16_t len;
-+      union {
-+              struct hdr_ui ui;
-+              struct hdr_ni ni;
-+      } llc;
-+};
-+
-+struct ebt_802_3_info 
-+{
-+      uint8_t  sap;
-+      uint16_t type;
-+      uint8_t  bitmask;
-+      uint8_t  invflags;
-+};
-+
-+#endif
-diff -Nurb src/linux/linux.stock/include/linux/netfilter_bridge/ebt_among.h src/linux/linux/include/linux/netfilter_bridge/ebt_among.h
---- src/linux/linux.stock/include/linux/netfilter_bridge/ebt_among.h   1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/netfilter_bridge/ebt_among.h 2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,65 @@
-+#ifndef __LINUX_BRIDGE_EBT_AMONG_H
-+#define __LINUX_BRIDGE_EBT_AMONG_H
-+
-+#define EBT_AMONG_DST 0x01
-+#define EBT_AMONG_SRC 0x02
-+
-+/* Grzegorz Borowiak <grzes@gnu.univ.gda.pl> 2003
-+ * 
-+ * Write-once-read-many hash table, used for checking if a given
-+ * MAC address belongs to a set or not and possibly for checking
-+ * if it is related with a given IPv4 address.
-+ *
-+ * The hash value of an address is its last byte.
-+ * 
-+ * In real-world ethernet addresses, values of the last byte are
-+ * evenly distributed and there is no need to consider other bytes.
-+ * It would only slow the routines down.
-+ *
-+ * For MAC address comparison speedup reasons, we introduce a trick.
-+ * MAC address is mapped onto an array of two 32-bit integers.
-+ * This pair of integers is compared with MAC addresses in the
-+ * hash table, which are stored also in form of pairs of integers
-+ * (in `cmp' array). This is quick as it requires only two elementary
-+ * number comparisons in worst case. Further, we take advantage of
-+ * fact that entropy of 3 last bytes of address is larger than entropy
-+ * of 3 first bytes. So first we compare 4 last bytes of addresses and
-+ * if they are the same we compare 2 first.
-+ *
-+ * Yes, it is a memory overhead, but in 2003 AD, who cares?
-+ */
-+
-+struct ebt_mac_wormhash_tuple
-+{
-+      uint32_t cmp[2];
-+      uint32_t ip;
-+};
-+
-+struct ebt_mac_wormhash
-+{
-+      int table[257];
-+      int poolsize;
-+      struct ebt_mac_wormhash_tuple pool[0];
-+};
-+
-+#define ebt_mac_wormhash_size(x) ((x) ? sizeof(struct ebt_mac_wormhash) \
-+              + (x)->poolsize * sizeof(struct ebt_mac_wormhash_tuple) : 0)
-+
-+struct ebt_among_info
-+{
-+      int wh_dst_ofs;
-+      int wh_src_ofs;
-+      int bitmask;
-+};
-+
-+#define EBT_AMONG_DST_NEG 0x1
-+#define EBT_AMONG_SRC_NEG 0x2
-+
-+#define ebt_among_wh_dst(x) ((x)->wh_dst_ofs ? \
-+      (struct ebt_mac_wormhash*)((char*)(x) + (x)->wh_dst_ofs) : NULL)
-+#define ebt_among_wh_src(x) ((x)->wh_src_ofs ? \
-+      (struct ebt_mac_wormhash*)((char*)(x) + (x)->wh_src_ofs) : NULL)
-+
-+#define EBT_AMONG_MATCH "among"
-+
-+#endif
-diff -Nurb src/linux/linux.stock/include/linux/netfilter_bridge/ebt_arp.h src/linux/linux/include/linux/netfilter_bridge/ebt_arp.h
---- src/linux/linux.stock/include/linux/netfilter_bridge/ebt_arp.h     1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/netfilter_bridge/ebt_arp.h   2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,32 @@
-+#ifndef __LINUX_BRIDGE_EBT_ARP_H
-+#define __LINUX_BRIDGE_EBT_ARP_H
-+
-+#define EBT_ARP_OPCODE 0x01
-+#define EBT_ARP_HTYPE 0x02
-+#define EBT_ARP_PTYPE 0x04
-+#define EBT_ARP_SRC_IP 0x08
-+#define EBT_ARP_DST_IP 0x10
-+#define EBT_ARP_SRC_MAC 0x20
-+#define EBT_ARP_DST_MAC 0x40
-+#define EBT_ARP_MASK (EBT_ARP_OPCODE | EBT_ARP_HTYPE | EBT_ARP_PTYPE | \
-+   EBT_ARP_SRC_IP | EBT_ARP_DST_IP | EBT_ARP_SRC_MAC | EBT_ARP_DST_MAC)
-+#define EBT_ARP_MATCH "arp"
-+
-+struct ebt_arp_info
-+{
-+      uint16_t htype;
-+      uint16_t ptype;
-+      uint16_t opcode;
-+      uint32_t saddr;
-+      uint32_t smsk;
-+      uint32_t daddr;
-+      uint32_t dmsk;
-+      unsigned char smaddr[ETH_ALEN];
-+      unsigned char smmsk[ETH_ALEN];
-+      unsigned char dmaddr[ETH_ALEN];
-+      unsigned char dmmsk[ETH_ALEN];
-+      uint8_t  bitmask;
-+      uint8_t  invflags;
-+};
-+
-+#endif
-diff -Nurb src/linux/linux.stock/include/linux/netfilter_bridge/ebt_arpreply.h src/linux/linux/include/linux/netfilter_bridge/ebt_arpreply.h
---- src/linux/linux.stock/include/linux/netfilter_bridge/ebt_arpreply.h        1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/netfilter_bridge/ebt_arpreply.h      2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,11 @@
-+#ifndef __LINUX_BRIDGE_EBT_ARPREPLY_H
-+#define __LINUX_BRIDGE_EBT_ARPREPLY_H
-+
-+struct ebt_arpreply_info
-+{
-+      unsigned char mac[ETH_ALEN];
-+      int target;
-+};
-+#define EBT_ARPREPLY_TARGET "arpreply"
-+
-+#endif
-diff -Nurb src/linux/linux.stock/include/linux/netfilter_bridge/ebt_ip.h src/linux/linux/include/linux/netfilter_bridge/ebt_ip.h
---- src/linux/linux.stock/include/linux/netfilter_bridge/ebt_ip.h      1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/netfilter_bridge/ebt_ip.h    2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,43 @@
-+/*
-+ *  ebt_ip
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ *  Changes:
-+ *    added ip-sport and ip-dport
-+ *    Innominate Security Technologies AG <mhopf@innominate.com>
-+ *    September, 2002
-+ */
-+
-+#ifndef __LINUX_BRIDGE_EBT_IP_H
-+#define __LINUX_BRIDGE_EBT_IP_H
-+
-+#define EBT_IP_SOURCE 0x01
-+#define EBT_IP_DEST 0x02
-+#define EBT_IP_TOS 0x04
-+#define EBT_IP_PROTO 0x08
-+#define EBT_IP_SPORT 0x10
-+#define EBT_IP_DPORT 0x20
-+#define EBT_IP_MASK (EBT_IP_SOURCE | EBT_IP_DEST | EBT_IP_TOS | EBT_IP_PROTO |\
-+ EBT_IP_SPORT | EBT_IP_DPORT )
-+#define EBT_IP_MATCH "ip"
-+
-+// the same values are used for the invflags
-+struct ebt_ip_info
-+{
-+      uint32_t saddr;
-+      uint32_t daddr;
-+      uint32_t smsk;
-+      uint32_t dmsk;
-+      uint8_t  tos;
-+      uint8_t  protocol;
-+      uint8_t  bitmask;
-+      uint8_t  invflags;
-+      uint16_t sport[2];
-+      uint16_t dport[2];
-+};
-+
-+#endif
-diff -Nurb src/linux/linux.stock/include/linux/netfilter_bridge/ebt_limit.h src/linux/linux/include/linux/netfilter_bridge/ebt_limit.h
---- src/linux/linux.stock/include/linux/netfilter_bridge/ebt_limit.h   1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/netfilter_bridge/ebt_limit.h 2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,23 @@
-+#ifndef __LINUX_BRIDGE_EBT_LIMIT_H
-+#define __LINUX_BRIDGE_EBT_LIMIT_H
-+
-+#define EBT_LIMIT_MATCH "limit"
-+
-+/* timings are in milliseconds. */
-+#define EBT_LIMIT_SCALE 10000
-+
-+/* 1/10,000 sec period => max of 10,000/sec.  Min rate is then 429490
-+   seconds, or one every 59 hours. */
-+
-+struct ebt_limit_info
-+{
-+      u_int32_t avg;    /* Average secs between packets * scale */
-+      u_int32_t burst;  /* Period multiplier for upper limit. */
-+
-+      /* Used internally by the kernel */
-+      unsigned long prev;
-+      u_int32_t credit;
-+      u_int32_t credit_cap, cost;
-+};
-+
-+#endif
-diff -Nurb src/linux/linux.stock/include/linux/netfilter_bridge/ebt_log.h src/linux/linux/include/linux/netfilter_bridge/ebt_log.h
---- src/linux/linux.stock/include/linux/netfilter_bridge/ebt_log.h     1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/netfilter_bridge/ebt_log.h   2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,17 @@
-+#ifndef __LINUX_BRIDGE_EBT_LOG_H
-+#define __LINUX_BRIDGE_EBT_LOG_H
-+
-+#define EBT_LOG_IP 0x01 // if the frame is made by ip, log the ip information
-+#define EBT_LOG_ARP 0x02
-+#define EBT_LOG_MASK (EBT_LOG_IP | EBT_LOG_ARP)
-+#define EBT_LOG_PREFIX_SIZE 30
-+#define EBT_LOG_WATCHER "log"
-+
-+struct ebt_log_info
-+{
-+      uint8_t loglevel;
-+      uint8_t prefix[EBT_LOG_PREFIX_SIZE];
-+      uint32_t bitmask;
-+};
-+
-+#endif
-diff -Nurb src/linux/linux.stock/include/linux/netfilter_bridge/ebt_mark_m.h src/linux/linux/include/linux/netfilter_bridge/ebt_mark_m.h
---- src/linux/linux.stock/include/linux/netfilter_bridge/ebt_mark_m.h  1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/netfilter_bridge/ebt_mark_m.h        2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,15 @@
-+#ifndef __LINUX_BRIDGE_EBT_MARK_M_H
-+#define __LINUX_BRIDGE_EBT_MARK_M_H
-+
-+#define EBT_MARK_AND 0x01
-+#define EBT_MARK_OR 0x02
-+#define EBT_MARK_MASK (EBT_MARK_AND | EBT_MARK_OR)
-+struct ebt_mark_m_info
-+{
-+      unsigned long mark, mask;
-+      uint8_t invert;
-+      uint8_t bitmask;
-+};
-+#define EBT_MARK_MATCH "mark_m"
-+
-+#endif
-diff -Nurb src/linux/linux.stock/include/linux/netfilter_bridge/ebt_mark_t.h src/linux/linux/include/linux/netfilter_bridge/ebt_mark_t.h
---- src/linux/linux.stock/include/linux/netfilter_bridge/ebt_mark_t.h  1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/netfilter_bridge/ebt_mark_t.h        2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,12 @@
-+#ifndef __LINUX_BRIDGE_EBT_MARK_T_H
-+#define __LINUX_BRIDGE_EBT_MARK_T_H
-+
-+struct ebt_mark_t_info
-+{
-+      unsigned long mark;
-+      // EBT_ACCEPT, EBT_DROP or EBT_CONTINUE or EBT_RETURN
-+      int target;
-+};
-+#define EBT_MARK_TARGET "mark"
-+
-+#endif
-diff -Nurb src/linux/linux.stock/include/linux/netfilter_bridge/ebt_nat.h src/linux/linux/include/linux/netfilter_bridge/ebt_nat.h
---- src/linux/linux.stock/include/linux/netfilter_bridge/ebt_nat.h     1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/netfilter_bridge/ebt_nat.h   2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,13 @@
-+#ifndef __LINUX_BRIDGE_EBT_NAT_H
-+#define __LINUX_BRIDGE_EBT_NAT_H
-+
-+struct ebt_nat_info
-+{
-+      unsigned char mac[ETH_ALEN];
-+      // EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN
-+      int target;
-+};
-+#define EBT_SNAT_TARGET "snat"
-+#define EBT_DNAT_TARGET "dnat"
-+
-+#endif
-diff -Nurb src/linux/linux.stock/include/linux/netfilter_bridge/ebt_pkttype.h src/linux/linux/include/linux/netfilter_bridge/ebt_pkttype.h
---- src/linux/linux.stock/include/linux/netfilter_bridge/ebt_pkttype.h 1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/netfilter_bridge/ebt_pkttype.h       2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,11 @@
-+#ifndef __LINUX_BRIDGE_EBT_PKTTYPE_H
-+#define __LINUX_BRIDGE_EBT_PKTTYPE_H
-+
-+struct ebt_pkttype_info
-+{
-+      uint8_t pkt_type;
-+      uint8_t invert;
-+};
-+#define EBT_PKTTYPE_MATCH "pkttype"
-+
-+#endif
-diff -Nurb src/linux/linux.stock/include/linux/netfilter_bridge/ebt_redirect.h src/linux/linux/include/linux/netfilter_bridge/ebt_redirect.h
---- src/linux/linux.stock/include/linux/netfilter_bridge/ebt_redirect.h        1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/netfilter_bridge/ebt_redirect.h      2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,11 @@
-+#ifndef __LINUX_BRIDGE_EBT_REDIRECT_H
-+#define __LINUX_BRIDGE_EBT_REDIRECT_H
-+
-+struct ebt_redirect_info
-+{
-+      // EBT_ACCEPT, EBT_DROP or EBT_CONTINUE or EBT_RETURN
-+      int target;
-+};
-+#define EBT_REDIRECT_TARGET "redirect"
-+
-+#endif
-diff -Nurb src/linux/linux.stock/include/linux/netfilter_bridge/ebt_stp.h src/linux/linux/include/linux/netfilter_bridge/ebt_stp.h
---- src/linux/linux.stock/include/linux/netfilter_bridge/ebt_stp.h     1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/netfilter_bridge/ebt_stp.h   2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,46 @@
-+#ifndef __LINUX_BRIDGE_EBT_STP_H
-+#define __LINUX_BRIDGE_EBT_STP_H
-+
-+#define EBT_STP_TYPE          0x0001
-+
-+#define EBT_STP_FLAGS         0x0002
-+#define EBT_STP_ROOTPRIO      0x0004
-+#define EBT_STP_ROOTADDR      0x0008
-+#define EBT_STP_ROOTCOST      0x0010
-+#define EBT_STP_SENDERPRIO    0x0020
-+#define EBT_STP_SENDERADDR    0x0040
-+#define EBT_STP_PORT          0x0080
-+#define EBT_STP_MSGAGE                0x0100
-+#define EBT_STP_MAXAGE                0x0200
-+#define EBT_STP_HELLOTIME     0x0400
-+#define EBT_STP_FWDD          0x0800
-+
-+#define EBT_STP_MASK          0x0fff
-+#define EBT_STP_CONFIG_MASK   0x0ffe
-+
-+#define EBT_STP_MATCH "stp"
-+
-+struct ebt_stp_config_info
-+{
-+      uint8_t flags;
-+      uint16_t root_priol, root_priou;
-+      char root_addr[6], root_addrmsk[6];
-+      uint32_t root_costl, root_costu;
-+      uint16_t sender_priol, sender_priou;
-+      char sender_addr[6], sender_addrmsk[6];
-+      uint16_t portl, portu;
-+      uint16_t msg_agel, msg_ageu;
-+      uint16_t max_agel, max_ageu;
-+      uint16_t hello_timel, hello_timeu;
-+      uint16_t forward_delayl, forward_delayu;
-+};
-+
-+struct ebt_stp_info
-+{
-+      uint8_t type;
-+      struct ebt_stp_config_info config;
-+      uint16_t bitmask;
-+      uint16_t invflags;
-+};
-+
-+#endif
-diff -Nurb src/linux/linux.stock/include/linux/netfilter_bridge/ebt_vlan.h src/linux/linux/include/linux/netfilter_bridge/ebt_vlan.h
---- src/linux/linux.stock/include/linux/netfilter_bridge/ebt_vlan.h    1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/netfilter_bridge/ebt_vlan.h  2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,20 @@
-+#ifndef __LINUX_BRIDGE_EBT_VLAN_H
-+#define __LINUX_BRIDGE_EBT_VLAN_H
-+
-+#define EBT_VLAN_ID   0x01
-+#define EBT_VLAN_PRIO 0x02
-+#define EBT_VLAN_ENCAP        0x04
-+#define EBT_VLAN_MASK (EBT_VLAN_ID | EBT_VLAN_PRIO | EBT_VLAN_ENCAP)
-+#define EBT_VLAN_MATCH "vlan"
-+
-+struct ebt_vlan_info {
-+      uint16_t id;            /* VLAN ID {1-4095} */
-+      uint8_t prio;           /* VLAN User Priority {0-7} */
-+      uint16_t encap;         /* VLAN Encapsulated frame code {0-65535} */
-+      uint8_t bitmask;                /* Args bitmask bit 1=1 - ID arg,
-+                                 bit 2=1 User-Priority arg, bit 3=1 encap*/
-+      uint8_t invflags;               /* Inverse bitmask  bit 1=1 - inversed ID arg, 
-+                                 bit 2=1 - inversed Pirority arg */
-+};
-+
-+#endif
-diff -Nurb src/linux/linux.stock/include/linux/netfilter_bridge/ebtables.h src/linux/linux/include/linux/netfilter_bridge/ebtables.h
---- src/linux/linux.stock/include/linux/netfilter_bridge/ebtables.h    1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/netfilter_bridge/ebtables.h  2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,361 @@
-+/*
-+ *  ebtables
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer                <bart.de.schuymer@pandora.be>
-+ *
-+ *  ebtables.c,v 2.0, September, 2002
-+ *
-+ *  This code is stongly inspired on the iptables code which is
-+ *  Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling
-+ */
-+
-+#ifndef __LINUX_BRIDGE_EFF_H
-+#define __LINUX_BRIDGE_EFF_H
-+#include <linux/if.h>
-+#include <linux/netfilter_bridge.h>
-+#include <linux/if_ether.h>
-+
-+#define EBT_TABLE_MAXNAMELEN 32
-+#define EBT_CHAIN_MAXNAMELEN EBT_TABLE_MAXNAMELEN
-+#define EBT_FUNCTION_MAXNAMELEN EBT_TABLE_MAXNAMELEN
-+
-+// verdicts >0 are "branches"
-+#define EBT_ACCEPT   -1
-+#define EBT_DROP     -2
-+#define EBT_CONTINUE -3
-+#define EBT_RETURN   -4
-+#define NUM_STANDARD_TARGETS   4
-+
-+struct ebt_counter
-+{
-+      uint64_t pcnt;
-+      uint64_t bcnt;
-+};
-+
-+struct ebt_entries {
-+      // this field is always set to zero
-+      // See EBT_ENTRY_OR_ENTRIES.
-+      // Must be same size as ebt_entry.bitmask
-+      unsigned int distinguisher;
-+      // the chain name
-+      char name[EBT_CHAIN_MAXNAMELEN];
-+      // counter offset for this chain
-+      unsigned int counter_offset;
-+      // one standard (accept, drop, return) per hook
-+      int policy;
-+      // nr. of entries
-+      unsigned int nentries;
-+      // entry list
-+      char data[0];
-+};
-+
-+// used for the bitmask of struct ebt_entry
-+
-+// This is a hack to make a difference between an ebt_entry struct and an
-+// ebt_entries struct when traversing the entries from start to end.
-+// Using this simplifies the code alot, while still being able to use
-+// ebt_entries.
-+// Contrary, iptables doesn't use something like ebt_entries and therefore uses
-+// different techniques for naming the policy and such. So, iptables doesn't
-+// need a hack like this.
-+#define EBT_ENTRY_OR_ENTRIES 0x01
-+// these are the normal masks
-+#define EBT_NOPROTO 0x02
-+#define EBT_802_3 0x04
-+#define EBT_SOURCEMAC 0x08
-+#define EBT_DESTMAC 0x10
-+#define EBT_F_MASK (EBT_NOPROTO | EBT_802_3 | EBT_SOURCEMAC | EBT_DESTMAC \
-+   | EBT_ENTRY_OR_ENTRIES)
-+
-+#define EBT_IPROTO 0x01
-+#define EBT_IIN 0x02
-+#define EBT_IOUT 0x04
-+#define EBT_ISOURCE 0x8
-+#define EBT_IDEST 0x10
-+#define EBT_ILOGICALIN 0x20
-+#define EBT_ILOGICALOUT 0x40
-+#define EBT_INV_MASK (EBT_IPROTO | EBT_IIN | EBT_IOUT | EBT_ILOGICALIN \
-+   | EBT_ILOGICALOUT | EBT_ISOURCE | EBT_IDEST)
-+
-+struct ebt_entry_match
-+{
-+      union {
-+              char name[EBT_FUNCTION_MAXNAMELEN];
-+              struct ebt_match *match;
-+      } u;
-+      // size of data
-+      unsigned int match_size;
-+      unsigned char data[0];
-+};
-+
-+struct ebt_entry_watcher
-+{
-+      union {
-+              char name[EBT_FUNCTION_MAXNAMELEN];
-+              struct ebt_watcher *watcher;
-+      } u;
-+      // size of data
-+      unsigned int watcher_size;
-+      unsigned char data[0];
-+};
-+
-+struct ebt_entry_target
-+{
-+      union {
-+              char name[EBT_FUNCTION_MAXNAMELEN];
-+              struct ebt_target *target;
-+      } u;
-+      // size of data
-+      unsigned int target_size;
-+      unsigned char data[0];
-+};
-+
-+#define EBT_STANDARD_TARGET "standard"
-+struct ebt_standard_target
-+{
-+      struct ebt_entry_target target;
-+      int verdict;
-+};
-+
-+// one entry
-+struct ebt_entry {
-+      // this needs to be the first field
-+      unsigned int bitmask;
-+      unsigned int invflags;
-+      uint16_t ethproto;
-+      // the physical in-dev
-+      char in[IFNAMSIZ];
-+      // the logical in-dev
-+      char logical_in[IFNAMSIZ];
-+      // the physical out-dev
-+      char out[IFNAMSIZ];
-+      // the logical out-dev
-+      char logical_out[IFNAMSIZ];
-+      unsigned char sourcemac[ETH_ALEN];
-+      unsigned char sourcemsk[ETH_ALEN];
-+      unsigned char destmac[ETH_ALEN];
-+      unsigned char destmsk[ETH_ALEN];
-+      // sizeof ebt_entry + matches
-+      unsigned int watchers_offset;
-+      // sizeof ebt_entry + matches + watchers
-+      unsigned int target_offset;
-+      // sizeof ebt_entry + matches + watchers + target
-+      unsigned int next_offset;
-+      unsigned char elems[0];
-+};
-+
-+struct ebt_replace
-+{
-+      char name[EBT_TABLE_MAXNAMELEN];
-+      unsigned int valid_hooks;
-+      // nr of rules in the table
-+      unsigned int nentries;
-+      // total size of the entries
-+      unsigned int entries_size;
-+      // start of the chains
-+      struct ebt_entries *hook_entry[NF_BR_NUMHOOKS];
-+      // nr of counters userspace expects back
-+      unsigned int num_counters;
-+      // where the kernel will put the old counters
-+      struct ebt_counter *counters;
-+      char *entries;
-+};
-+
-+// [gs]etsockopt numbers
-+#define EBT_BASE_CTL            128
-+
-+#define EBT_SO_SET_ENTRIES      (EBT_BASE_CTL)
-+#define EBT_SO_SET_COUNTERS     (EBT_SO_SET_ENTRIES+1)
-+#define EBT_SO_SET_MAX          (EBT_SO_SET_COUNTERS+1)
-+
-+#define EBT_SO_GET_INFO         (EBT_BASE_CTL)
-+#define EBT_SO_GET_ENTRIES      (EBT_SO_GET_INFO+1)
-+#define EBT_SO_GET_INIT_INFO    (EBT_SO_GET_ENTRIES+1)
-+#define EBT_SO_GET_INIT_ENTRIES (EBT_SO_GET_INIT_INFO+1)
-+#define EBT_SO_GET_MAX          (EBT_SO_GET_INIT_ENTRIES+1)
-+
-+#ifdef __KERNEL__
-+
-+// return values for match() functions
-+#define EBT_MATCH 0
-+#define EBT_NOMATCH 1
-+
-+struct ebt_match
-+{
-+      struct list_head list;
-+      const char name[EBT_FUNCTION_MAXNAMELEN];
-+      // 0 == it matches
-+      int (*match)(const struct sk_buff *skb, const struct net_device *in,
-+         const struct net_device *out, const void *matchdata,
-+         unsigned int datalen);
-+      // 0 == let it in
-+      int (*check)(const char *tablename, unsigned int hookmask,
-+         const struct ebt_entry *e, void *matchdata, unsigned int datalen);
-+      void (*destroy)(void *matchdata, unsigned int datalen);
-+      struct module *me;
-+};
-+
-+struct ebt_watcher
-+{
-+      struct list_head list;
-+      const char name[EBT_FUNCTION_MAXNAMELEN];
-+      void (*watcher)(const struct sk_buff *skb, const struct net_device *in,
-+         const struct net_device *out, const void *watcherdata,
-+         unsigned int datalen);
-+      // 0 == let it in
-+      int (*check)(const char *tablename, unsigned int hookmask,
-+         const struct ebt_entry *e, void *watcherdata, unsigned int datalen);
-+      void (*destroy)(void *watcherdata, unsigned int datalen);
-+      struct module *me;
-+};
-+
-+struct ebt_target
-+{
-+      struct list_head list;
-+      const char name[EBT_FUNCTION_MAXNAMELEN];
-+      // returns one of the standard verdicts
-+      int (*target)(struct sk_buff **pskb, unsigned int hooknr,
-+         const struct net_device *in, const struct net_device *out,
-+         const void *targetdata, unsigned int datalen);
-+      // 0 == let it in
-+      int (*check)(const char *tablename, unsigned int hookmask,
-+         const struct ebt_entry *e, void *targetdata, unsigned int datalen);
-+      void (*destroy)(void *targetdata, unsigned int datalen);
-+      struct module *me;
-+};
-+
-+// used for jumping from and into user defined chains (udc)
-+struct ebt_chainstack
-+{
-+      struct ebt_entries *chaininfo; // pointer to chain data
-+      struct ebt_entry *e; // pointer to entry data
-+      unsigned int n; // n'th entry
-+};
-+
-+struct ebt_table_info
-+{
-+      // total size of the entries
-+      unsigned int entries_size;
-+      unsigned int nentries;
-+      // pointers to the start of the chains
-+      struct ebt_entries *hook_entry[NF_BR_NUMHOOKS];
-+      // room to maintain the stack used for jumping from and into udc
-+      struct ebt_chainstack **chainstack;
-+      char *entries;
-+      struct ebt_counter counters[0] ____cacheline_aligned;
-+};
-+
-+struct ebt_table
-+{
-+      struct list_head list;
-+      char name[EBT_TABLE_MAXNAMELEN];
-+      struct ebt_replace *table;
-+      unsigned int valid_hooks;
-+      rwlock_t lock;
-+      // e.g. could be the table explicitly only allows certain
-+      // matches, targets, ... 0 == let it in
-+      int (*check)(const struct ebt_table_info *info,
-+         unsigned int valid_hooks);
-+      // the data used by the kernel
-+      struct ebt_table_info *private;
-+};
-+
-+#define EBT_ALIGN(s) (((s) + (__alignof__(struct ebt_entry_target)-1)) & \
-+                   ~(__alignof__(struct ebt_entry_target)-1))
-+extern int ebt_register_table(struct ebt_table *table);
-+extern void ebt_unregister_table(struct ebt_table *table);
-+extern int ebt_register_match(struct ebt_match *match);
-+extern void ebt_unregister_match(struct ebt_match *match);
-+extern int ebt_register_watcher(struct ebt_watcher *watcher);
-+extern void ebt_unregister_watcher(struct ebt_watcher *watcher);
-+extern int ebt_register_target(struct ebt_target *target);
-+extern void ebt_unregister_target(struct ebt_target *target);
-+extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   struct ebt_table *table);
-+
-+   // Used in the kernel match() functions
-+#define FWINV(bool,invflg) ((bool) ^ !!(info->invflags & invflg))
-+// True if the hook mask denotes that the rule is in a base chain,
-+// used in the check() functions
-+#define BASE_CHAIN (hookmask & (1 << NF_BR_NUMHOOKS))
-+// Clear the bit in the hook mask that tells if the rule is on a base chain
-+#define CLEAR_BASE_CHAIN_BIT (hookmask &= ~(1 << NF_BR_NUMHOOKS))
-+// True if the target is not a standard target
-+#define INVALID_TARGET (info->target < -NUM_STANDARD_TARGETS || info->target >= 0)
-+
-+#endif /* __KERNEL__ */
-+
-+// blatently stolen from ip_tables.h
-+// fn returns 0 to continue iteration
-+#define EBT_MATCH_ITERATE(e, fn, args...)                   \
-+({                                                          \
-+      unsigned int __i;                                   \
-+      int __ret = 0;                                      \
-+      struct ebt_entry_match *__match;                    \
-+                                                          \
-+      for (__i = sizeof(struct ebt_entry);                \
-+           __i < (e)->watchers_offset;                    \
-+           __i += __match->match_size +                   \
-+           sizeof(struct ebt_entry_match)) {              \
-+              __match = (void *)(e) + __i;                \
-+                                                          \
-+              __ret = fn(__match , ## args);              \
-+              if (__ret != 0)                             \
-+                      break;                              \
-+      }                                                   \
-+      if (__ret == 0) {                                   \
-+              if (__i != (e)->watchers_offset)            \
-+                      __ret = -EINVAL;                    \
-+      }                                                   \
-+      __ret;                                              \
-+})
-+
-+#define EBT_WATCHER_ITERATE(e, fn, args...)                 \
-+({                                                          \
-+      unsigned int __i;                                   \
-+      int __ret = 0;                                      \
-+      struct ebt_entry_watcher *__watcher;                \
-+                                                          \
-+      for (__i = e->watchers_offset;                      \
-+           __i < (e)->target_offset;                      \
-+           __i += __watcher->watcher_size +               \
-+           sizeof(struct ebt_entry_watcher)) {            \
-+              __watcher = (void *)(e) + __i;              \
-+                                                          \
-+              __ret = fn(__watcher , ## args);            \
-+              if (__ret != 0)                             \
-+                      break;                              \
-+      }                                                   \
-+      if (__ret == 0) {                                   \
-+              if (__i != (e)->target_offset)              \
-+                      __ret = -EINVAL;                    \
-+      }                                                   \
-+      __ret;                                              \
-+})
-+
-+#define EBT_ENTRY_ITERATE(entries, size, fn, args...)       \
-+({                                                          \
-+      unsigned int __i;                                   \
-+      int __ret = 0;                                      \
-+      struct ebt_entry *__entry;                          \
-+                                                          \
-+      for (__i = 0; __i < (size);) {                      \
-+              __entry = (void *)(entries) + __i;          \
-+              __ret = fn(__entry , ## args);              \
-+              if (__ret != 0)                             \
-+                      break;                              \
-+              if (__entry->bitmask != 0)                  \
-+                      __i += __entry->next_offset;        \
-+              else                                        \
-+                      __i += sizeof(struct ebt_entries);  \
-+      }                                                   \
-+      if (__ret == 0) {                                   \
-+              if (__i != (size))                          \
-+                      __ret = -EINVAL;                    \
-+      }                                                   \
-+      __ret;                                              \
-+})
-+
-+#endif
-diff -Nurb src/linux/linux.stock/include/linux/netfilter_bridge.h src/linux/linux/include/linux/netfilter_bridge.h
---- src/linux/linux.stock/include/linux/netfilter_bridge.h     2003-07-04 04:12:26.000000000 -0400
-+++ src/linux/linux/include/linux/netfilter_bridge.h   2004-07-10 23:46:39.000000000 -0400
-@@ -6,6 +6,10 @@
- #include <linux/config.h>
- #include <linux/netfilter.h>
-+#if defined(__KERNEL__) && defined(CONFIG_NETFILTER)
-+#include <asm/atomic.h>
-+#include <linux/if_ether.h>
-+#endif
- /* Bridge Hooks */
- /* After promisc drops, checksum checks. */
-@@ -18,7 +22,76 @@
- #define NF_BR_LOCAL_OUT               3
- /* Packets about to hit the wire. */
- #define NF_BR_POST_ROUTING    4
--#define NF_BR_NUMHOOKS                5
-+/* Not really a hook, but used for the ebtables broute table */
-+#define NF_BR_BROUTING                5
-+#define NF_BR_NUMHOOKS                6
-+
-+#ifdef __KERNEL__
-+
-+#define BRNF_PKT_TYPE                 0x01
-+#define BRNF_BRIDGED_DNAT             0x02
-+#define BRNF_DONT_TAKE_PARENT         0x04
-+#define BRNF_BRIDGED                  0x08
-+#define BRNF_NF_BRIDGE_PREROUTING     0x10
-+
-+enum nf_br_hook_priorities {
-+      NF_BR_PRI_FIRST = INT_MIN,
-+      NF_BR_PRI_NAT_DST_BRIDGED = -300,
-+      NF_BR_PRI_FILTER_BRIDGED = -200,
-+      NF_BR_PRI_BRNF = 0,
-+      NF_BR_PRI_NAT_DST_OTHER = 100,
-+      NF_BR_PRI_FILTER_OTHER = 200,
-+      NF_BR_PRI_NAT_SRC = 300,
-+      NF_BR_PRI_LAST = INT_MAX,
-+};
-+
-+#ifdef CONFIG_NETFILTER
-+static inline
-+struct nf_bridge_info *nf_bridge_alloc(struct sk_buff *skb)
-+{
-+      struct nf_bridge_info **nf_bridge = &(skb->nf_bridge);
-+
-+      if ((*nf_bridge = kmalloc(sizeof(**nf_bridge), GFP_ATOMIC)) != NULL) {
-+              atomic_set(&(*nf_bridge)->use, 1);
-+              (*nf_bridge)->mask = 0;
-+              (*nf_bridge)->physindev = (*nf_bridge)->physoutdev = NULL;
-+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
-+              (*nf_bridge)->netoutdev = NULL;
-+#endif
-+      }
-+
-+      return *nf_bridge;
-+}
-+
-+/* Only used in br_forward.c */
-+static inline
-+void nf_bridge_maybe_copy_header(struct sk_buff *skb)
-+{
-+      if (skb->nf_bridge) {
-+              if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+                      memcpy(skb->data - 18, skb->nf_bridge->data, 18);
-+                      skb_push(skb, 4);
-+              } else
-+                      memcpy(skb->data - 16, skb->nf_bridge->data, 16);
-+      }
-+}
-+
-+static inline
-+void nf_bridge_save_header(struct sk_buff *skb)
-+{
-+        int header_size = 16;
-+
-+      if (skb->protocol == __constant_htons(ETH_P_8021Q))
-+              header_size = 18;
-+      memcpy(skb->nf_bridge->data, skb->data - header_size, header_size);
-+}
-+struct bridge_skb_cb {
-+      union {
-+              __u32 ipv4;
-+      } daddr;
-+};
-+#endif /* CONFIG_NETFILTER */
-+#endif /* __KERNEL__ */
- #endif
-diff -Nurb src/linux/linux.stock/include/linux/netfilter_ipv4/ipt_physdev.h src/linux/linux/include/linux/netfilter_ipv4/ipt_physdev.h
---- src/linux/linux.stock/include/linux/netfilter_ipv4/ipt_physdev.h   1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/netfilter_ipv4/ipt_physdev.h 2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,24 @@
-+#ifndef _IPT_PHYSDEV_H
-+#define _IPT_PHYSDEV_H
-+
-+#ifdef __KERNEL__
-+#include <linux/if.h>
-+#endif
-+
-+#define IPT_PHYSDEV_OP_IN             0x01
-+#define IPT_PHYSDEV_OP_OUT            0x02
-+#define IPT_PHYSDEV_OP_BRIDGED                0x04
-+#define IPT_PHYSDEV_OP_ISIN           0x08
-+#define IPT_PHYSDEV_OP_ISOUT          0x10
-+#define IPT_PHYSDEV_OP_MASK           (0x20 - 1)
-+
-+struct ipt_physdev_info {
-+      char physindev[IFNAMSIZ];
-+      char in_mask[IFNAMSIZ];
-+      char physoutdev[IFNAMSIZ];
-+      char out_mask[IFNAMSIZ];
-+      u_int8_t invert;
-+      u_int8_t bitmask;
-+};
-+
-+#endif /*_IPT_PHYSDEV_H*/
-diff -Nurb src/linux/linux.stock/include/linux/netfilter_ipv4.h src/linux/linux/include/linux/netfilter_ipv4.h
---- src/linux/linux.stock/include/linux/netfilter_ipv4.h       2004-07-10 23:30:09.000000000 -0400
-+++ src/linux/linux/include/linux/netfilter_ipv4.h     2004-07-10 23:46:39.000000000 -0400
-@@ -54,8 +54,10 @@
-       NF_IP_PRI_CONNTRACK_DEFRAG = -400,
-       NF_IP_PRI_RAW = -300,
-       NF_IP_PRI_CONNTRACK = -200,
-+      NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD = -175,
-       NF_IP_PRI_MANGLE = -150,
-       NF_IP_PRI_NAT_DST = -100,
-+      NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT = -50,
-       NF_IP_PRI_FILTER = 0,
-       NF_IP_PRI_NAT_SRC = 100,
-       NF_IP_PRI_LAST = INT_MAX,
-diff -Nurb src/linux/linux.stock/include/linux/skbuff.h src/linux/linux/include/linux/skbuff.h
---- src/linux/linux.stock/include/linux/skbuff.h       2003-07-04 04:12:26.000000000 -0400
-+++ src/linux/linux/include/linux/skbuff.h     2004-07-10 23:46:39.000000000 -0400
-@@ -92,6 +92,20 @@
- struct nf_ct_info {
-       struct nf_conntrack *master;
- };
-+
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+struct nf_bridge_info {
-+      atomic_t use;
-+      struct net_device *physindev;
-+      struct net_device *physoutdev;
-+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
-+      struct net_device *netoutdev;
-+#endif
-+      unsigned int mask;
-+      unsigned long data[32 / sizeof(unsigned long)];
-+};
-+#endif
-+
- #endif
- struct sk_buff_head {
-@@ -204,6 +218,9 @@
- #ifdef CONFIG_NETFILTER_DEBUG
-         unsigned int nf_debug;
- #endif
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      struct nf_bridge_info   *nf_bridge;     /* Saved data about a bridged frame - see br_netfilter.c */
-+#endif
- #endif /*CONFIG_NETFILTER*/
- #if defined(CONFIG_HIPPI)
-@@ -1143,6 +1160,20 @@
-       if (nfct)
-               atomic_inc(&nfct->master->use);
- }
-+
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+static inline void nf_bridge_put(struct nf_bridge_info *nf_bridge)
-+{
-+      if (nf_bridge && atomic_dec_and_test(&nf_bridge->use))
-+              kfree(nf_bridge);
-+}
-+static inline void nf_bridge_get(struct nf_bridge_info *nf_bridge)
-+{
-+      if (nf_bridge)
-+              atomic_inc(&nf_bridge->use);
-+}
-+#endif
-+
- #endif
- #endif        /* __KERNEL__ */
-diff -Nurb src/linux/linux.stock/include/linux/sysctl.h src/linux/linux/include/linux/sysctl.h
---- src/linux/linux.stock/include/linux/sysctl.h       2004-07-10 23:29:55.000000000 -0400
-+++ src/linux/linux/include/linux/sysctl.h     2004-07-10 23:46:39.000000000 -0400
-@@ -547,6 +547,15 @@
-       NET_DECNET_CONF_DEV_STATE = 7
- };
-+/* /proc/sys/net/bridge */
-+enum {
-+      NET_BRIDGE_NF_CALL_ARPTABLES = 1,
-+      NET_BRIDGE_NF_CALL_IPTABLES = 2,
-+      NET_BRIDGE_NF_CALL_IP6TABLES = 3,
-+      NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4,
-+};
-+
-+
- /* CTL_PROC names: */
- /* CTL_FS names: */
-diff -Nurb src/linux/linux.stock/net/8021q/vlan_dev.c src/linux/linux/net/8021q/vlan_dev.c
---- src/linux/linux.stock/net/8021q/vlan_dev.c 2003-07-04 04:12:29.000000000 -0400
-+++ src/linux/linux/net/8021q/vlan_dev.c       2004-07-10 23:46:39.000000000 -0400
-@@ -503,6 +503,10 @@
-       stats->tx_packets++; /* for statics only */
-       stats->tx_bytes += skb->len;
-+      skb->protocol = __constant_htons(ETH_P_8021Q);
-+      skb->mac.raw -= VLAN_HLEN;
-+      skb->nh.raw -= VLAN_HLEN;
-+
-       dev_queue_xmit(skb);
-       return 0;
-diff -Nurb src/linux/linux.stock/net/Config.in src/linux/linux/net/Config.in
---- src/linux/linux.stock/net/Config.in        2004-07-10 23:29:49.000000000 -0400
-+++ src/linux/linux/net/Config.in      2004-07-10 23:46:39.000000000 -0400
-@@ -68,6 +68,9 @@
-    source net/decnet/Config.in
- fi
- dep_tristate '802.1d Ethernet Bridging' CONFIG_BRIDGE $CONFIG_INET
-+if [ "$CONFIG_BRIDGE" != "n" -a "$CONFIG_NETFILTER" != "n" ]; then
-+   source net/bridge/netfilter/Config.in
-+fi
- if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-    tristate 'CCITT X.25 Packet Layer (EXPERIMENTAL)' CONFIG_X25
-    tristate 'LAPB Data Link Driver (EXPERIMENTAL)' CONFIG_LAPB
-diff -Nurb src/linux/linux.stock/net/Makefile src/linux/linux/net/Makefile
---- src/linux/linux.stock/net/Makefile 2004-07-10 23:29:49.000000000 -0400
-+++ src/linux/linux/net/Makefile       2004-07-10 23:49:10.000000000 -0400
-@@ -26,6 +26,12 @@
- endif
- endif
-+ifneq ($(CONFIG_BRIDGE),n)
-+ifneq ($(CONFIG_BRIDGE),)
-+subdir-$(CONFIG_BRIDGE)               += bridge/netfilter
-+endif
-+endif
-+
- subdir-$(CONFIG_KHTTPD)               += khttpd
- subdir-$(CONFIG_PACKET)               += packet
- subdir-$(CONFIG_NET_SCHED)    += sched
-diff -Nurb src/linux/linux.stock/net/bridge/Makefile src/linux/linux/net/bridge/Makefile
---- src/linux/linux.stock/net/bridge/Makefile  2003-07-04 04:12:30.000000000 -0400
-+++ src/linux/linux/net/bridge/Makefile        2004-07-10 23:46:39.000000000 -0400
-@@ -7,10 +7,17 @@
- #
- # Note 2! The CFLAGS definition is now in the main makefile...
-+export-objs := br.o
-+
- O_TARGET      := bridge.o
- obj-y         := br.o br_device.o br_fdb.o br_forward.o br_if.o br_input.o \
-                       br_ioctl.o br_notify.o br_stp.o br_stp_bpdu.o \
-                       br_stp_if.o br_stp_timer.o
-+
-+ifeq ($(CONFIG_NETFILTER),y)
-+obj-y         += br_netfilter.o
-+endif
-+
- obj-m         := $(O_TARGET)
- include $(TOPDIR)/Rules.make
-diff -Nurb src/linux/linux.stock/net/bridge/br.c src/linux/linux/net/bridge/br.c
---- src/linux/linux.stock/net/bridge/br.c      2003-10-14 04:09:32.000000000 -0400
-+++ src/linux/linux/net/bridge/br.c    2004-07-10 23:46:39.000000000 -0400
-@@ -29,6 +29,8 @@
- #include "../atm/lec.h"
- #endif
-+int (*br_should_route_hook) (struct sk_buff **pskb) = NULL;
-+
- void br_dec_use_count()
- {
-       MOD_DEC_USE_COUNT;
-@@ -43,6 +45,10 @@
- {
-       printk(KERN_INFO "NET4: Ethernet Bridge 008 for NET4.0\n");
-+#ifdef CONFIG_NETFILTER
-+      if (br_netfilter_init())
-+              return 1;
-+#endif
-       br_handle_frame_hook = br_handle_frame;
-       br_ioctl_hook = br_ioctl_deviceless_stub;
- #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
-@@ -61,6 +67,9 @@
- static void __exit br_deinit(void)
- {
-+#ifdef CONFIG_NETFILTER
-+      br_netfilter_fini();
-+#endif
-       unregister_netdevice_notifier(&br_device_notifier);
-       br_call_ioctl_atomic(__br_clear_ioctl_hook);
-@@ -74,7 +83,7 @@
- #endif
- }
--EXPORT_NO_SYMBOLS;
-+EXPORT_SYMBOL(br_should_route_hook);
- module_init(br_init)
- module_exit(br_deinit)
-diff -Nurb src/linux/linux.stock/net/bridge/br_forward.c src/linux/linux/net/bridge/br_forward.c
---- src/linux/linux.stock/net/bridge/br_forward.c      2003-10-14 04:09:32.000000000 -0400
-+++ src/linux/linux/net/bridge/br_forward.c    2004-07-10 23:46:39.000000000 -0400
-@@ -30,18 +30,21 @@
-       return 1;
- }
--static int __dev_queue_push_xmit(struct sk_buff *skb)
-+int br_dev_queue_push_xmit(struct sk_buff *skb)
- {
-+#ifdef CONFIG_NETFILTER
-+      nf_bridge_maybe_copy_header(skb);
-+#endif
-       skb_push(skb, ETH_HLEN);
-       dev_queue_xmit(skb);
-       return 0;
- }
--static int __br_forward_finish(struct sk_buff *skb)
-+int br_forward_finish(struct sk_buff *skb)
- {
-       NF_HOOK(PF_BRIDGE, NF_BR_POST_ROUTING, skb, NULL, skb->dev,
--                      __dev_queue_push_xmit);
-+                      br_dev_queue_push_xmit);
-       return 0;
- }
-@@ -49,8 +52,11 @@
- static void __br_deliver(struct net_bridge_port *to, struct sk_buff *skb)
- {
-       skb->dev = to->dev;
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug = 0;
-+#endif
-       NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev,
--                      __br_forward_finish);
-+                      br_forward_finish);
- }
- static void __br_forward(struct net_bridge_port *to, struct sk_buff *skb)
-@@ -61,7 +67,7 @@
-       skb->dev = to->dev;
-       NF_HOOK(PF_BRIDGE, NF_BR_FORWARD, skb, indev, skb->dev,
--                      __br_forward_finish);
-+                      br_forward_finish);
- }
- /* called under bridge lock */
-diff -Nurb src/linux/linux.stock/net/bridge/br_input.c src/linux/linux/net/bridge/br_input.c
---- src/linux/linux.stock/net/bridge/br_input.c        2003-10-14 04:09:32.000000000 -0400
-+++ src/linux/linux/net/bridge/br_input.c      2004-07-10 23:48:36.000000000 -0400
-@@ -24,6 +24,9 @@
- static int br_pass_frame_up_finish(struct sk_buff *skb)
- {
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug = 0;
-+#endif
-       netif_rx(skb);
-       return 0;
-@@ -46,7 +49,7 @@
-                       br_pass_frame_up_finish);
- }
--static int br_handle_frame_finish(struct sk_buff *skb)
-+int br_handle_frame_finish(struct sk_buff *skb)
- {
-       struct net_bridge *br;
-       unsigned char *dest;
-@@ -112,7 +115,7 @@
-       return 0;
- }
--void br_handle_frame(struct sk_buff *skb)
-+int br_handle_frame(struct sk_buff *skb)
- {
-       struct net_bridge *br;
-       unsigned char *dest;
-@@ -146,25 +149,34 @@
-               goto handle_special_frame;
-       if (p->state == BR_STATE_FORWARDING) {
-+              if (br_should_route_hook && br_should_route_hook(&skb)) {
-+                      read_unlock(&br->lock);
-+                      return -1;
-+              }
-+ 
-+              if (!memcmp(p->br->dev.dev_addr, dest, ETH_ALEN))
-+                      skb->pkt_type = PACKET_HOST;
-+ 
-               NF_HOOK(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL,
-                       br_handle_frame_finish);
-               read_unlock(&br->lock);
--              return;
-+              return 0;
-       }
- err:
-       read_unlock(&br->lock);
- err_nolock:
-       kfree_skb(skb);
--      return;
-+      return 0;
- handle_special_frame:
-       if (!dest[5]) {
-               br_stp_handle_bpdu(skb);
-               read_unlock(&br->lock);
--              return;
-+              return 0;
-       }
-       read_unlock(&br->lock);
-       kfree_skb(skb);
-+      return 0;
- }
-diff -Nurb src/linux/linux.stock/net/bridge/br_netfilter.c src/linux/linux/net/bridge/br_netfilter.c
---- src/linux/linux.stock/net/bridge/br_netfilter.c    1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/br_netfilter.c  2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,896 @@
-+/*
-+ *    Handle firewalling
-+ *    Linux ethernet bridge
-+ *
-+ *    Authors:
-+ *    Lennert Buytenhek               <buytenh@gnu.org>
-+ *    Bart De Schuymer (maintainer)   <bdschuym@pandora.be>
-+ *
-+ *    Changes:
-+ *    Apr 29 2003: physdev module support (bdschuym)
-+ *    Jun 19 2003: let arptables see bridged ARP traffic (bdschuym)
-+ *    Oct 06 2003: filter encapsulated IP/ARP VLAN traffic on untagged bridge
-+ *                 (bdschuym)
-+ *
-+ *    This program is free software; you can redistribute it and/or
-+ *    modify it under the terms of the GNU General Public License
-+ *    as published by the Free Software Foundation; either version
-+ *    2 of the License, or (at your option) any later version.
-+ *
-+ *    Lennert dedicates this file to Kerstin Wurdinger.
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/kernel.h>
-+#include <linux/ip.h>
-+#include <linux/netdevice.h>
-+#include <linux/skbuff.h>
-+#include <linux/if_ether.h>
-+#include <linux/if_vlan.h>
-+#include <linux/netfilter_bridge.h>
-+#include <linux/netfilter_ipv4.h>
-+#include <linux/in_route.h>
-+#include <net/ip.h>
-+#include <asm/uaccess.h>
-+#include <asm/checksum.h>
-+#include "br_private.h"
-+#ifdef CONFIG_SYSCTL
-+#include <linux/sysctl.h>
-+#endif
-+
-+
-+#define skb_origaddr(skb)      (((struct bridge_skb_cb *) \
-+                               (skb->nf_bridge->data))->daddr.ipv4)
-+#define store_orig_dstaddr(skb)        (skb_origaddr(skb) = (skb)->nh.iph->daddr)
-+#define dnat_took_place(skb)   (skb_origaddr(skb) != (skb)->nh.iph->daddr)
-+
-+#define has_bridge_parent(device)     ((device)->br_port != NULL)
-+#define bridge_parent(device)         (&((device)->br_port->br->dev))
-+
-+#ifdef CONFIG_SYSCTL
-+static struct ctl_table_header *brnf_sysctl_header;
-+static int brnf_call_iptables = 1;
-+static int brnf_call_arptables = 1;
-+static int brnf_filter_vlan_tagged = 1;
-+#else
-+#define brnf_filter_vlan_tagged 1
-+#endif
-+
-+#define IS_VLAN_IP (skb->protocol == __constant_htons(ETH_P_8021Q) &&    \
-+      hdr->h_vlan_encapsulated_proto == __constant_htons(ETH_P_IP) &&  \
-+      brnf_filter_vlan_tagged)
-+/*
-+#define IS_VLAN_ARP (skb->protocol == __constant_htons(ETH_P_8021Q) &&   \
-+      hdr->h_vlan_encapsulated_proto == __constant_htons(ETH_P_ARP) && \
-+      brnf_filter_vlan_tagged)
-+*/
-+
-+/* We need these fake structures to make netfilter happy --
-+ * lots of places assume that skb->dst != NULL, which isn't
-+ * all that unreasonable.
-+ *
-+ * Currently, we fill in the PMTU entry because netfilter
-+ * refragmentation needs it, and the rt_flags entry because
-+ * ipt_REJECT needs it.  Future netfilter modules might
-+ * require us to fill additional fields.
-+ */
-+static struct net_device __fake_net_device = {
-+      .hard_header_len        = ETH_HLEN
-+};
-+
-+static struct rtable __fake_rtable = {
-+      u: {
-+              dst: {
-+                      __refcnt:               ATOMIC_INIT(1),
-+                      dev:                    &__fake_net_device,
-+                      pmtu:                   1500
-+              }
-+      },
-+
-+      rt_flags:       0
-+};
-+
-+
-+/* PF_BRIDGE/PRE_ROUTING *********************************************/
-+static void __br_dnat_complain(void)
-+{
-+      static unsigned long last_complaint;
-+
-+      if (jiffies - last_complaint >= 5 * HZ) {
-+              printk(KERN_WARNING "Performing cross-bridge DNAT requires IP "
-+                      "forwarding to be enabled\n");
-+              last_complaint = jiffies;
-+      }
-+}
-+
-+
-+/* This requires some explaining. If DNAT has taken place,
-+ * we will need to fix up the destination Ethernet address,
-+ * and this is a tricky process.
-+ *
-+ * There are two cases to consider:
-+ * 1. The packet was DNAT'ed to a device in the same bridge
-+ *    port group as it was received on. We can still bridge
-+ *    the packet.
-+ * 2. The packet was DNAT'ed to a different device, either
-+ *    a non-bridged device or another bridge port group.
-+ *    The packet will need to be routed.
-+ *
-+ * The correct way of distinguishing between these two cases is to
-+ * call ip_route_input() and to look at skb->dst->dev, which is
-+ * changed to the destination device if ip_route_input() succeeds.
-+ *
-+ * Let us first consider the case that ip_route_input() succeeds:
-+ *
-+ * If skb->dst->dev equals the logical bridge device the packet
-+ * came in on, we can consider this bridging. We then call
-+ * skb->dst->output() which will make the packet enter br_nf_local_out()
-+ * not much later. In that function it is assured that the iptables
-+ * FORWARD chain is traversed for the packet.
-+ *
-+ * Otherwise, the packet is considered to be routed and we just
-+ * change the destination MAC address so that the packet will
-+ * later be passed up to the IP stack to be routed.
-+ *
-+ * Let us now consider the case that ip_route_input() fails:
-+ *
-+ * After a "echo '0' > /proc/sys/net/ipv4/ip_forward" ip_route_input()
-+ * will fail, while __ip_route_output_key() will return success. The source
-+ * address for __ip_route_output_key() is set to zero, so __ip_route_output_key
-+ * thinks we're handling a locally generated packet and won't care
-+ * if IP forwarding is allowed. We send a warning message to the users's
-+ * log telling her to put IP forwarding on.
-+ *
-+ * ip_route_input() will also fail if there is no route available.
-+ * In that case we just drop the packet.
-+ *
-+ * --Lennert, 20020411
-+ * --Bart, 20020416 (updated)
-+ * --Bart, 20021007 (updated)
-+ */
-+
-+static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb)
-+{
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug |= (1 << NF_BR_PRE_ROUTING) | (1 << NF_BR_FORWARD);
-+#endif
-+
-+      if (skb->pkt_type == PACKET_OTHERHOST) {
-+              skb->pkt_type = PACKET_HOST;
-+              skb->nf_bridge->mask |= BRNF_PKT_TYPE;
-+      }
-+      skb->nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING;
-+
-+      skb->dev = bridge_parent(skb->dev);
-+      if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+              skb_pull(skb, VLAN_HLEN);
-+              skb->nh.raw += VLAN_HLEN;
-+      }
-+      skb->dst->output(skb);
-+      return 0;
-+}
-+
-+static int br_nf_pre_routing_finish(struct sk_buff *skb)
-+{
-+      struct net_device *dev = skb->dev;
-+      struct iphdr *iph = skb->nh.iph;
-+      struct nf_bridge_info *nf_bridge = skb->nf_bridge;
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug ^= (1 << NF_BR_PRE_ROUTING);
-+#endif
-+
-+      if (nf_bridge->mask & BRNF_PKT_TYPE) {
-+              skb->pkt_type = PACKET_OTHERHOST;
-+              nf_bridge->mask ^= BRNF_PKT_TYPE;
-+      }
-+      nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING;
-+
-+      if (dnat_took_place(skb)) {
-+              if (ip_route_input(skb, iph->daddr, iph->saddr, iph->tos,
-+                  dev)) {
-+                      struct rtable *rt;
-+
-+                      if (!ip_route_output(&rt, iph->daddr, 0, iph->tos, 0)) {
-+                              /* Bridged-and-DNAT'ed traffic doesn't
-+                               * require ip_forwarding.
-+                               */
-+                              if (((struct dst_entry *)rt)->dev == dev) {
-+                                      skb->dst = (struct dst_entry *)rt;
-+                                      goto bridged_dnat;
-+                              }
-+                              __br_dnat_complain();
-+                              dst_release((struct dst_entry *)rt);
-+                      }
-+                      kfree_skb(skb);
-+                      return 0;
-+              } else {
-+                      if (skb->dst->dev == dev) {
-+bridged_dnat:
-+                              /* Tell br_nf_local_out this is a
-+                               * bridged frame
-+                               */
-+                              nf_bridge->mask |= BRNF_BRIDGED_DNAT;
-+                              skb->dev = nf_bridge->physindev;
-+                              if (skb->protocol ==
-+                                  __constant_htons(ETH_P_8021Q)) {
-+                                      skb_push(skb, VLAN_HLEN);
-+                                      skb->nh.raw -= VLAN_HLEN;
-+                              }
-+                              NF_HOOK_THRESH(PF_BRIDGE, NF_BR_PRE_ROUTING,
-+                                             skb, skb->dev, NULL,
-+                                             br_nf_pre_routing_finish_bridge,
-+                                             1);
-+                              return 0;
-+                      }
-+                      memcpy(skb->mac.ethernet->h_dest, dev->dev_addr,
-+                             ETH_ALEN);
-+                      skb->pkt_type = PACKET_HOST;
-+              }
-+      } else {
-+              skb->dst = (struct dst_entry *)&__fake_rtable;
-+              dst_hold(skb->dst);
-+      }
-+
-+      skb->dev = nf_bridge->physindev;
-+      if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+              skb_push(skb, VLAN_HLEN);
-+              skb->nh.raw -= VLAN_HLEN;
-+      }
-+      NF_HOOK_THRESH(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL,
-+                     br_handle_frame_finish, 1);
-+
-+      return 0;
-+}
-+
-+/* Replicate the checks that IPv4 does on packet reception.
-+ * Set skb->dev to the bridge device (i.e. parent of the
-+ * receiving device) to make netfilter happy, the REDIRECT
-+ * target in particular.  Save the original destination IP
-+ * address to be able to detect DNAT afterwards.
-+ */
-+static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      struct iphdr *iph;
-+      __u32 len;
-+      struct sk_buff *skb = *pskb;
-+      struct nf_bridge_info *nf_bridge;
-+
-+#ifdef CONFIG_SYSCTL
-+      if (!brnf_call_iptables)
-+              return NF_ACCEPT;
-+#endif
-+
-+      if (skb->protocol != __constant_htons(ETH_P_IP)) {
-+              struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)
-+                                        ((*pskb)->mac.ethernet);
-+
-+              if (!IS_VLAN_IP)
-+                      return NF_ACCEPT;
-+              if ((skb = skb_share_check(*pskb, GFP_ATOMIC)) == NULL)
-+                      goto out;
-+              skb_pull(*pskb, VLAN_HLEN);
-+              (*pskb)->nh.raw += VLAN_HLEN;
-+      } else if ((skb = skb_share_check(*pskb, GFP_ATOMIC)) == NULL)
-+              goto out;
-+
-+      if (!pskb_may_pull(skb, sizeof(struct iphdr)))
-+              goto inhdr_error;
-+
-+      iph = skb->nh.iph;
-+      if (iph->ihl < 5 || iph->version != 4)
-+              goto inhdr_error;
-+
-+      if (!pskb_may_pull(skb, 4*iph->ihl))
-+              goto inhdr_error;
-+
-+      iph = skb->nh.iph;
-+      if (ip_fast_csum((__u8 *)iph, iph->ihl) != 0)
-+              goto inhdr_error;
-+
-+      len = ntohs(iph->tot_len);
-+      if (skb->len < len || len < 4*iph->ihl)
-+              goto inhdr_error;
-+
-+      if (skb->len > len) {
-+              __pskb_trim(skb, len);
-+              if (skb->ip_summed == CHECKSUM_HW)
-+                      skb->ip_summed = CHECKSUM_NONE;
-+      }
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug ^= (1 << NF_IP_PRE_ROUTING);
-+#endif
-+      if ((nf_bridge = nf_bridge_alloc(skb)) == NULL)
-+              return NF_DROP;
-+
-+      if (skb->pkt_type == PACKET_OTHERHOST) {
-+              skb->pkt_type = PACKET_HOST;
-+              nf_bridge->mask |= BRNF_PKT_TYPE;
-+      }
-+
-+      nf_bridge->mask |= BRNF_NF_BRIDGE_PREROUTING;
-+      nf_bridge->physindev = skb->dev;
-+      skb->dev = bridge_parent(skb->dev);
-+      store_orig_dstaddr(skb);
-+
-+      NF_HOOK(PF_INET, NF_IP_PRE_ROUTING, skb, skb->dev, NULL,
-+              br_nf_pre_routing_finish);
-+
-+      return NF_STOLEN;
-+
-+inhdr_error:
-+//    IP_INC_STATS_BH(IpInHdrErrors);
-+out:
-+      return NF_DROP;
-+}
-+
-+
-+/* PF_BRIDGE/LOCAL_IN ************************************************/
-+/* The packet is locally destined, which requires a real
-+ * dst_entry, so detach the fake one.  On the way up, the
-+ * packet would pass through PRE_ROUTING again (which already
-+ * took place when the packet entered the bridge), but we
-+ * register an IPv4 PRE_ROUTING 'sabotage' hook that will
-+ * prevent this from happening.
-+ */
-+static unsigned int br_nf_local_in(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      struct sk_buff *skb = *pskb;
-+
-+      if (skb->dst == (struct dst_entry *)&__fake_rtable) {
-+              dst_release(skb->dst);
-+              skb->dst = NULL;
-+      }
-+
-+      return NF_ACCEPT;
-+}
-+
-+/* PF_BRIDGE/FORWARD *************************************************/
-+static int br_nf_forward_finish(struct sk_buff *skb)
-+{
-+      struct nf_bridge_info *nf_bridge = skb->nf_bridge;
-+      struct net_device *in;
-+      struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet);
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug ^= (1 << NF_BR_FORWARD);
-+#endif
-+
-+      if (skb->protocol == __constant_htons(ETH_P_IP) || IS_VLAN_IP) {
-+              in = nf_bridge->physindev;
-+              if (nf_bridge->mask & BRNF_PKT_TYPE) {
-+                      skb->pkt_type = PACKET_OTHERHOST;
-+                      nf_bridge->mask ^= BRNF_PKT_TYPE;
-+              }
-+      } else {
-+              in = *((struct net_device **)(skb->cb));
-+      }
-+      if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+              skb_push(skb, VLAN_HLEN);
-+              skb->nh.raw -= VLAN_HLEN;
-+      }
-+      NF_HOOK_THRESH(PF_BRIDGE, NF_BR_FORWARD, skb, in,
-+                      skb->dev, br_forward_finish, 1);
-+      return 0;
-+}
-+
-+/* This is the 'purely bridged' case.  For IP, we pass the packet to
-+ * netfilter with indev and outdev set to the bridge device,
-+ * but we are still able to filter on the 'real' indev/outdev
-+ * because of the ipt_physdev.c module. For ARP, indev and outdev are the
-+ * bridge ports.
-+ */
-+static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      struct sk_buff *skb = *pskb;
-+      struct nf_bridge_info *nf_bridge;
-+      struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet);
-+
-+#ifdef CONFIG_SYSCTL
-+      if (!skb->nf_bridge)
-+              return NF_ACCEPT;
-+#endif
-+
-+      if (skb->protocol != __constant_htons(ETH_P_IP)) {
-+              if (!IS_VLAN_IP)
-+                      return NF_ACCEPT;
-+              skb_pull(*pskb, VLAN_HLEN);
-+              (*pskb)->nh.raw += VLAN_HLEN;
-+      }
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug ^= (1 << NF_BR_FORWARD);
-+#endif
-+      nf_bridge = skb->nf_bridge;
-+      if (skb->pkt_type == PACKET_OTHERHOST) {
-+              skb->pkt_type = PACKET_HOST;
-+              nf_bridge->mask |= BRNF_PKT_TYPE;
-+      }
-+
-+      /* The physdev module checks on this */
-+      nf_bridge->mask |= BRNF_BRIDGED;
-+      nf_bridge->physoutdev = skb->dev;
-+
-+      NF_HOOK(PF_INET, NF_IP_FORWARD, skb, bridge_parent(in),
-+              bridge_parent(out), br_nf_forward_finish);
-+
-+      return NF_STOLEN;
-+}
-+
-+/*
-+static unsigned int br_nf_forward_arp(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      struct sk_buff *skb = *pskb;
-+      struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet);
-+      struct net_device **d = (struct net_device **)(skb->cb);
-+
-+      if (!brnf_call_arptables)
-+              return NF_ACCEPT;
-+
-+      if (skb->protocol != __constant_htons(ETH_P_ARP)) {
-+              if (!IS_VLAN_ARP)
-+                      return NF_ACCEPT;
-+              skb_pull(*pskb, VLAN_HLEN);
-+              (*pskb)->nh.raw += VLAN_HLEN;
-+      }
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug ^= (1 << NF_BR_FORWARD);
-+#endif
-+
-+      if (skb->nh.arph->ar_pln != 4) {
-+              if (IS_VLAN_ARP) {
-+                      skb_push(*pskb, VLAN_HLEN);
-+                      (*pskb)->nh.raw -= VLAN_HLEN;
-+              }
-+              return NF_ACCEPT;
-+      }
-+      *d = (struct net_device *)in;
-+      NF_HOOK(NF_ARP, NF_ARP_FORWARD, skb, (struct net_device *)in,
-+              (struct net_device *)out, br_nf_forward_finish);
-+
-+      return NF_STOLEN;
-+}
-+*/
-+
-+/* PF_BRIDGE/LOCAL_OUT ***********************************************/
-+static int br_nf_local_out_finish(struct sk_buff *skb)
-+{
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug &= ~(1 << NF_BR_LOCAL_OUT);
-+#endif
-+      if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+              skb_push(skb, VLAN_HLEN);
-+              skb->nh.raw -= VLAN_HLEN;
-+      }
-+
-+      NF_HOOK_THRESH(PF_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev,
-+                      br_forward_finish, NF_BR_PRI_FIRST + 1);
-+
-+      return 0;
-+}
-+
-+
-+/* This function sees both locally originated IP packets and forwarded
-+ * IP packets (in both cases the destination device is a bridge
-+ * device). It also sees bridged-and-DNAT'ed packets.
-+ * To be able to filter on the physical bridge devices (with the ipt_physdev.c
-+ * module), we steal packets destined to a bridge device away from the
-+ * PF_INET/FORWARD and PF_INET/OUTPUT hook functions, and give them back later,
-+ * when we have determined the real output device. This is done in here.
-+ *
-+ * If (nf_bridge->mask & BRNF_BRIDGED_DNAT) then the packet is bridged
-+ * and we fake the PF_BRIDGE/FORWARD hook. The function br_nf_forward()
-+ * will then fake the PF_INET/FORWARD hook. br_nf_local_out() has priority
-+ * NF_BR_PRI_FIRST, so no relevant PF_BRIDGE/INPUT functions have been nor
-+ * will be executed.
-+ * Otherwise, if nf_bridge->physindev is NULL, the bridge-nf code never touched
-+ * this packet before, and so the packet was locally originated. We fake
-+ * the PF_INET/LOCAL_OUT hook.
-+ * Finally, if nf_bridge->physindev isn't NULL, then the packet was IP routed,
-+ * so we fake the PF_INET/FORWARD hook. ipv4_sabotage_out() makes sure
-+ * even routed packets that didn't arrive on a bridge interface have their
-+ * nf_bridge->physindev set.
-+ */
-+
-+static unsigned int br_nf_local_out(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*_okfn)(struct sk_buff *))
-+{
-+      int (*okfn)(struct sk_buff *skb);
-+      struct net_device *realindev;
-+      struct sk_buff *skb = *pskb;
-+      struct nf_bridge_info *nf_bridge;
-+      struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet);
-+
-+#ifdef CONFIG_SYSCTL
-+      if (!skb->nf_bridge)
-+              return NF_ACCEPT;
-+#endif
-+
-+      if (skb->protocol != __constant_htons(ETH_P_IP) && !IS_VLAN_IP)
-+              return NF_ACCEPT;
-+
-+      /* Sometimes we get packets with NULL ->dst here (for example,
-+       * running a dhcp client daemon triggers this).
-+       */
-+      if (skb->dst == NULL)
-+              return NF_ACCEPT;
-+
-+      nf_bridge = skb->nf_bridge;
-+      nf_bridge->physoutdev = skb->dev;
-+      realindev = nf_bridge->physindev;
-+
-+      /* Bridged, take PF_BRIDGE/FORWARD.
-+       * (see big note in front of br_nf_pre_routing_finish)
-+       */
-+      if (nf_bridge->mask & BRNF_BRIDGED_DNAT) {
-+              okfn = br_forward_finish;
-+
-+              if (nf_bridge->mask & BRNF_PKT_TYPE) {
-+                      skb->pkt_type = PACKET_OTHERHOST;
-+                      nf_bridge->mask ^= BRNF_PKT_TYPE;
-+              }
-+              if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+                      skb_push(skb, VLAN_HLEN);
-+                      skb->nh.raw -= VLAN_HLEN;
-+              }
-+
-+              NF_HOOK(PF_BRIDGE, NF_BR_FORWARD, skb, realindev,
-+                      skb->dev, okfn);
-+      } else {
-+              struct net_device *realoutdev = bridge_parent(skb->dev);
-+
-+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
-+              /* iptables should match -o br0.x */
-+              if (nf_bridge->netoutdev)
-+                      realoutdev = nf_bridge->netoutdev;
-+#endif
-+              okfn = br_nf_local_out_finish;
-+              if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+                      skb_pull(skb, VLAN_HLEN);
-+                      (*pskb)->nh.raw += VLAN_HLEN;
-+              }
-+              /* IP forwarded traffic has a physindev, locally
-+               * generated traffic hasn't.
-+               */
-+              if (realindev != NULL) {
-+                      if (((nf_bridge->mask & BRNF_DONT_TAKE_PARENT) == 0) &&
-+                          has_bridge_parent(realindev))
-+                              realindev = bridge_parent(realindev);
-+                      NF_HOOK_THRESH(PF_INET, NF_IP_FORWARD, skb, realindev,
-+                                     realoutdev, okfn,
-+                                     NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD + 1);
-+              } else {
-+#ifdef CONFIG_NETFILTER_DEBUG
-+                      skb->nf_debug ^= (1 << NF_IP_LOCAL_OUT);
-+#endif
-+
-+                      NF_HOOK_THRESH(PF_INET, NF_IP_LOCAL_OUT, skb, realindev,
-+                                     realoutdev, okfn,
-+                                     NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT + 1);
-+              }
-+      }
-+
-+      return NF_STOLEN;
-+}
-+
-+
-+/* PF_BRIDGE/POST_ROUTING ********************************************/
-+static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      struct sk_buff *skb = *pskb;
-+      struct nf_bridge_info *nf_bridge = (*pskb)->nf_bridge;
-+      struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet);
-+      struct net_device *realoutdev = bridge_parent(skb->dev);
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      /* Be very paranoid. This probably won't happen anymore, but let's
-+       * keep the check just to be sure... */
-+      if (skb->mac.raw < skb->head || skb->mac.raw + ETH_HLEN > skb->data) {
-+              printk(KERN_CRIT "br_netfilter: Argh!! br_nf_post_routing: "
-+                               "bad mac.raw pointer.");
-+              goto print_error;
-+      }
-+#endif
-+
-+#ifdef CONFIG_SYSCTL
-+      if (!nf_bridge)
-+              return NF_ACCEPT;
-+#endif
-+
-+      if (skb->protocol != __constant_htons(ETH_P_IP) && !IS_VLAN_IP)
-+              return NF_ACCEPT;
-+
-+      /* Sometimes we get packets with NULL ->dst here (for example,
-+       * running a dhcp client daemon triggers this).
-+       */
-+      if (skb->dst == NULL)
-+              return NF_ACCEPT;
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      /* Sometimes we get packets with NULL ->dst here (for example,
-+       * running a dhcp client daemon triggers this). This should now
-+       * be fixed, but let's keep the check around.
-+       */
-+      if (skb->dst == NULL) {
-+              printk(KERN_CRIT "br_netfilter: skb->dst == NULL.");
-+              goto print_error;
-+      }
-+
-+      skb->nf_debug ^= (1 << NF_IP_POST_ROUTING);
-+#endif
-+
-+      /* We assume any code from br_dev_queue_push_xmit onwards doesn't care
-+       * about the value of skb->pkt_type.
-+       */
-+      if (skb->pkt_type == PACKET_OTHERHOST) {
-+              skb->pkt_type = PACKET_HOST;
-+              nf_bridge->mask |= BRNF_PKT_TYPE;
-+      }
-+
-+      if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+              skb_pull(skb, VLAN_HLEN);
-+              skb->nh.raw += VLAN_HLEN;
-+      }
-+
-+      nf_bridge_save_header(skb);
-+
-+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
-+      if (nf_bridge->netoutdev)
-+              realoutdev = nf_bridge->netoutdev;
-+#endif
-+      NF_HOOK(PF_INET, NF_IP_POST_ROUTING, skb, NULL,
-+              realoutdev, br_dev_queue_push_xmit);
-+
-+      return NF_STOLEN;
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+print_error:
-+      if (skb->dev != NULL) {
-+              printk("[%s]", skb->dev->name);
-+              if (has_bridge_parent(skb->dev))
-+                      printk("[%s]", bridge_parent(skb->dev)->name);
-+      }
-+      printk(" head:%p, raw:%p, data:%p\n", skb->head, skb->mac.raw,
-+                                            skb->data);
-+      return NF_ACCEPT;
-+#endif
-+}
-+
-+
-+/* IPv4/SABOTAGE *****************************************************/
-+
-+/* Don't hand locally destined packets to PF_INET/PRE_ROUTING
-+ * for the second time.
-+ */
-+static unsigned int ipv4_sabotage_in(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      if ((*pskb)->nf_bridge &&
-+          !((*pskb)->nf_bridge->mask & BRNF_NF_BRIDGE_PREROUTING)) {
-+              okfn(*pskb);
-+              return NF_STOLEN;
-+      }
-+
-+      return NF_ACCEPT;
-+}
-+
-+/* Postpone execution of PF_INET/FORWARD, PF_INET/LOCAL_OUT
-+ * and PF_INET/POST_ROUTING until we have done the forwarding
-+ * decision in the bridge code and have determined skb->physoutdev.
-+ */
-+static unsigned int ipv4_sabotage_out(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      struct sk_buff *skb = *pskb;
-+
-+#ifdef CONFIG_SYSCTL
-+      if (!brnf_call_iptables && !skb->nf_bridge)
-+              return NF_ACCEPT;
-+#endif
-+
-+      if ((out->hard_start_xmit == br_dev_xmit &&
-+          okfn != br_nf_forward_finish &&
-+          okfn != br_nf_local_out_finish &&
-+          okfn != br_dev_queue_push_xmit)
-+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
-+          || ((out->priv_flags & IFF_802_1Q_VLAN) &&
-+          VLAN_DEV_INFO(out)->real_dev->hard_start_xmit == br_dev_xmit)
-+#endif
-+          ) {
-+              struct nf_bridge_info *nf_bridge;
-+
-+              if (!skb->nf_bridge && !nf_bridge_alloc(skb))
-+                      return NF_DROP;
-+
-+              nf_bridge = skb->nf_bridge;
-+
-+              /* This frame will arrive on PF_BRIDGE/LOCAL_OUT and we
-+               * will need the indev then. For a brouter, the real indev
-+               * can be a bridge port, so we make sure br_nf_local_out()
-+               * doesn't use the bridge parent of the indev by using
-+               * the BRNF_DONT_TAKE_PARENT mask.
-+               */
-+              if (hook == NF_IP_FORWARD && nf_bridge->physindev == NULL) {
-+                      nf_bridge->mask &= BRNF_DONT_TAKE_PARENT;
-+                      nf_bridge->physindev = (struct net_device *)in;
-+              }
-+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
-+              /* the iptables outdev is br0.x, not br0 */
-+              if (out->priv_flags & IFF_802_1Q_VLAN)
-+                      nf_bridge->netoutdev = (struct net_device *)out;
-+#endif
-+              okfn(skb);
-+              return NF_STOLEN;
-+      }
-+
-+      return NF_ACCEPT;
-+}
-+
-+/* For br_nf_local_out we need (prio = NF_BR_PRI_FIRST), to insure that innocent
-+ * PF_BRIDGE/NF_BR_LOCAL_OUT functions don't get bridged traffic as input.
-+ * For br_nf_post_routing, we need (prio = NF_BR_PRI_LAST), because
-+ * ip_refrag() can return NF_STOLEN.
-+ */
-+static struct nf_hook_ops br_nf_ops[] = {
-+      { .hook = br_nf_pre_routing, 
-+        .pf = PF_BRIDGE, 
-+        .hooknum = NF_BR_PRE_ROUTING, 
-+        .priority = NF_BR_PRI_BRNF, },
-+      { .hook = br_nf_local_in,
-+        .pf = PF_BRIDGE,
-+        .hooknum = NF_BR_LOCAL_IN,
-+        .priority = NF_BR_PRI_BRNF, },
-+      { .hook = br_nf_forward_ip,
-+        .pf = PF_BRIDGE,
-+        .hooknum = NF_BR_FORWARD,
-+        .priority = NF_BR_PRI_BRNF /*- 1*/, },
-+/*    { .hook = br_nf_forward_arp,
-+        .pf = PF_BRIDGE,
-+        .hooknum = NF_BR_FORWARD,
-+        .priority = NF_BR_PRI_BRNF, },*/
-+      { .hook = br_nf_local_out,
-+        .pf = PF_BRIDGE,
-+        .hooknum = NF_BR_LOCAL_OUT,
-+        .priority = NF_BR_PRI_FIRST, },
-+      { .hook = br_nf_post_routing,
-+        .pf = PF_BRIDGE,
-+        .hooknum = NF_BR_POST_ROUTING,
-+        .priority = NF_BR_PRI_LAST, },
-+      { .hook = ipv4_sabotage_in,
-+        .pf = PF_INET,
-+        .hooknum = NF_IP_PRE_ROUTING,
-+        .priority = NF_IP_PRI_FIRST, },
-+      { .hook = ipv4_sabotage_out,
-+        .pf = PF_INET,
-+        .hooknum = NF_IP_FORWARD,
-+        .priority = NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD, },
-+      { .hook = ipv4_sabotage_out,
-+        .pf = PF_INET,
-+        .hooknum = NF_IP_LOCAL_OUT,
-+        .priority = NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT, },
-+      { .hook = ipv4_sabotage_out,
-+        .pf = PF_INET,
-+        .hooknum = NF_IP_POST_ROUTING,
-+        .priority = NF_IP_PRI_FIRST, },
-+};
-+
-+#ifdef CONFIG_SYSCTL
-+static
-+int brnf_sysctl_call_tables(ctl_table *ctl, int write, struct file * filp,
-+                      void *buffer, size_t *lenp)
-+{
-+      int ret;
-+
-+      ret = proc_dointvec(ctl, write, filp, buffer, lenp);
-+
-+      if (write && *(int *)(ctl->data))
-+              *(int *)(ctl->data) = 1;
-+      return ret;
-+}
-+
-+static ctl_table brnf_table[] = {
-+      {
-+              .ctl_name       = NET_BRIDGE_NF_CALL_ARPTABLES,
-+              .procname       = "bridge-nf-call-arptables",
-+              .data           = &brnf_call_arptables,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0644,
-+              .proc_handler   = &brnf_sysctl_call_tables,
-+      },
-+      {
-+              .ctl_name       = NET_BRIDGE_NF_CALL_IPTABLES,
-+              .procname       = "bridge-nf-call-iptables",
-+              .data           = &brnf_call_iptables,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0644,
-+              .proc_handler   = &brnf_sysctl_call_tables,
-+      },
-+      {
-+              .ctl_name       = NET_BRIDGE_NF_FILTER_VLAN_TAGGED,
-+              .procname       = "bridge-nf-filter-vlan-tagged",
-+              .data           = &brnf_filter_vlan_tagged,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0644,
-+              .proc_handler   = &brnf_sysctl_call_tables,
-+      },
-+      { .ctl_name = 0 }
-+};
-+
-+static ctl_table brnf_bridge_table[] = {
-+      {
-+              .ctl_name       = NET_BRIDGE,
-+              .procname       = "bridge",
-+              .mode           = 0555,
-+              .child          = brnf_table,
-+      },
-+      { .ctl_name = 0 }
-+};
-+
-+static ctl_table brnf_net_table[] = {
-+      {
-+              .ctl_name       = CTL_NET,
-+              .procname       = "net",
-+              .mode           = 0555,
-+              .child          = brnf_bridge_table,
-+      },
-+      { .ctl_name = 0 }
-+};
-+#endif
-+
-+int br_netfilter_init(void)
-+{
-+      int i;
-+
-+      for (i = 0; i < ARRAY_SIZE(br_nf_ops); i++) {
-+              int ret;
-+
-+              if ((ret = nf_register_hook(&br_nf_ops[i])) >= 0)
-+                      continue;
-+
-+              while (i--)
-+                      nf_unregister_hook(&br_nf_ops[i]);
-+
-+              return ret;
-+      }
-+
-+#ifdef CONFIG_SYSCTL
-+      brnf_sysctl_header = register_sysctl_table(brnf_net_table, 0);
-+      if (brnf_sysctl_header == NULL) {
-+              printk(KERN_WARNING "br_netfilter: can't register to sysctl.\n");
-+              for (i = 0; i < ARRAY_SIZE(br_nf_ops); i++)
-+                      nf_unregister_hook(&br_nf_ops[i]);
-+              return -EFAULT;
-+      }
-+#endif
-+
-+      printk(KERN_NOTICE "Bridge firewalling registered\n");
-+
-+      return 0;
-+}
-+
-+void br_netfilter_fini(void)
-+{
-+      int i;
-+
-+      for (i = ARRAY_SIZE(br_nf_ops) - 1; i >= 0; i--)
-+              nf_unregister_hook(&br_nf_ops[i]);
-+#ifdef CONFIG_SYSCTL
-+      unregister_sysctl_table(brnf_sysctl_header);
-+#endif
-+
-+}
-diff -Nurb src/linux/linux.stock/net/bridge/br_private.h src/linux/linux/net/bridge/br_private.h
---- src/linux/linux.stock/net/bridge/br_private.h      2003-10-14 04:09:32.000000000 -0400
-+++ src/linux/linux/net/bridge/br_private.h    2004-07-10 23:46:39.000000000 -0400
-@@ -145,8 +145,10 @@
- /* br_forward.c */
- extern void br_deliver(struct net_bridge_port *to,
-               struct sk_buff *skb);
-+extern int br_dev_queue_push_xmit(struct sk_buff *skb);
- extern void br_forward(struct net_bridge_port *to,
-               struct sk_buff *skb);
-+extern int br_forward_finish(struct sk_buff *skb);
- extern void br_flood_deliver(struct net_bridge *br,
-                     struct sk_buff *skb,
-                     int clone);
-@@ -167,7 +169,8 @@
-                          int *ifindices);
- /* br_input.c */
--extern void br_handle_frame(struct sk_buff *skb);
-+extern int br_handle_frame_finish(struct sk_buff *skb);
-+extern int br_handle_frame(struct sk_buff *skb);
- /* br_ioctl.c */
- extern void br_call_ioctl_atomic(void (*fn)(void));
-@@ -178,6 +181,10 @@
-            unsigned long arg2);
- extern int br_ioctl_deviceless_stub(unsigned long arg);
-+/* br_netfilter.c */
-+extern int br_netfilter_init(void);
-+extern void br_netfilter_fini(void);
-+
- /* br_stp.c */
- extern int br_is_root_bridge(struct net_bridge *br);
- extern struct net_bridge_port *br_get_port(struct net_bridge *br,
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/Config.in src/linux/linux/net/bridge/netfilter/Config.in
---- src/linux/linux.stock/net/bridge/netfilter/Config.in       1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/Config.in     2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,22 @@
-+#
-+# Bridge netfilter configuration
-+#
-+dep_tristate '  Bridge: ebtables' CONFIG_BRIDGE_NF_EBTABLES $CONFIG_BRIDGE
-+dep_tristate '    ebt: filter table support' CONFIG_BRIDGE_EBT_T_FILTER $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: nat table support' CONFIG_BRIDGE_EBT_T_NAT $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: broute table support' CONFIG_BRIDGE_EBT_BROUTE $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: log support' CONFIG_BRIDGE_EBT_LOG $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: IP filter support' CONFIG_BRIDGE_EBT_IPF $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: ARP filter support' CONFIG_BRIDGE_EBT_ARPF $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: among filter support' CONFIG_BRIDGE_EBT_AMONG $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: limit filter support' CONFIG_BRIDGE_EBT_LIMIT $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: 802.1Q VLAN filter support' CONFIG_BRIDGE_EBT_VLANF $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: 802.3 filter support' CONFIG_BRIDGE_EBT_802_3 $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: packet type filter support' CONFIG_BRIDGE_EBT_PKTTYPE $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: STP filter support' CONFIG_BRIDGE_EBT_STP $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: mark filter support' CONFIG_BRIDGE_EBT_MARKF $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: arp reply target support' CONFIG_BRIDGE_EBT_ARPREPLY $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: snat target support' CONFIG_BRIDGE_EBT_SNAT $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: dnat target support' CONFIG_BRIDGE_EBT_DNAT $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: redirect target support' CONFIG_BRIDGE_EBT_REDIRECT $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: mark target support' CONFIG_BRIDGE_EBT_MARK_T $CONFIG_BRIDGE_NF_EBTABLES
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/Makefile src/linux/linux/net/bridge/netfilter/Makefile
---- src/linux/linux.stock/net/bridge/netfilter/Makefile        1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/Makefile      2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,33 @@
-+#
-+# Makefile for the netfilter modules on top of bridging.
-+#
-+# Note! Dependencies are done automagically by 'make dep', which also
-+# removes any old dependencies. DON'T put your own dependencies here
-+# unless it's something special (ie not a .c file).
-+#
-+# Note 2! The CFLAGS definition is now in the main makefile...
-+
-+O_TARGET      := netfilter.o
-+
-+export-objs := ebtables.o
-+
-+obj-$(CONFIG_BRIDGE_NF_EBTABLES) += ebtables.o
-+obj-$(CONFIG_BRIDGE_EBT_T_FILTER) += ebtable_filter.o
-+obj-$(CONFIG_BRIDGE_EBT_T_NAT) += ebtable_nat.o
-+obj-$(CONFIG_BRIDGE_EBT_BROUTE) += ebtable_broute.o
-+obj-$(CONFIG_BRIDGE_EBT_802_3) += ebt_802_3.o
-+obj-$(CONFIG_BRIDGE_EBT_ARPF) += ebt_arp.o
-+obj-$(CONFIG_BRIDGE_EBT_AMONG) += ebt_among.o
-+obj-$(CONFIG_BRIDGE_EBT_IPF) += ebt_ip.o
-+obj-$(CONFIG_BRIDGE_EBT_LIMIT) += ebt_limit.o
-+obj-$(CONFIG_BRIDGE_EBT_MARKF) += ebt_mark_m.o
-+obj-$(CONFIG_BRIDGE_EBT_PKTTYPE) += ebt_pkttype.o
-+obj-$(CONFIG_BRIDGE_EBT_STP) += ebt_stp.o
-+obj-$(CONFIG_BRIDGE_EBT_VLANF) += ebt_vlan.o
-+obj-$(CONFIG_BRIDGE_EBT_LOG) += ebt_log.o
-+obj-$(CONFIG_BRIDGE_EBT_ARPREPLY) += ebt_arpreply.o
-+obj-$(CONFIG_BRIDGE_EBT_DNAT) += ebt_dnat.o
-+obj-$(CONFIG_BRIDGE_EBT_MARK_T) += ebt_mark.o
-+obj-$(CONFIG_BRIDGE_EBT_REDIRECT) += ebt_redirect.o
-+obj-$(CONFIG_BRIDGE_EBT_SNAT) += ebt_snat.o
-+include $(TOPDIR)/Rules.make
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebt_802_3.c src/linux/linux/net/bridge/netfilter/ebt_802_3.c
---- src/linux/linux.stock/net/bridge/netfilter/ebt_802_3.c     1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebt_802_3.c   2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,74 @@
-+/*
-+ * 802_3
-+ *
-+ * Author:
-+ * Chris Vitale csv@bluetail.com
-+ *
-+ * May 2003
-+ * 
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_802_3.h>
-+#include <linux/module.h>
-+
-+static int ebt_filter_802_3(const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out, const void *data, unsigned int datalen)
-+{
-+      struct ebt_802_3_info *info = (struct ebt_802_3_info *)data;
-+      struct ebt_802_3_hdr *hdr = (struct ebt_802_3_hdr *)skb->mac.ethernet;
-+      uint16_t type = hdr->llc.ui.ctrl & IS_UI ? hdr->llc.ui.type : hdr->llc.ni.type;
-+
-+      if (info->bitmask & EBT_802_3_SAP) {
-+              if (FWINV(info->sap != hdr->llc.ui.ssap, EBT_802_3_SAP)) 
-+                              return EBT_NOMATCH;
-+              if (FWINV(info->sap != hdr->llc.ui.dsap, EBT_802_3_SAP))
-+                              return EBT_NOMATCH;
-+      }
-+
-+      if (info->bitmask & EBT_802_3_TYPE) {
-+              if (!(hdr->llc.ui.dsap == CHECK_TYPE && hdr->llc.ui.ssap == CHECK_TYPE))
-+                      return EBT_NOMATCH;
-+              if (FWINV(info->type != type, EBT_802_3_TYPE)) 
-+                      return EBT_NOMATCH;
-+      }
-+
-+      return EBT_MATCH;
-+}
-+
-+static struct ebt_match filter_802_3;
-+static int ebt_802_3_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_802_3_info *info = (struct ebt_802_3_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_802_3_info)))
-+              return -EINVAL;
-+      if (info->bitmask & ~EBT_802_3_MASK || info->invflags & ~EBT_802_3_MASK)
-+              return -EINVAL;
-+
-+      return 0;
-+}
-+
-+static struct ebt_match filter_802_3 =
-+{
-+      .name           = EBT_802_3_MATCH,
-+      .match          = ebt_filter_802_3,
-+      .check          = ebt_802_3_check,
-+      .me             = THIS_MODULE,
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_802_3);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_802_3);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebt_among.c src/linux/linux/net/bridge/netfilter/ebt_among.c
---- src/linux/linux.stock/net/bridge/netfilter/ebt_among.c     1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebt_among.c   2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,223 @@
-+/*
-+ *  ebt_among
-+ *
-+ *    Authors:
-+ *    Grzegorz Borowiak <grzes@gnu.univ.gda.pl>
-+ *
-+ *  August, 2003
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_among.h>
-+#include <linux/ip.h>
-+#include <linux/if_arp.h>
-+#include <linux/module.h>
-+
-+static int ebt_mac_wormhash_contains(const struct ebt_mac_wormhash *wh,
-+                                   const char *mac, uint32_t ip)
-+{
-+      /* You may be puzzled as to how this code works.
-+       * Some tricks were used, refer to 
-+       *      include/linux/netfilter_bridge/ebt_among.h
-+       * as there you can find a solution of this mystery.
-+       */
-+      const struct ebt_mac_wormhash_tuple *p;
-+      int start, limit, i;
-+      uint32_t cmp[2] = { 0, 0 };
-+      int key = (const unsigned char) mac[5];
-+
-+      memcpy(((char *) cmp) + 2, mac, 6);
-+      start = wh->table[key];
-+      limit = wh->table[key + 1];
-+      if (ip) {
-+              for (i = start; i < limit; i++) {
-+                      p = &wh->pool[i];
-+                      if (cmp[1] == p->cmp[1] && cmp[0] == p->cmp[0]) {
-+                              if (p->ip == 0 || p->ip == ip) {
-+                                      return 1;
-+                              }
-+                      }
-+              }
-+      } else {
-+              for (i = start; i < limit; i++) {
-+                      p = &wh->pool[i];
-+                      if (cmp[1] == p->cmp[1] && cmp[0] == p->cmp[0]) {
-+                              if (p->ip == 0) {
-+                                      return 1;
-+                              }
-+                      }
-+              }
-+      }
-+      return 0;
-+}
-+
-+static int ebt_mac_wormhash_check_integrity(const struct ebt_mac_wormhash
-+                                          *wh)
-+{
-+      int i;
-+
-+      for (i = 0; i < 256; i++) {
-+              if (wh->table[i] > wh->table[i + 1])
-+                      return -0x100 - i;
-+              if (wh->table[i] < 0)
-+                      return -0x200 - i;
-+              if (wh->table[i] > wh->poolsize)
-+                      return -0x300 - i;
-+      }
-+      if (wh->table[256] > wh->poolsize)
-+              return -0xc00;
-+      return 0;
-+}
-+
-+static int get_ip_dst(const struct sk_buff *skb, uint32_t * addr)
-+{
-+      if (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_IP))
-+              *addr = skb->nh.iph->daddr;
-+      else if (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_ARP)) {
-+              uint32_t arp_len = sizeof(struct arphdr) +
-+                  (2 * (((*skb).nh.arph)->ar_hln)) +
-+                  (2 * (((*skb).nh.arph)->ar_pln));
-+
-+              /* Make sure the packet is long enough. */
-+              if ((((*skb).nh.raw) + arp_len) > (*skb).tail)
-+                      return -1;
-+              /* IPv4 addresses are always 4 bytes. */
-+              if (((*skb).nh.arph)->ar_pln != sizeof(uint32_t))
-+                      return -1;
-+
-+              memcpy(addr, ((*skb).nh.raw) + sizeof(struct arphdr) +
-+                     (2 * (((*skb).nh.arph)->ar_hln)) +
-+                     (((*skb).nh.arph)->ar_pln), sizeof(uint32_t));
-+
-+      }
-+      return 0;
-+}
-+
-+static int get_ip_src(const struct sk_buff *skb, uint32_t * addr)
-+{
-+      if (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_IP))
-+              *addr = skb->nh.iph->saddr;
-+      else if (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_ARP)) {
-+              uint32_t arp_len = sizeof(struct arphdr) +
-+                  (2 * (((*skb).nh.arph)->ar_hln)) +
-+                  (2 * (((*skb).nh.arph)->ar_pln));
-+
-+              /* Make sure the packet is long enough. */
-+              if ((((*skb).nh.raw) + arp_len) > (*skb).tail)
-+                      return -1;
-+              /* IPv4 addresses are always 4 bytes. */
-+              if (((*skb).nh.arph)->ar_pln != sizeof(uint32_t))
-+                      return -1;
-+
-+              memcpy(addr, ((*skb).nh.raw) + sizeof(struct arphdr) +
-+                     ((((*skb).nh.arph)->ar_hln)), sizeof(uint32_t));
-+
-+      }
-+      return 0;
-+}
-+
-+static int ebt_filter_among(const struct sk_buff *skb,
-+                          const struct net_device *in,
-+                          const struct net_device *out, const void *data,
-+                          unsigned int datalen)
-+{
-+      struct ebt_among_info *info = (struct ebt_among_info *) data;
-+      const char *dmac, *smac;
-+      const struct ebt_mac_wormhash *wh_dst, *wh_src;
-+      uint32_t dip = 0, sip = 0;
-+
-+      wh_dst = ebt_among_wh_dst(info);
-+      wh_src = ebt_among_wh_src(info);
-+
-+      if (wh_src) {
-+              smac = skb->mac.ethernet->h_source;
-+              if (get_ip_src(skb, &sip))
-+                      return EBT_NOMATCH;
-+              if (!(info->bitmask & EBT_AMONG_SRC_NEG)) {
-+                      /* we match only if it contains */
-+                      if (!ebt_mac_wormhash_contains(wh_src, smac, sip))
-+                              return EBT_NOMATCH;
-+              } else {
-+                      /* we match only if it DOES NOT contain */
-+                      if (ebt_mac_wormhash_contains(wh_src, smac, sip))
-+                              return EBT_NOMATCH;
-+              }
-+      }
-+
-+      if (wh_dst) {
-+              dmac = skb->mac.ethernet->h_dest;
-+              if (get_ip_dst(skb, &dip))
-+                      return EBT_NOMATCH;
-+              if (!(info->bitmask & EBT_AMONG_DST_NEG)) {
-+                      /* we match only if it contains */
-+                      if (!ebt_mac_wormhash_contains(wh_dst, dmac, dip))
-+                              return EBT_NOMATCH;
-+              } else {
-+                      /* we match only if it DOES NOT contain */
-+                      if (ebt_mac_wormhash_contains(wh_dst, dmac, dip))
-+                              return EBT_NOMATCH;
-+              }
-+      }
-+
-+      return EBT_MATCH;
-+}
-+
-+static int ebt_among_check(const char *tablename, unsigned int hookmask,
-+                         const struct ebt_entry *e, void *data,
-+                         unsigned int datalen)
-+{
-+      struct ebt_among_info *info = (struct ebt_among_info *) data;
-+      int expected_length = sizeof(struct ebt_among_info);
-+      const struct ebt_mac_wormhash *wh_dst, *wh_src;
-+      int err;
-+
-+      wh_dst = ebt_among_wh_dst(info);
-+      wh_src = ebt_among_wh_src(info);
-+      expected_length += ebt_mac_wormhash_size(wh_dst);
-+      expected_length += ebt_mac_wormhash_size(wh_src);
-+
-+      if (datalen != EBT_ALIGN(expected_length)) {
-+              printk(KERN_WARNING
-+                     "ebtables: among: wrong size: %d"
-+                     "against expected %d, rounded to %d\n",
-+                     datalen, expected_length,
-+                     EBT_ALIGN(expected_length));
-+              return -EINVAL;
-+      }
-+      if (wh_dst && (err = ebt_mac_wormhash_check_integrity(wh_dst))) {
-+              printk(KERN_WARNING
-+                     "ebtables: among: dst integrity fail: %x\n", -err);
-+              return -EINVAL;
-+      }
-+      if (wh_src && (err = ebt_mac_wormhash_check_integrity(wh_src))) {
-+              printk(KERN_WARNING
-+                     "ebtables: among: src integrity fail: %x\n", -err);
-+              return -EINVAL;
-+      }
-+      return 0;
-+}
-+
-+static struct ebt_match filter_among = {
-+      {NULL, NULL}, 
-+      EBT_AMONG_MATCH, 
-+      ebt_filter_among, 
-+      ebt_among_check,
-+      NULL,
-+      THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_among);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_among);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebt_arp.c src/linux/linux/net/bridge/netfilter/ebt_arp.c
---- src/linux/linux.stock/net/bridge/netfilter/ebt_arp.c       1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebt_arp.c     2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,149 @@
-+/*
-+ *  ebt_arp
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *    Tim Gardner <timg@tpi.com>
-+ *
-+ *  April, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_arp.h>
-+#include <linux/if_arp.h>
-+#include <linux/if_ether.h>
-+#include <linux/module.h>
-+
-+static int ebt_filter_arp(const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out, const void *data, unsigned int datalen)
-+{
-+      struct ebt_arp_info *info = (struct ebt_arp_info *)data;
-+
-+      if (info->bitmask & EBT_ARP_OPCODE && FWINV(info->opcode !=
-+         ((*skb).nh.arph)->ar_op, EBT_ARP_OPCODE))
-+              return EBT_NOMATCH;
-+      if (info->bitmask & EBT_ARP_HTYPE && FWINV(info->htype !=
-+         ((*skb).nh.arph)->ar_hrd, EBT_ARP_HTYPE))
-+              return EBT_NOMATCH;
-+      if (info->bitmask & EBT_ARP_PTYPE && FWINV(info->ptype !=
-+         ((*skb).nh.arph)->ar_pro, EBT_ARP_PTYPE))
-+              return EBT_NOMATCH;
-+
-+      if (info->bitmask & (EBT_ARP_SRC_IP | EBT_ARP_DST_IP))
-+      {
-+              uint32_t arp_len = sizeof(struct arphdr) +
-+                 (2 * (((*skb).nh.arph)->ar_hln)) +
-+                 (2 * (((*skb).nh.arph)->ar_pln));
-+              uint32_t dst;
-+              uint32_t src;
-+
-+              // Make sure the packet is long enough.
-+              if ((((*skb).nh.raw) + arp_len) > (*skb).tail)
-+                      return EBT_NOMATCH;
-+              // IPv4 addresses are always 4 bytes.
-+              if (((*skb).nh.arph)->ar_pln != sizeof(uint32_t))
-+                      return EBT_NOMATCH;
-+
-+              if (info->bitmask & EBT_ARP_SRC_IP) {
-+                      memcpy(&src, ((*skb).nh.raw) + sizeof(struct arphdr) +
-+                         ((*skb).nh.arph)->ar_hln, sizeof(uint32_t));
-+                      if (FWINV(info->saddr != (src & info->smsk),
-+                         EBT_ARP_SRC_IP))
-+                              return EBT_NOMATCH;
-+              }
-+
-+              if (info->bitmask & EBT_ARP_DST_IP) {
-+                      memcpy(&dst, ((*skb).nh.raw)+sizeof(struct arphdr) +
-+                         (2*(((*skb).nh.arph)->ar_hln)) +
-+                         (((*skb).nh.arph)->ar_pln), sizeof(uint32_t));
-+                      if (FWINV(info->daddr != (dst & info->dmsk),
-+                         EBT_ARP_DST_IP))
-+                              return EBT_NOMATCH;
-+              }
-+      }
-+
-+      if (info->bitmask & (EBT_ARP_SRC_MAC | EBT_ARP_DST_MAC))
-+      {
-+              uint32_t arp_len = sizeof(struct arphdr) +
-+                 (2 * (((*skb).nh.arph)->ar_hln)) +
-+                 (2 * (((*skb).nh.arph)->ar_pln));
-+              unsigned char dst[ETH_ALEN];
-+              unsigned char src[ETH_ALEN];
-+
-+              // Make sure the packet is long enough.
-+              if ((((*skb).nh.raw) + arp_len) > (*skb).tail)
-+                      return EBT_NOMATCH;
-+              // MAC addresses are 6 bytes.
-+              if (((*skb).nh.arph)->ar_hln != ETH_ALEN)
-+                      return EBT_NOMATCH;
-+              if (info->bitmask & EBT_ARP_SRC_MAC) {
-+                      uint8_t verdict, i;
-+
-+                      memcpy(&src, ((*skb).nh.raw) +
-+                                      sizeof(struct arphdr),
-+                                      ETH_ALEN);
-+                      verdict = 0;
-+                      for (i = 0; i < 6; i++)
-+                              verdict |= (src[i] ^ info->smaddr[i]) &
-+                                     info->smmsk[i];  
-+                      if (FWINV(verdict != 0, EBT_ARP_SRC_MAC))
-+                              return EBT_NOMATCH;
-+              }
-+
-+              if (info->bitmask & EBT_ARP_DST_MAC) { 
-+                      uint8_t verdict, i;
-+
-+                      memcpy(&dst, ((*skb).nh.raw) +
-+                                      sizeof(struct arphdr) +
-+                                      (((*skb).nh.arph)->ar_hln) +
-+                                      (((*skb).nh.arph)->ar_pln),
-+                                      ETH_ALEN);
-+                      verdict = 0;
-+                      for (i = 0; i < 6; i++)
-+                              verdict |= (dst[i] ^ info->dmaddr[i]) &
-+                                      info->dmmsk[i];
-+                      if (FWINV(verdict != 0, EBT_ARP_DST_MAC))
-+                              return EBT_NOMATCH;
-+              }
-+      }
-+
-+      return EBT_MATCH;
-+}
-+
-+static int ebt_arp_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_arp_info *info = (struct ebt_arp_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_arp_info)))
-+              return -EINVAL;
-+      if ((e->ethproto != __constant_htons(ETH_P_ARP) &&
-+         e->ethproto != __constant_htons(ETH_P_RARP)) ||
-+         e->invflags & EBT_IPROTO)
-+              return -EINVAL;
-+      if (info->bitmask & ~EBT_ARP_MASK || info->invflags & ~EBT_ARP_MASK)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_match filter_arp =
-+{
-+      {NULL, NULL}, EBT_ARP_MATCH, ebt_filter_arp, ebt_arp_check, NULL,
-+      THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_arp);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_arp);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebt_arpreply.c src/linux/linux/net/bridge/netfilter/ebt_arpreply.c
---- src/linux/linux.stock/net/bridge/netfilter/ebt_arpreply.c  1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebt_arpreply.c        2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,86 @@
-+/*
-+ *  ebt_arpreply
-+ *
-+ *    Authors:
-+ *    Grzegorz Borowiak <grzes@gnu.univ.gda.pl>
-+ *    Bart De Schuymer <bdschuym@pandora.be>
-+ *
-+ *  August, 2003
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_arpreply.h>
-+#include <linux/if_arp.h>
-+#include <net/arp.h>
-+#include <linux/module.h>
-+
-+static int ebt_target_reply(struct sk_buff **pskb, unsigned int hooknr,
-+   const struct net_device *in, const struct net_device *out,
-+   const void *data, unsigned int datalen)
-+{
-+      struct ebt_arpreply_info *info = (struct ebt_arpreply_info *)data;
-+      struct arphdr *ah;
-+      unsigned char *sha, *arp_ptr;
-+      u32 sip, tip;
-+
-+      ah = (**pskb).nh.arph;
-+      if (ah->ar_op != __constant_htons(ARPOP_REQUEST) ||
-+          ah->ar_hln != ETH_ALEN || ah->ar_pro != htons(ETH_P_IP) ||
-+          ah->ar_pln != 4)
-+              return EBT_CONTINUE;
-+
-+      arp_ptr = (unsigned char *)(ah + 1);
-+
-+      /* get source and target IP */
-+      sha = arp_ptr;
-+      arp_ptr += ETH_ALEN;
-+      memcpy(&sip, arp_ptr, 4);
-+      arp_ptr += 4 + ETH_ALEN;
-+      memcpy(&tip, arp_ptr, 4);
-+
-+      arp_send(ARPOP_REPLY, ETH_P_ARP, sip, in, tip, sha, info->mac, sha);
-+
-+      return info->target;
-+}
-+
-+static int ebt_target_reply_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_arpreply_info *info = (struct ebt_arpreply_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_arpreply_info)))
-+              return -EINVAL;
-+      if (BASE_CHAIN && info->target == EBT_RETURN)
-+              return -EINVAL;
-+      if (e->ethproto != __constant_htons(ETH_P_ARP) ||
-+          e->invflags & EBT_IPROTO)
-+              return -EINVAL;
-+      CLEAR_BASE_CHAIN_BIT;
-+      if (strcmp(tablename, "nat") || hookmask & ~(1 << NF_BR_PRE_ROUTING))
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_target reply_target =
-+{
-+      .name           = EBT_ARPREPLY_TARGET,
-+      .target         = ebt_target_reply,
-+      .check          = ebt_target_reply_check,
-+      .me             = THIS_MODULE,
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_target(&reply_target);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_target(&reply_target);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebt_dnat.c src/linux/linux/net/bridge/netfilter/ebt_dnat.c
---- src/linux/linux.stock/net/bridge/netfilter/ebt_dnat.c      1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebt_dnat.c    2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,65 @@
-+/*
-+ *  ebt_dnat
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  June, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_nat.h>
-+#include <linux/module.h>
-+#include <net/sock.h>
-+
-+static int ebt_target_dnat(struct sk_buff **pskb, unsigned int hooknr,
-+   const struct net_device *in, const struct net_device *out,
-+   const void *data, unsigned int datalen)
-+{
-+      struct ebt_nat_info *info = (struct ebt_nat_info *)data;
-+
-+      memcpy(((**pskb).mac.ethernet)->h_dest, info->mac,
-+         ETH_ALEN * sizeof(unsigned char));
-+      return info->target;
-+}
-+
-+static int ebt_target_dnat_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_nat_info *info = (struct ebt_nat_info *)data;
-+
-+      if (BASE_CHAIN && info->target == EBT_RETURN)
-+              return -EINVAL;
-+      CLEAR_BASE_CHAIN_BIT;
-+      if ( (strcmp(tablename, "nat") ||
-+         (hookmask & ~((1 << NF_BR_PRE_ROUTING) | (1 << NF_BR_LOCAL_OUT)))) &&
-+         (strcmp(tablename, "broute") || hookmask & ~(1 << NF_BR_BROUTING)) )
-+              return -EINVAL;
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_nat_info)))
-+              return -EINVAL;
-+      if (INVALID_TARGET)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_target dnat =
-+{
-+      {NULL, NULL}, EBT_DNAT_TARGET, ebt_target_dnat, ebt_target_dnat_check,
-+      NULL, THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_target(&dnat);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_target(&dnat);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebt_ip.c src/linux/linux/net/bridge/netfilter/ebt_ip.c
---- src/linux/linux.stock/net/bridge/netfilter/ebt_ip.c        1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebt_ip.c      2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,121 @@
-+/*
-+ *  ebt_ip
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ *  Changes:
-+ *    added ip-sport and ip-dport
-+ *    Innominate Security Technologies AG <mhopf@innominate.com>
-+ *    September, 2002
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_ip.h>
-+#include <linux/ip.h>
-+#include <linux/in.h>
-+#include <linux/module.h>
-+
-+struct tcpudphdr {
-+      uint16_t src;
-+      uint16_t dst;
-+};
-+
-+union h_u {
-+      unsigned char *raw;
-+      struct tcpudphdr *tuh;
-+};
-+
-+static int ebt_filter_ip(const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out, const void *data,
-+   unsigned int datalen)
-+{
-+      struct ebt_ip_info *info = (struct ebt_ip_info *)data;
-+
-+      if (info->bitmask & EBT_IP_TOS &&
-+         FWINV(info->tos != ((*skb).nh.iph)->tos, EBT_IP_TOS))
-+              return EBT_NOMATCH;
-+      if (info->bitmask & EBT_IP_PROTO) {
-+              if (FWINV(info->protocol != ((*skb).nh.iph)->protocol,
-+                        EBT_IP_PROTO))
-+                      return EBT_NOMATCH;
-+              if ( info->protocol == IPPROTO_TCP ||
-+                   info->protocol == IPPROTO_UDP )
-+              {
-+                      union h_u h;
-+                      h.raw = skb->data + skb->nh.iph->ihl*4;
-+                      if (info->bitmask & EBT_IP_DPORT) {
-+                              uint16_t port = ntohs(h.tuh->dst);
-+                              if (FWINV(port < info->dport[0] ||
-+                                        port > info->dport[1],
-+                                        EBT_IP_DPORT))
-+                              return EBT_NOMATCH;
-+                      }
-+                      if (info->bitmask & EBT_IP_SPORT) {
-+                              uint16_t port = ntohs(h.tuh->src);
-+                              if (FWINV(port < info->sport[0] ||
-+                                        port > info->sport[1],
-+                                        EBT_IP_SPORT))
-+                              return EBT_NOMATCH;
-+                      }
-+              }
-+      }
-+      if (info->bitmask & EBT_IP_SOURCE &&
-+         FWINV((((*skb).nh.iph)->saddr & info->smsk) !=
-+         info->saddr, EBT_IP_SOURCE))
-+              return EBT_NOMATCH;
-+      if ((info->bitmask & EBT_IP_DEST) &&
-+         FWINV((((*skb).nh.iph)->daddr & info->dmsk) !=
-+         info->daddr, EBT_IP_DEST))
-+              return EBT_NOMATCH;
-+      return EBT_MATCH;
-+}
-+
-+static int ebt_ip_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_ip_info *info = (struct ebt_ip_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_ip_info)))
-+              return -EINVAL;
-+      if (e->ethproto != __constant_htons(ETH_P_IP) ||
-+         e->invflags & EBT_IPROTO)
-+              return -EINVAL;
-+      if (info->bitmask & ~EBT_IP_MASK || info->invflags & ~EBT_IP_MASK)
-+              return -EINVAL;
-+      if (info->bitmask & (EBT_IP_DPORT | EBT_IP_SPORT)) {
-+              if (!info->bitmask & EBT_IPROTO)
-+                      return -EINVAL;
-+              if (info->protocol != IPPROTO_TCP &&
-+                  info->protocol != IPPROTO_UDP)
-+                       return -EINVAL;
-+      }
-+      if (info->bitmask & EBT_IP_DPORT && info->dport[0] > info->dport[1])
-+              return -EINVAL;
-+      if (info->bitmask & EBT_IP_SPORT && info->sport[0] > info->sport[1])
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_match filter_ip =
-+{
-+      {NULL, NULL}, EBT_IP_MATCH, ebt_filter_ip, ebt_ip_check, NULL,
-+      THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_ip);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_ip);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebt_limit.c src/linux/linux/net/bridge/netfilter/ebt_limit.c
---- src/linux/linux.stock/net/bridge/netfilter/ebt_limit.c     1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebt_limit.c   2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,101 @@
-+/*
-+ *  ebt_limit
-+ *
-+ *    Authors:
-+ *    Tom Marshall <tommy@home.tig-grr.com>
-+ *
-+ *    Mostly copied from netfilter's ipt_limit.c, see that file for explanation
-+ *
-+ *  September, 2003
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_limit.h>
-+#include <linux/module.h>
-+
-+#include <linux/netdevice.h>
-+#include <linux/spinlock.h>
-+
-+static spinlock_t limit_lock = SPIN_LOCK_UNLOCKED;
-+
-+#define CREDITS_PER_JIFFY 128
-+
-+static int ebt_limit_match(const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out, const void *data, unsigned int datalen)
-+{
-+      struct ebt_limit_info *info = (struct ebt_limit_info *)data;
-+      unsigned long now = jiffies;
-+
-+      spin_lock_bh(&limit_lock);
-+      info->credit += (now - xchg(&info->prev, now)) * CREDITS_PER_JIFFY;
-+      if (info->credit > info->credit_cap)
-+              info->credit = info->credit_cap;
-+
-+      if (info->credit >= info->cost) {
-+              /* We're not limited. */
-+              info->credit -= info->cost;
-+              spin_unlock_bh(&limit_lock);
-+              return EBT_MATCH;
-+      }
-+
-+      spin_unlock_bh(&limit_lock);
-+      return EBT_NOMATCH;
-+}
-+
-+/* Precision saver. */
-+static u_int32_t
-+user2credits(u_int32_t user)
-+{
-+      /* If multiplying would overflow... */
-+      if (user > 0xFFFFFFFF / (HZ*CREDITS_PER_JIFFY))
-+              /* Divide first. */
-+              return (user / EBT_LIMIT_SCALE) * HZ * CREDITS_PER_JIFFY;
-+
-+      return (user * HZ * CREDITS_PER_JIFFY) / EBT_LIMIT_SCALE;
-+}
-+
-+static int ebt_limit_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_limit_info *info = (struct ebt_limit_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_limit_info)))
-+              return -EINVAL;
-+
-+      /* Check for overflow. */
-+      if (info->burst == 0
-+          || user2credits(info->avg * info->burst) < user2credits(info->avg)) {
-+              printk("Overflow in ebt_limit: %u/%u\n",
-+                      info->avg, info->burst);
-+              return -EINVAL;
-+      }
-+
-+      /* User avg in seconds * EBT_LIMIT_SCALE: convert to jiffies * 128. */
-+      info->prev = jiffies;
-+      info->credit = user2credits(info->avg * info->burst);
-+      info->credit_cap = user2credits(info->avg * info->burst);
-+      info->cost = user2credits(info->avg);
-+      return 0;
-+}
-+
-+static struct ebt_match ebt_limit_reg =
-+{
-+      {NULL, NULL}, EBT_LIMIT_MATCH, ebt_limit_match, ebt_limit_check, NULL,
-+      THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&ebt_limit_reg);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&ebt_limit_reg);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebt_log.c src/linux/linux/net/bridge/netfilter/ebt_log.c
---- src/linux/linux.stock/net/bridge/netfilter/ebt_log.c       1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebt_log.c     2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,152 @@
-+/*
-+ *  ebt_log
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_log.h>
-+#include <linux/module.h>
-+#include <linux/ip.h>
-+#include <linux/in.h>
-+#include <linux/if_arp.h>
-+#include <linux/spinlock.h>
-+
-+static spinlock_t ebt_log_lock = SPIN_LOCK_UNLOCKED;
-+
-+static int ebt_log_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_log_info *info = (struct ebt_log_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_log_info)))
-+              return -EINVAL;
-+      if (info->bitmask & ~EBT_LOG_MASK)
-+              return -EINVAL;
-+      if (info->loglevel >= 8)
-+              return -EINVAL;
-+      info->prefix[EBT_LOG_PREFIX_SIZE - 1] = '\0';
-+      return 0;
-+}
-+
-+struct tcpudphdr
-+{
-+      uint16_t src;
-+      uint16_t dst;
-+};
-+
-+struct arppayload
-+{
-+      unsigned char mac_src[ETH_ALEN];
-+      unsigned char ip_src[4];
-+      unsigned char mac_dst[ETH_ALEN];
-+      unsigned char ip_dst[4];
-+};
-+
-+static void print_MAC(unsigned char *p)
-+{
-+      int i;
-+
-+      for (i = 0; i < ETH_ALEN; i++, p++)
-+              printk("%02x%c", *p, i == ETH_ALEN - 1 ? ' ':':');
-+}
-+
-+#define myNIPQUAD(a) a[0], a[1], a[2], a[3]
-+static void ebt_log(const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out, const void *data, unsigned int datalen)
-+{
-+      struct ebt_log_info *info = (struct ebt_log_info *)data;
-+      char level_string[4] = "< >";
-+      level_string[1] = '0' + info->loglevel;
-+
-+      spin_lock_bh(&ebt_log_lock);
-+      printk(level_string);
-+      printk("%s IN=%s OUT=%s ", info->prefix, in ? in->name : "",
-+         out ? out->name : "");
-+
-+      printk("MAC source = ");
-+      print_MAC((skb->mac.ethernet)->h_source);
-+      printk("MAC dest = ");
-+      print_MAC((skb->mac.ethernet)->h_dest);
-+
-+      printk("proto = 0x%04x", ntohs(((*skb).mac.ethernet)->h_proto));
-+
-+      if ((info->bitmask & EBT_LOG_IP) && skb->mac.ethernet->h_proto ==
-+         htons(ETH_P_IP)){
-+              struct iphdr *iph = skb->nh.iph;
-+              printk(" IP SRC=%u.%u.%u.%u IP DST=%u.%u.%u.%u,",
-+                 NIPQUAD(iph->saddr), NIPQUAD(iph->daddr));
-+              printk(" IP tos=0x%02X, IP proto=%d", iph->tos, iph->protocol);
-+              if (iph->protocol == IPPROTO_TCP ||
-+                  iph->protocol == IPPROTO_UDP) {
-+                      struct tcpudphdr *ports = (struct tcpudphdr *)(skb->data + iph->ihl*4);
-+
-+                      if (skb->data + iph->ihl*4 > skb->tail) {
-+                              printk(" INCOMPLETE TCP/UDP header");
-+                              goto out;
-+                      }
-+                      printk(" SPT=%u DPT=%u", ntohs(ports->src),
-+                         ntohs(ports->dst));
-+              }
-+              goto out;
-+      }
-+
-+      if ((info->bitmask & EBT_LOG_ARP) &&
-+          ((skb->mac.ethernet->h_proto == __constant_htons(ETH_P_ARP)) ||
-+          (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_RARP)))) {
-+              struct arphdr * arph = skb->nh.arph;
-+              printk(" ARP HTYPE=%d, PTYPE=0x%04x, OPCODE=%d",
-+                 ntohs(arph->ar_hrd), ntohs(arph->ar_pro),
-+                 ntohs(arph->ar_op));
-+              /* If it's for Ethernet and the lengths are OK,
-+               * then log the ARP payload */
-+              if (arph->ar_hrd == __constant_htons(1) &&
-+                  arph->ar_hln == ETH_ALEN &&
-+                  arph->ar_pln == sizeof(uint32_t)) {
-+                      struct arppayload *arpp = (struct arppayload *)(skb->data + sizeof(*arph));
-+
-+                      if (skb->data + sizeof(*arph) > skb->tail) {
-+                              printk(" INCOMPLETE ARP header");
-+                              goto out;
-+                      }
-+
-+                      printk(" ARP MAC SRC=");
-+                      print_MAC(arpp->mac_src);
-+                      printk(" ARP IP SRC=%u.%u.%u.%u",
-+                             myNIPQUAD(arpp->ip_src));
-+                      printk(" ARP MAC DST=");
-+                      print_MAC(arpp->mac_dst);
-+                      printk(" ARP IP DST=%u.%u.%u.%u",
-+                             myNIPQUAD(arpp->ip_dst));
-+              }
-+
-+      }
-+out:
-+      printk("\n");
-+      spin_unlock_bh(&ebt_log_lock);
-+}
-+
-+static struct ebt_watcher log =
-+{
-+      {NULL, NULL}, EBT_LOG_WATCHER, ebt_log, ebt_log_check, NULL,
-+      THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_watcher(&log);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_watcher(&log);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebt_mark.c src/linux/linux/net/bridge/netfilter/ebt_mark.c
---- src/linux/linux.stock/net/bridge/netfilter/ebt_mark.c      1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebt_mark.c    2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,66 @@
-+/*
-+ *  ebt_mark
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  July, 2002
-+ *
-+ */
-+
-+// The mark target can be used in any chain
-+// I believe adding a mangle table just for marking is total overkill
-+// Marking a frame doesn't really change anything in the frame anyway
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_mark_t.h>
-+#include <linux/module.h>
-+
-+static int ebt_target_mark(struct sk_buff **pskb, unsigned int hooknr,
-+   const struct net_device *in, const struct net_device *out,
-+   const void *data, unsigned int datalen)
-+{
-+      struct ebt_mark_t_info *info = (struct ebt_mark_t_info *)data;
-+
-+      if ((*pskb)->nfmark != info->mark) {
-+              (*pskb)->nfmark = info->mark;
-+              (*pskb)->nfcache |= NFC_ALTERED;
-+      }
-+      return info->target;
-+}
-+
-+static int ebt_target_mark_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_mark_t_info *info = (struct ebt_mark_t_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_mark_t_info)))
-+              return -EINVAL;
-+      if (BASE_CHAIN && info->target == EBT_RETURN)
-+              return -EINVAL;
-+      CLEAR_BASE_CHAIN_BIT;
-+      if (INVALID_TARGET)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_target mark_target =
-+{
-+      {NULL, NULL}, EBT_MARK_TARGET, ebt_target_mark,
-+      ebt_target_mark_check, NULL, THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_target(&mark_target);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_target(&mark_target);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebt_mark_m.c src/linux/linux/net/bridge/netfilter/ebt_mark_m.c
---- src/linux/linux.stock/net/bridge/netfilter/ebt_mark_m.c    1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebt_mark_m.c  2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,61 @@
-+/*
-+ *  ebt_mark_m
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  July, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_mark_m.h>
-+#include <linux/module.h>
-+
-+static int ebt_filter_mark(const struct sk_buff *skb,
-+   const struct net_device *in, const struct net_device *out, const void *data,
-+   unsigned int datalen)
-+{
-+      struct ebt_mark_m_info *info = (struct ebt_mark_m_info *) data;
-+
-+      if (info->bitmask & EBT_MARK_OR)
-+              return !(!!(skb->nfmark & info->mask) ^ info->invert);
-+      return !(((skb->nfmark & info->mask) == info->mark) ^ info->invert);
-+}
-+
-+static int ebt_mark_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+        struct ebt_mark_m_info *info = (struct ebt_mark_m_info *) data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_mark_m_info)))
-+              return -EINVAL;
-+      if (info->bitmask & ~EBT_MARK_MASK)
-+              return -EINVAL;
-+      if ((info->bitmask & EBT_MARK_OR) && (info->bitmask & EBT_MARK_AND))
-+              return -EINVAL;
-+      if (!info->bitmask)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_match filter_mark =
-+{
-+      {NULL, NULL}, EBT_MARK_MATCH, ebt_filter_mark, ebt_mark_check, NULL,
-+      THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_mark);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_mark);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebt_pkttype.c src/linux/linux/net/bridge/netfilter/ebt_pkttype.c
---- src/linux/linux.stock/net/bridge/netfilter/ebt_pkttype.c   1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebt_pkttype.c 2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,60 @@
-+/*
-+ *  ebt_pkttype
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bdschuym@pandora.be>
-+ *
-+ *  April, 2003
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_pkttype.h>
-+#include <linux/module.h>
-+
-+static int ebt_filter_pkttype(const struct sk_buff *skb,
-+   const struct net_device *in,
-+   const struct net_device *out,
-+   const void *data,
-+   unsigned int datalen)
-+{
-+      struct ebt_pkttype_info *info = (struct ebt_pkttype_info *)data;
-+
-+      return (skb->pkt_type != info->pkt_type) ^ info->invert;
-+}
-+
-+static int ebt_pkttype_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_pkttype_info *info = (struct ebt_pkttype_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_pkttype_info)))
-+              return -EINVAL;
-+      if (info->invert != 0 && info->invert != 1)
-+              return -EINVAL;
-+      /* Allow any pkt_type value */
-+      return 0;
-+}
-+
-+static struct ebt_match filter_pkttype =
-+{
-+      .name           = EBT_PKTTYPE_MATCH,
-+      .match          = ebt_filter_pkttype,
-+      .check          = ebt_pkttype_check,
-+      .me             = THIS_MODULE,
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_pkttype);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_pkttype);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebt_redirect.c src/linux/linux/net/bridge/netfilter/ebt_redirect.c
---- src/linux/linux.stock/net/bridge/netfilter/ebt_redirect.c  1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebt_redirect.c        2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,71 @@
-+/*
-+ *  ebt_redirect
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_redirect.h>
-+#include <linux/module.h>
-+#include <net/sock.h>
-+#include "../br_private.h"
-+
-+static int ebt_target_redirect(struct sk_buff **pskb, unsigned int hooknr,
-+   const struct net_device *in, const struct net_device *out,
-+   const void *data, unsigned int datalen)
-+{
-+      struct ebt_redirect_info *info = (struct ebt_redirect_info *)data;
-+
-+      if (hooknr != NF_BR_BROUTING)
-+              memcpy((**pskb).mac.ethernet->h_dest,
-+                 in->br_port->br->dev.dev_addr, ETH_ALEN);
-+      else {
-+              memcpy((**pskb).mac.ethernet->h_dest,
-+                 in->dev_addr, ETH_ALEN);
-+              (*pskb)->pkt_type = PACKET_HOST;
-+      }
-+      return info->target;
-+}
-+
-+static int ebt_target_redirect_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_redirect_info *info = (struct ebt_redirect_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_redirect_info)))
-+              return -EINVAL;
-+      if (BASE_CHAIN && info->target == EBT_RETURN)
-+              return -EINVAL;
-+      CLEAR_BASE_CHAIN_BIT;
-+      if ( (strcmp(tablename, "nat") || hookmask & ~(1 << NF_BR_PRE_ROUTING)) &&
-+           (strcmp(tablename, "broute") || hookmask & ~(1 << NF_BR_BROUTING)) )
-+              return -EINVAL;
-+      if (INVALID_TARGET)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_target redirect_target =
-+{
-+      {NULL, NULL}, EBT_REDIRECT_TARGET, ebt_target_redirect,
-+      ebt_target_redirect_check, NULL, THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_target(&redirect_target);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_target(&redirect_target);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebt_snat.c src/linux/linux/net/bridge/netfilter/ebt_snat.c
---- src/linux/linux.stock/net/bridge/netfilter/ebt_snat.c      1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebt_snat.c    2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,64 @@
-+/*
-+ *  ebt_snat
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  June, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_nat.h>
-+#include <linux/module.h>
-+
-+static int ebt_target_snat(struct sk_buff **pskb, unsigned int hooknr,
-+   const struct net_device *in, const struct net_device *out,
-+   const void *data, unsigned int datalen)
-+{
-+      struct ebt_nat_info *info = (struct ebt_nat_info *) data;
-+
-+      memcpy(((**pskb).mac.ethernet)->h_source, info->mac,
-+         ETH_ALEN * sizeof(unsigned char));
-+      return info->target;
-+}
-+
-+static int ebt_target_snat_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_nat_info *info = (struct ebt_nat_info *) data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_nat_info)))
-+              return -EINVAL;
-+      if (BASE_CHAIN && info->target == EBT_RETURN)
-+              return -EINVAL;
-+      CLEAR_BASE_CHAIN_BIT;
-+      if (strcmp(tablename, "nat"))
-+              return -EINVAL;
-+      if (hookmask & ~(1 << NF_BR_POST_ROUTING))
-+              return -EINVAL;
-+      if (INVALID_TARGET)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_target snat =
-+{
-+      {NULL, NULL}, EBT_SNAT_TARGET, ebt_target_snat, ebt_target_snat_check,
-+      NULL, THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_target(&snat);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_target(&snat);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebt_stp.c src/linux/linux/net/bridge/netfilter/ebt_stp.c
---- src/linux/linux.stock/net/bridge/netfilter/ebt_stp.c       1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebt_stp.c     2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,191 @@
-+/*
-+ *  ebt_stp
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bdschuym@pandora.be>
-+ *    Stephen Hemminger <shemminger@osdl.org>
-+ *
-+ *  June, 2003
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_stp.h>
-+#include <linux/module.h>
-+
-+#define BPDU_TYPE_CONFIG 0
-+#define BPDU_TYPE_TCN 0x80
-+
-+struct stp_header {
-+      uint8_t dsap;
-+      uint8_t ssap;
-+      uint8_t ctrl;
-+      uint8_t pid;
-+      uint8_t vers;
-+      uint8_t type;
-+};
-+
-+struct stp_config_pdu {
-+      uint8_t flags;
-+      uint8_t root[8];
-+      uint8_t root_cost[4];
-+      uint8_t sender[8];
-+      uint8_t port[2];
-+      uint8_t msg_age[2];
-+      uint8_t max_age[2];
-+      uint8_t hello_time[2];
-+      uint8_t forward_delay[2];
-+};
-+
-+#define NR16(p) (p[0] << 8 | p[1])
-+#define NR32(p) ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3])
-+
-+static int ebt_filter_config(struct ebt_stp_info *info,
-+   struct stp_config_pdu *stpc)
-+{
-+      struct ebt_stp_config_info *c;
-+      uint16_t v16;
-+      uint32_t v32;
-+      int verdict, i;
-+
-+      c = &info->config;
-+      if ((info->bitmask & EBT_STP_FLAGS) &&
-+          FWINV(c->flags != stpc->flags, EBT_STP_FLAGS))
-+              return EBT_NOMATCH;
-+      if (info->bitmask & EBT_STP_ROOTPRIO) {
-+              v16 = NR16(stpc->root);
-+              if (FWINV(v16 < c->root_priol ||
-+                  v16 > c->root_priou, EBT_STP_ROOTPRIO))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_ROOTADDR) {
-+              verdict = 0;
-+              for (i = 0; i < 6; i++)
-+                      verdict |= (stpc->root[2+i] ^ c->root_addr[i]) &
-+                                 c->root_addrmsk[i];
-+              if (FWINV(verdict != 0, EBT_STP_ROOTADDR))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_ROOTCOST) {
-+              v32 = NR32(stpc->root_cost);
-+              if (FWINV(v32 < c->root_costl ||
-+                  v32 > c->root_costu, EBT_STP_ROOTCOST))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_SENDERPRIO) {
-+              v16 = NR16(stpc->sender);
-+              if (FWINV(v16 < c->sender_priol ||
-+                  v16 > c->sender_priou, EBT_STP_SENDERPRIO))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_SENDERADDR) {
-+              verdict = 0;
-+              for (i = 0; i < 6; i++)
-+                      verdict |= (stpc->sender[2+i] ^ c->sender_addr[i]) &
-+                                 c->sender_addrmsk[i];
-+              if (FWINV(verdict != 0, EBT_STP_SENDERADDR))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_PORT) {
-+              v16 = NR16(stpc->port);
-+              if (FWINV(v16 < c->portl ||
-+                  v16 > c->portu, EBT_STP_PORT))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_MSGAGE) {
-+              v16 = NR16(stpc->msg_age);
-+              if (FWINV(v16 < c->msg_agel ||
-+                  v16 > c->msg_ageu, EBT_STP_MSGAGE))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_MAXAGE) {
-+              v16 = NR16(stpc->max_age);
-+              if (FWINV(v16 < c->max_agel ||
-+                  v16 > c->max_ageu, EBT_STP_MAXAGE))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_HELLOTIME) {
-+              v16 = NR16(stpc->hello_time);
-+              if (FWINV(v16 < c->hello_timel ||
-+                  v16 > c->hello_timeu, EBT_STP_HELLOTIME))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_FWDD) {
-+              v16 = NR16(stpc->forward_delay);
-+              if (FWINV(v16 < c->forward_delayl ||
-+                  v16 > c->forward_delayu, EBT_STP_FWDD))
-+                      return EBT_NOMATCH;
-+      }
-+      return EBT_MATCH;
-+}
-+
-+static int ebt_filter_stp(const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out, const void *data, unsigned int datalen)
-+{
-+      struct ebt_stp_info *info = (struct ebt_stp_info *)data;
-+      struct stp_header stph;
-+      uint8_t header[6] = {0x42, 0x42, 0x03, 0x00, 0x00, 0x00};
-+      if (skb_copy_bits(skb, 0, &stph, sizeof(stph)))
-+              return EBT_NOMATCH;
-+
-+      /* The stp code only considers these */
-+      if (memcmp(&stph, header, sizeof(header)))
-+              return EBT_NOMATCH;
-+
-+      if (info->bitmask & EBT_STP_TYPE
-+          && FWINV(info->type != stph.type, EBT_STP_TYPE))
-+              return EBT_NOMATCH;
-+
-+      if (stph.type == BPDU_TYPE_CONFIG &&
-+          info->bitmask & EBT_STP_CONFIG_MASK) {
-+              struct stp_config_pdu stpc;
-+
-+              if (skb_copy_bits(skb, sizeof(stph), &stpc, sizeof(stpc)))
-+                  return EBT_NOMATCH;
-+              return ebt_filter_config(info, &stpc);
-+      }
-+      return EBT_MATCH;
-+}
-+
-+static int ebt_stp_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_stp_info *info = (struct ebt_stp_info *)data;
-+      int len = EBT_ALIGN(sizeof(struct ebt_stp_info));
-+      uint8_t bridge_ula[6] = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 };
-+      uint8_t msk[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
-+
-+      if (info->bitmask & ~EBT_STP_MASK || info->invflags & ~EBT_STP_MASK ||
-+          !(info->bitmask & EBT_STP_MASK))
-+              return -EINVAL;
-+      if (datalen != len)
-+              return -EINVAL;
-+      /* Make sure the match only receives stp frames */
-+      if (memcmp(e->destmac, bridge_ula, ETH_ALEN) ||
-+          memcmp(e->destmsk, msk, ETH_ALEN) || !(e->bitmask & EBT_DESTMAC))
-+              return -EINVAL;
-+
-+      return 0;
-+}
-+
-+static struct ebt_match filter_stp =
-+{
-+      .name           = EBT_STP_MATCH,
-+      .match          = ebt_filter_stp,
-+      .check          = ebt_stp_check,
-+      .me             = THIS_MODULE,
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_stp);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_stp);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebt_vlan.c src/linux/linux/net/bridge/netfilter/ebt_vlan.c
---- src/linux/linux.stock/net/bridge/netfilter/ebt_vlan.c      1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebt_vlan.c    2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,259 @@
-+/*
-+ * Description: EBTables 802.1Q match extension kernelspace module.
-+ * Authors: Nick Fedchik <nick@fedchik.org.ua>
-+ *          Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *    
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ * 
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *  
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-+ */
-+
-+#include <linux/if_ether.h>
-+#include <linux/if_vlan.h>
-+#include <linux/module.h>
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_vlan.h>
-+
-+static unsigned char debug;
-+#define MODULE_VERSION "0.6"
-+
-+MODULE_PARM(debug, "0-1b");
-+MODULE_PARM_DESC(debug, "debug=1 is turn on debug messages");
-+MODULE_AUTHOR("Nick Fedchik <nick@fedchik.org.ua>");
-+MODULE_DESCRIPTION("802.1Q match module (ebtables extension), v"
-+                 MODULE_VERSION);
-+MODULE_LICENSE("GPL");
-+
-+
-+#define DEBUG_MSG(args...) if (debug) printk (KERN_DEBUG "ebt_vlan: " args)
-+#define INV_FLAG(_inv_flag_) (info->invflags & _inv_flag_) ? "!" : ""
-+#define GET_BITMASK(_BIT_MASK_) info->bitmask & _BIT_MASK_
-+#define SET_BITMASK(_BIT_MASK_) info->bitmask |= _BIT_MASK_
-+#define EXIT_ON_MISMATCH(_MATCH_,_MASK_) if (!((info->_MATCH_ == _MATCH_)^!!(info->invflags & _MASK_))) return 1;
-+
-+/*
-+ * Function description: ebt_filter_vlan() is main engine for 
-+ * checking passed 802.1Q frame according to 
-+ * the passed extension parameters (in the *data buffer)
-+ * ebt_filter_vlan() is called after successfull check the rule params
-+ * by ebt_check_vlan() function.
-+ * Parameters:
-+ * const struct sk_buff *skb - pointer to passed ethernet frame buffer
-+ * const void *data - pointer to passed extension parameters
-+ * unsigned int datalen - length of passed *data buffer
-+ * const struct net_device *in  -
-+ * const struct net_device *out -
-+ * const struct ebt_counter *c -
-+ * Returned values:
-+ * 0 - ok (all rule params matched)
-+ * 1 - miss (rule params not acceptable to the parsed frame)
-+ */
-+static int
-+ebt_filter_vlan(const struct sk_buff *skb,
-+              const struct net_device *in,
-+              const struct net_device *out,
-+              const void *data, unsigned int datalen)
-+{
-+      struct ebt_vlan_info *info = (struct ebt_vlan_info *) data;     /* userspace data */
-+      struct vlan_ethhdr *frame = (struct vlan_ethhdr *) skb->mac.raw;        /* Passed tagged frame */
-+
-+      unsigned short TCI;     /* Whole TCI, given from parsed frame */
-+      unsigned short id;      /* VLAN ID, given from frame TCI */
-+      unsigned char prio;     /* user_priority, given from frame TCI */
-+      unsigned short encap;   /* VLAN encapsulated Type/Length field, given from orig frame */
-+
-+      /*
-+       * Tag Control Information (TCI) consists of the following elements:
-+       * - User_priority. The user_priority field is three bits in length, 
-+       * interpreted as a binary number. 
-+       * - Canonical Format Indicator (CFI). The Canonical Format Indicator 
-+       * (CFI) is a single bit flag value. Currently ignored.
-+       * - VLAN Identifier (VID). The VID is encoded as 
-+       * an unsigned binary number. 
-+       */
-+      TCI = ntohs(frame->h_vlan_TCI);
-+      id = TCI & VLAN_VID_MASK;
-+      prio = (TCI >> 13) & 0x7;
-+      encap = frame->h_vlan_encapsulated_proto;
-+
-+      /*
-+       * Checking VLAN Identifier (VID)
-+       */
-+      if (GET_BITMASK(EBT_VLAN_ID)) { /* Is VLAN ID parsed? */
-+              EXIT_ON_MISMATCH(id, EBT_VLAN_ID);
-+      }
-+      /*
-+       * Checking user_priority
-+       */
-+      if (GET_BITMASK(EBT_VLAN_PRIO)) {       /* Is VLAN user_priority parsed? */
-+              EXIT_ON_MISMATCH(prio, EBT_VLAN_PRIO);
-+      }
-+      /*
-+       * Checking Encapsulated Proto (Length/Type) field
-+       */
-+      if (GET_BITMASK(EBT_VLAN_ENCAP)) {      /* Is VLAN Encap parsed? */
-+              EXIT_ON_MISMATCH(encap, EBT_VLAN_ENCAP);
-+      }
-+      /*
-+       * All possible extension parameters was parsed.
-+       * If rule never returned by missmatch, then all ok.
-+       */
-+      return 0;
-+}
-+
-+/*
-+ * Function description: ebt_vlan_check() is called when userspace 
-+ * delivers the table entry to the kernel, 
-+ * and to check that userspace doesn't give a bad table.
-+ * Parameters:
-+ * const char *tablename - table name string
-+ * unsigned int hooknr - hook number
-+ * const struct ebt_entry *e - ebtables entry basic set
-+ * const void *data - pointer to passed extension parameters
-+ * unsigned int datalen - length of passed *data buffer
-+ * Returned values:
-+ * 0 - ok (all delivered rule params are correct)
-+ * 1 - miss (rule params is out of range, invalid, incompatible, etc.)
-+ */
-+static int
-+ebt_check_vlan(const char *tablename,
-+             unsigned int hooknr,
-+             const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_vlan_info *info = (struct ebt_vlan_info *) data;
-+
-+      /*
-+       * Parameters buffer overflow check 
-+       */
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_vlan_info))) {
-+              DEBUG_MSG
-+                  ("passed size %d is not eq to ebt_vlan_info (%d)\n",
-+                   datalen, sizeof(struct ebt_vlan_info));
-+              return -EINVAL;
-+      }
-+
-+      /*
-+       * Is it 802.1Q frame checked?
-+       */
-+      if (e->ethproto != __constant_htons(ETH_P_8021Q)) {
-+              DEBUG_MSG
-+                  ("passed entry proto %2.4X is not 802.1Q (8100)\n",
-+                   (unsigned short) ntohs(e->ethproto));
-+              return -EINVAL;
-+      }
-+
-+      /*
-+       * Check for bitmask range 
-+       * True if even one bit is out of mask
-+       */
-+      if (info->bitmask & ~EBT_VLAN_MASK) {
-+              DEBUG_MSG("bitmask %2X is out of mask (%2X)\n",
-+                        info->bitmask, EBT_VLAN_MASK);
-+              return -EINVAL;
-+      }
-+
-+      /*
-+       * Check for inversion flags range 
-+       */
-+      if (info->invflags & ~EBT_VLAN_MASK) {
-+              DEBUG_MSG("inversion flags %2X is out of mask (%2X)\n",
-+                        info->invflags, EBT_VLAN_MASK);
-+              return -EINVAL;
-+      }
-+
-+      /*
-+       * Reserved VLAN ID (VID) values
-+       * -----------------------------
-+       * 0 - The null VLAN ID. 
-+       * 1 - The default Port VID (PVID)
-+       * 0x0FFF - Reserved for implementation use. 
-+       * if_vlan.h: VLAN_GROUP_ARRAY_LEN 4096.
-+       */
-+      if (GET_BITMASK(EBT_VLAN_ID)) { /* when vlan-id param was spec-ed */
-+              if (!!info->id) {       /* if id!=0 => check vid range */
-+                      if (info->id > VLAN_GROUP_ARRAY_LEN) {
-+                              DEBUG_MSG
-+                                  ("id %d is out of range (1-4096)\n",
-+                                   info->id);
-+                              return -EINVAL;
-+                      }
-+                      /*
-+                       * Note: This is valid VLAN-tagged frame point.
-+                       * Any value of user_priority are acceptable, 
-+                       * but should be ignored according to 802.1Q Std.
-+                       * So we just drop the prio flag. 
-+                       */
-+                      info->bitmask &= ~EBT_VLAN_PRIO;
-+              }
-+              /*
-+               * Else, id=0 (null VLAN ID)  => user_priority range (any?)
-+               */
-+      }
-+
-+      if (GET_BITMASK(EBT_VLAN_PRIO)) {
-+              if ((unsigned char) info->prio > 7) {
-+                      DEBUG_MSG
-+                          ("prio %d is out of range (0-7)\n",
-+                           info->prio);
-+                      return -EINVAL;
-+              }
-+      }
-+      /*
-+       * Check for encapsulated proto range - it is possible to be 
-+       * any value for u_short range.
-+       * if_ether.h:  ETH_ZLEN        60   -  Min. octets in frame sans FCS
-+       */
-+      if (GET_BITMASK(EBT_VLAN_ENCAP)) {
-+              if ((unsigned short) ntohs(info->encap) < ETH_ZLEN) {
-+                      DEBUG_MSG
-+                          ("encap frame length %d is less than minimal\n",
-+                           ntohs(info->encap));
-+                      return -EINVAL;
-+              }
-+      }
-+
-+      return 0;
-+}
-+
-+static struct ebt_match filter_vlan = {
-+      {NULL, NULL},
-+      EBT_VLAN_MATCH,
-+      ebt_filter_vlan,
-+      ebt_check_vlan,
-+      NULL,
-+      THIS_MODULE
-+};
-+
-+/*
-+ * Module initialization function.
-+ */
-+static int __init init(void)
-+{
-+      DEBUG_MSG("ebtables 802.1Q extension module v"
-+                MODULE_VERSION "\n");
-+      DEBUG_MSG("module debug=%d\n", !!debug);
-+      return ebt_register_match(&filter_vlan);
-+}
-+
-+/*
-+ * Module "finalization" function
-+ */
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_vlan);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+
-+EXPORT_NO_SYMBOLS;
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebtable_broute.c src/linux/linux/net/bridge/netfilter/ebtable_broute.c
---- src/linux/linux.stock/net/bridge/netfilter/ebtable_broute.c        1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebtable_broute.c      2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,79 @@
-+/*
-+ *  ebtable_broute
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ *  This table lets you choose between routing and bridging for frames
-+ *  entering on a bridge enslaved nic. This table is traversed before any
-+ *  other ebtables table. See net/bridge/br_input.c.
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/module.h>
-+#include <linux/if_bridge.h>
-+#include <linux/brlock.h>
-+
-+// EBT_ACCEPT means the frame will be bridged
-+// EBT_DROP means the frame will be routed
-+static struct ebt_entries initial_chain =
-+  {0, "BROUTING", 0, EBT_ACCEPT, 0};
-+
-+static struct ebt_replace initial_table =
-+{
-+  "broute", 1 << NF_BR_BROUTING, 0, sizeof(struct ebt_entries),
-+  { [NF_BR_BROUTING]&initial_chain}, 0, NULL, (char *)&initial_chain
-+};
-+
-+static int check(const struct ebt_table_info *info, unsigned int valid_hooks)
-+{
-+      if (valid_hooks & ~(1 << NF_BR_BROUTING))
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_table broute_table =
-+{
-+  {NULL, NULL}, "broute", &initial_table, 1 << NF_BR_BROUTING,
-+  RW_LOCK_UNLOCKED, check, NULL
-+};
-+
-+static int ebt_broute(struct sk_buff **pskb)
-+{
-+      int ret;
-+
-+      ret = ebt_do_table(NF_BR_BROUTING, pskb, (*pskb)->dev, NULL,
-+         &broute_table);
-+      if (ret == NF_DROP)
-+              return 1; // route it
-+      return 0; // bridge it
-+}
-+
-+static int __init init(void)
-+{
-+      int ret;
-+
-+      ret = ebt_register_table(&broute_table);
-+      if (ret < 0)
-+              return ret;
-+      br_write_lock_bh(BR_NETPROTO_LOCK);
-+      // see br_input.c
-+      br_should_route_hook = ebt_broute;
-+      br_write_unlock_bh(BR_NETPROTO_LOCK);
-+      return ret;
-+}
-+
-+static void __exit fini(void)
-+{
-+      br_write_lock_bh(BR_NETPROTO_LOCK);
-+      br_should_route_hook = NULL;
-+      br_write_unlock_bh(BR_NETPROTO_LOCK);
-+      ebt_unregister_table(&broute_table);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebtable_filter.c src/linux/linux/net/bridge/netfilter/ebtable_filter.c
---- src/linux/linux.stock/net/bridge/netfilter/ebtable_filter.c        1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebtable_filter.c      2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,90 @@
-+/*
-+ *  ebtable_filter
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/module.h>
-+
-+#define FILTER_VALID_HOOKS ((1 << NF_BR_LOCAL_IN) | (1 << NF_BR_FORWARD) | \
-+   (1 << NF_BR_LOCAL_OUT))
-+
-+static struct ebt_entries initial_chains[] =
-+{
-+  {0, "INPUT", 0, EBT_ACCEPT, 0},
-+  {0, "FORWARD", 0, EBT_ACCEPT, 0},
-+  {0, "OUTPUT", 0, EBT_ACCEPT, 0}
-+};
-+
-+static struct ebt_replace initial_table =
-+{
-+  "filter", FILTER_VALID_HOOKS, 0, 3 * sizeof(struct ebt_entries),
-+  { [NF_BR_LOCAL_IN]&initial_chains[0], [NF_BR_FORWARD]&initial_chains[1],
-+    [NF_BR_LOCAL_OUT]&initial_chains[2] }, 0, NULL, (char *)initial_chains
-+};
-+
-+static int check(const struct ebt_table_info *info, unsigned int valid_hooks)
-+{
-+      if (valid_hooks & ~FILTER_VALID_HOOKS)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_table frame_filter =
-+{ 
-+  {NULL, NULL}, "filter", &initial_table, FILTER_VALID_HOOKS, 
-+  RW_LOCK_UNLOCKED, check, NULL
-+};
-+
-+static unsigned int
-+ebt_hook (unsigned int hook, struct sk_buff **pskb, const struct net_device *in,
-+   const struct net_device *out, int (*okfn)(struct sk_buff *))
-+{
-+      return ebt_do_table(hook, pskb, in, out, &frame_filter);
-+}
-+
-+static struct nf_hook_ops ebt_ops_filter[] = {
-+      { { NULL, NULL }, ebt_hook, PF_BRIDGE, NF_BR_LOCAL_IN,
-+         NF_BR_PRI_FILTER_BRIDGED},
-+      { { NULL, NULL }, ebt_hook, PF_BRIDGE, NF_BR_FORWARD,
-+         NF_BR_PRI_FILTER_BRIDGED},
-+      { { NULL, NULL }, ebt_hook, PF_BRIDGE, NF_BR_LOCAL_OUT,
-+         NF_BR_PRI_FILTER_OTHER}
-+};
-+
-+static int __init init(void)
-+{
-+      int i, j, ret;
-+
-+      ret = ebt_register_table(&frame_filter);
-+      if (ret < 0)
-+              return ret;
-+      for (i = 0; i < sizeof(ebt_ops_filter) / sizeof(ebt_ops_filter[0]); i++)
-+              if ((ret = nf_register_hook(&ebt_ops_filter[i])) < 0)
-+                      goto cleanup;
-+      return ret;
-+cleanup:
-+      for (j = 0; j < i; j++)
-+              nf_unregister_hook(&ebt_ops_filter[j]);
-+      ebt_unregister_table(&frame_filter);
-+      return ret;
-+}
-+
-+static void __exit fini(void)
-+{
-+      int i;
-+
-+      for (i = 0; i < sizeof(ebt_ops_filter) / sizeof(ebt_ops_filter[0]); i++)
-+              nf_unregister_hook(&ebt_ops_filter[i]);
-+      ebt_unregister_table(&frame_filter);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebtable_nat.c src/linux/linux/net/bridge/netfilter/ebtable_nat.c
---- src/linux/linux.stock/net/bridge/netfilter/ebtable_nat.c   1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebtable_nat.c 2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,96 @@
-+/*
-+ *  ebtable_nat
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/module.h>
-+#define NAT_VALID_HOOKS ((1 << NF_BR_PRE_ROUTING) | (1 << NF_BR_LOCAL_OUT) | \
-+   (1 << NF_BR_POST_ROUTING))
-+
-+static struct ebt_entries initial_chains[] =
-+{
-+  {0, "PREROUTING", 0, EBT_ACCEPT, 0},
-+  {0, "OUTPUT", 0, EBT_ACCEPT, 0},
-+  {0, "POSTROUTING", 0, EBT_ACCEPT, 0}
-+};
-+
-+static struct ebt_replace initial_table =
-+{
-+  "nat", NAT_VALID_HOOKS, 0, 3 * sizeof(struct ebt_entries),
-+  { [NF_BR_PRE_ROUTING]&initial_chains[0], [NF_BR_LOCAL_OUT]&initial_chains[1],
-+    [NF_BR_POST_ROUTING]&initial_chains[2] }, 0, NULL, (char *)initial_chains
-+};
-+
-+static int check(const struct ebt_table_info *info, unsigned int valid_hooks)
-+{
-+      if (valid_hooks & ~NAT_VALID_HOOKS)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_table frame_nat =
-+{
-+  {NULL, NULL}, "nat", &initial_table, NAT_VALID_HOOKS,
-+  RW_LOCK_UNLOCKED, check, NULL
-+};
-+
-+static unsigned int
-+ebt_nat_dst(unsigned int hook, struct sk_buff **pskb, const struct net_device *in
-+   , const struct net_device *out, int (*okfn)(struct sk_buff *))
-+{
-+      return ebt_do_table(hook, pskb, in, out, &frame_nat);
-+}
-+
-+static unsigned int
-+ebt_nat_src(unsigned int hook, struct sk_buff **pskb, const struct net_device *in
-+   , const struct net_device *out, int (*okfn)(struct sk_buff *))
-+{
-+      return ebt_do_table(hook, pskb, in, out, &frame_nat);
-+}
-+
-+static struct nf_hook_ops ebt_ops_nat[] = {
-+      { { NULL, NULL }, ebt_nat_dst, PF_BRIDGE, NF_BR_LOCAL_OUT,
-+         NF_BR_PRI_NAT_DST_OTHER},
-+      { { NULL, NULL }, ebt_nat_src, PF_BRIDGE, NF_BR_POST_ROUTING,
-+         NF_BR_PRI_NAT_SRC},
-+      { { NULL, NULL }, ebt_nat_dst, PF_BRIDGE, NF_BR_PRE_ROUTING,
-+         NF_BR_PRI_NAT_DST_BRIDGED},
-+};
-+
-+static int __init init(void)
-+{
-+      int i, ret, j;
-+
-+      ret = ebt_register_table(&frame_nat);
-+      if (ret < 0)
-+              return ret;
-+      for (i = 0; i < sizeof(ebt_ops_nat) / sizeof(ebt_ops_nat[0]); i++)
-+              if ((ret = nf_register_hook(&ebt_ops_nat[i])) < 0)
-+                      goto cleanup;
-+      return ret;
-+cleanup:
-+      for (j = 0; j < i; j++)
-+              nf_unregister_hook(&ebt_ops_nat[j]);
-+      ebt_unregister_table(&frame_nat);
-+      return ret;
-+}
-+
-+static void __exit fini(void)
-+{
-+      int i;
-+
-+      for (i = 0; i < sizeof(ebt_ops_nat) / sizeof(ebt_ops_nat[0]); i++)
-+              nf_unregister_hook(&ebt_ops_nat[i]);
-+      ebt_unregister_table(&frame_nat);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.stock/net/bridge/netfilter/ebtables.c src/linux/linux/net/bridge/netfilter/ebtables.c
---- src/linux/linux.stock/net/bridge/netfilter/ebtables.c      1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/bridge/netfilter/ebtables.c    2004-07-10 23:46:39.000000000 -0400
-@@ -0,0 +1,1490 @@
-+/*
-+ *  ebtables
-+ *
-+ *  Author:
-+ *  Bart De Schuymer          <bart.de.schuymer@pandora.be>
-+ *
-+ *  ebtables.c,v 2.0, July, 2002
-+ *
-+ *  This code is stongly inspired on the iptables code which is
-+ *  Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling
-+ *
-+ *  This program is free software; you can redistribute it and/or
-+ *  modify it under the terms of the GNU General Public License
-+ *  as published by the Free Software Foundation; either version
-+ *  2 of the License, or (at your option) any later version.
-+ */
-+
-+// used for print_string
-+#include <linux/sched.h>
-+#include <linux/tty.h>
-+
-+#include <linux/kmod.h>
-+#include <linux/module.h>
-+#include <linux/vmalloc.h>
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/spinlock.h>
-+#include <asm/uaccess.h>
-+#include <linux/smp.h>
-+#include <net/sock.h>
-+// needed for logical [in,out]-dev filtering
-+#include "../br_private.h"
-+
-+// list_named_find
-+#define ASSERT_READ_LOCK(x)
-+#define ASSERT_WRITE_LOCK(x)
-+#include <linux/netfilter_ipv4/listhelp.h>
-+
-+#if 0 // use this for remote debugging
-+// Copyright (C) 1998 by Ori Pomerantz
-+// Print the string to the appropriate tty, the one
-+// the current task uses
-+static void print_string(char *str)
-+{
-+      struct tty_struct *my_tty;
-+
-+      /* The tty for the current task */
-+      my_tty = current->tty;
-+      if (my_tty != NULL) {
-+              (*(my_tty->driver).write)(my_tty, 0, str, strlen(str));
-+              (*(my_tty->driver).write)(my_tty, 0, "\015\012", 2);
-+      }
-+}
-+
-+#define BUGPRINT(args) print_string(args);
-+#else
-+#define BUGPRINT(format, args...) printk("kernel msg: ebtables bug: please "\
-+                                         "report to author: "format, ## args)
-+// #define BUGPRINT(format, args...)
-+#endif
-+#define MEMPRINT(format, args...) printk("kernel msg: ebtables "\
-+                                         ": out of memory: "format, ## args)
-+// #define MEMPRINT(format, args...)
-+
-+
-+
-+// Each cpu has its own set of counters, so there is no need for write_lock in
-+// the softirq
-+// For reading or updating the counters, the user context needs to
-+// get a write_lock
-+
-+// The size of each set of counters is altered to get cache alignment
-+#define SMP_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1))
-+#define COUNTER_OFFSET(n) (SMP_ALIGN(n * sizeof(struct ebt_counter)))
-+#define COUNTER_BASE(c, n, cpu) ((struct ebt_counter *)(((char *)c) + \
-+   COUNTER_OFFSET(n) * cpu))
-+
-+
-+
-+static DECLARE_MUTEX(ebt_mutex);
-+static LIST_HEAD(ebt_tables);
-+static LIST_HEAD(ebt_targets);
-+static LIST_HEAD(ebt_matches);
-+static LIST_HEAD(ebt_watchers);
-+
-+static struct ebt_target ebt_standard_target =
-+{ {NULL, NULL}, EBT_STANDARD_TARGET, NULL, NULL, NULL, NULL};
-+
-+static inline int ebt_do_watcher (struct ebt_entry_watcher *w,
-+   const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out)
-+{
-+      w->u.watcher->watcher(skb, in, out, w->data,
-+         w->watcher_size);
-+      // watchers don't give a verdict
-+      return 0;
-+}
-+
-+static inline int ebt_do_match (struct ebt_entry_match *m,
-+   const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out)
-+{
-+      return m->u.match->match(skb, in, out, m->data,
-+         m->match_size);
-+}
-+
-+static inline int ebt_dev_check(char *entry, const struct net_device *device)
-+{
-+      if (*entry == '\0')
-+              return 0;
-+      if (!device)
-+              return 1;
-+      return !!strcmp(entry, device->name);
-+}
-+
-+#define FWINV2(bool,invflg) ((bool) ^ !!(e->invflags & invflg))
-+// process standard matches
-+static inline int ebt_basic_match(struct ebt_entry *e, struct ethhdr *h,
-+   const struct net_device *in, const struct net_device *out)
-+{
-+      int verdict, i;
-+
-+      if (e->bitmask & EBT_802_3) {
-+              if (FWINV2(ntohs(h->h_proto) >= 1536, EBT_IPROTO))
-+                      return 1;
-+      } else if (!(e->bitmask & EBT_NOPROTO) &&
-+         FWINV2(e->ethproto != h->h_proto, EBT_IPROTO))
-+              return 1;
-+
-+      if (FWINV2(ebt_dev_check(e->in, in), EBT_IIN))
-+              return 1;
-+      if (FWINV2(ebt_dev_check(e->out, out), EBT_IOUT))
-+              return 1;
-+      if ((!in || !in->br_port) ? 0 : FWINV2(ebt_dev_check(
-+         e->logical_in, &in->br_port->br->dev), EBT_ILOGICALIN))
-+              return 1;
-+      if ((!out || !out->br_port) ? 0 : FWINV2(ebt_dev_check(
-+         e->logical_out, &out->br_port->br->dev), EBT_ILOGICALOUT))
-+              return 1;
-+
-+      if (e->bitmask & EBT_SOURCEMAC) {
-+              verdict = 0;
-+              for (i = 0; i < 6; i++)
-+                      verdict |= (h->h_source[i] ^ e->sourcemac[i]) &
-+                         e->sourcemsk[i];
-+              if (FWINV2(verdict != 0, EBT_ISOURCE) )
-+                      return 1;
-+      }
-+      if (e->bitmask & EBT_DESTMAC) {
-+              verdict = 0;
-+              for (i = 0; i < 6; i++)
-+                      verdict |= (h->h_dest[i] ^ e->destmac[i]) &
-+                         e->destmsk[i];
-+              if (FWINV2(verdict != 0, EBT_IDEST) )
-+                      return 1;
-+      }
-+      return 0;
-+}
-+
-+// Do some firewalling
-+unsigned int ebt_do_table (unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   struct ebt_table *table)
-+{
-+      int i, nentries;
-+      struct ebt_entry *point;
-+      struct ebt_counter *counter_base, *cb_base;
-+      struct ebt_entry_target *t;
-+      int verdict, sp = 0;
-+      struct ebt_chainstack *cs;
-+      struct ebt_entries *chaininfo;
-+      char *base;
-+      struct ebt_table_info *private = table->private;
-+
-+      read_lock_bh(&table->lock);
-+      cb_base = COUNTER_BASE(private->counters, private->nentries,
-+         cpu_number_map(smp_processor_id()));
-+      if (private->chainstack)
-+              cs = private->chainstack[cpu_number_map(smp_processor_id())];
-+      else
-+              cs = NULL;
-+      chaininfo = private->hook_entry[hook];
-+      nentries = private->hook_entry[hook]->nentries;
-+      point = (struct ebt_entry *)(private->hook_entry[hook]->data);
-+      counter_base = cb_base + private->hook_entry[hook]->counter_offset;
-+      // base for chain jumps
-+      base = private->entries;
-+      i = 0;
-+      while (i < nentries) {
-+              if (ebt_basic_match(point, (**pskb).mac.ethernet, in, out))
-+                      goto letscontinue;
-+
-+              if (EBT_MATCH_ITERATE(point, ebt_do_match, *pskb, in, out) != 0)
-+                      goto letscontinue;
-+
-+              // increase counter
-+              (*(counter_base + i)).pcnt++;
-+              (*(counter_base + i)).bcnt+=(**pskb).len;
-+
-+              // these should only watch: not modify, nor tell us
-+              // what to do with the packet
-+              EBT_WATCHER_ITERATE(point, ebt_do_watcher, *pskb, in,
-+                 out);
-+
-+              t = (struct ebt_entry_target *)
-+                 (((char *)point) + point->target_offset);
-+              // standard target
-+              if (!t->u.target->target)
-+                      verdict = ((struct ebt_standard_target *)t)->verdict;
-+              else
-+                      verdict = t->u.target->target(pskb, hook,
-+                         in, out, t->data, t->target_size);
-+              if (verdict == EBT_ACCEPT) {
-+                      read_unlock_bh(&table->lock);
-+                      return NF_ACCEPT;
-+              }
-+              if (verdict == EBT_DROP) {
-+                      read_unlock_bh(&table->lock);
-+                      return NF_DROP;
-+              }
-+              if (verdict == EBT_RETURN) {
-+letsreturn:
-+#ifdef CONFIG_NETFILTER_DEBUG
-+                      if (sp == 0) {
-+                              BUGPRINT("RETURN on base chain");
-+                              // act like this is EBT_CONTINUE
-+                              goto letscontinue;
-+                      }
-+#endif
-+                      sp--;
-+                      // put all the local variables right
-+                      i = cs[sp].n;
-+                      chaininfo = cs[sp].chaininfo;
-+                      nentries = chaininfo->nentries;
-+                      point = cs[sp].e;
-+                      counter_base = cb_base +
-+                         chaininfo->counter_offset;
-+                      continue;
-+              }
-+              if (verdict == EBT_CONTINUE)
-+                      goto letscontinue;
-+#ifdef CONFIG_NETFILTER_DEBUG
-+              if (verdict < 0) {
-+                      BUGPRINT("bogus standard verdict\n");
-+                      read_unlock_bh(&table->lock);
-+                      return NF_DROP;
-+              }
-+#endif
-+              // jump to a udc
-+              cs[sp].n = i + 1;
-+              cs[sp].chaininfo = chaininfo;
-+              cs[sp].e = (struct ebt_entry *)
-+                 (((char *)point) + point->next_offset);
-+              i = 0;
-+              chaininfo = (struct ebt_entries *) (base + verdict);
-+#ifdef CONFIG_NETFILTER_DEBUG
-+              if (chaininfo->distinguisher) {
-+                      BUGPRINT("jump to non-chain\n");
-+                      read_unlock_bh(&table->lock);
-+                      return NF_DROP;
-+              }
-+#endif
-+              nentries = chaininfo->nentries;
-+              point = (struct ebt_entry *)chaininfo->data;
-+              counter_base = cb_base + chaininfo->counter_offset;
-+              sp++;
-+              continue;
-+letscontinue:
-+              point = (struct ebt_entry *)
-+                 (((char *)point) + point->next_offset);
-+              i++;
-+      }
-+
-+      // I actually like this :)
-+      if (chaininfo->policy == EBT_RETURN)
-+              goto letsreturn;
-+      if (chaininfo->policy == EBT_ACCEPT) {
-+              read_unlock_bh(&table->lock);
-+              return NF_ACCEPT;
-+      }
-+      read_unlock_bh(&table->lock);
-+      return NF_DROP;
-+}
-+
-+// If it succeeds, returns element and locks mutex
-+static inline void *
-+find_inlist_lock_noload(struct list_head *head, const char *name, int *error,
-+   struct semaphore *mutex)
-+{
-+      void *ret;
-+
-+      *error = down_interruptible(mutex);
-+      if (*error != 0)
-+              return NULL;
-+
-+      ret = list_named_find(head, name);
-+      if (!ret) {
-+              *error = -ENOENT;
-+              up(mutex);
-+      }
-+      return ret;
-+}
-+
-+#ifndef CONFIG_KMOD
-+#define find_inlist_lock(h,n,p,e,m) find_inlist_lock_noload((h),(n),(e),(m))
-+#else
-+static void *
-+find_inlist_lock(struct list_head *head, const char *name, const char *prefix,
-+   int *error, struct semaphore *mutex)
-+{
-+      void *ret;
-+
-+      ret = find_inlist_lock_noload(head, name, error, mutex);
-+      if (!ret) {
-+              char modulename[EBT_FUNCTION_MAXNAMELEN + strlen(prefix) + 1];
-+              strcpy(modulename, prefix);
-+              strcat(modulename, name);
-+              request_module(modulename);
-+              ret = find_inlist_lock_noload(head, name, error, mutex);
-+      }
-+      return ret;
-+}
-+#endif
-+
-+static inline struct ebt_table *
-+find_table_lock(const char *name, int *error, struct semaphore *mutex)
-+{
-+      return find_inlist_lock(&ebt_tables, name, "ebtable_", error, mutex);
-+}
-+
-+static inline struct ebt_match *
-+find_match_lock(const char *name, int *error, struct semaphore *mutex)
-+{
-+      return find_inlist_lock(&ebt_matches, name, "ebt_", error, mutex);
-+}
-+
-+static inline struct ebt_watcher *
-+find_watcher_lock(const char *name, int *error, struct semaphore *mutex)
-+{
-+      return find_inlist_lock(&ebt_watchers, name, "ebt_", error, mutex);
-+}
-+
-+static inline struct ebt_target *
-+find_target_lock(const char *name, int *error, struct semaphore *mutex)
-+{
-+      return find_inlist_lock(&ebt_targets, name, "ebt_", error, mutex);</