OPTIMIZE_FOR_CPU=$(ARCH)
-# directory used by 'make publish'
-PUB_DIR:=/var/www/html/testsite/ipkg
-
# Command used to download source code
WGET:=wget --passive-ftp
TARGET_CC=$(TARGET_CROSS)gcc
STRIP=$(TARGET_CROSS)strip --remove-section=.comment --remove-section=.note
-
HOST_ARCH:=$(shell $(HOSTCC) -dumpmachine | sed -e s'/-.*//' \
-e 's/sparc.*/sparc/' \
-e 's/arm.*/arm/g' \
PACKAGES_IPK:=$(patsubst %,%-ipk,$(PACKAGES))
OPENWRT_IPK_DIR=$(SOURCE_DIR)/openwrt/ipkg
-$(BUILD_DIR)/Packages : $(PACKAGES_IPK)
- (cd $(BUILD_DIR) ; $(IPKG_MAKE_INDEX) . > Packages)
-
world: $(DL_DIR) $(TARGETS_SOURCE) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) $(TARGETS)
@echo "ALL DONE."
-packages: ipkg-utils $(PACKAGES_IPK) $(BUILD_DIR)/Packages
+packages: ipkg-utils $(PACKAGES_IPK)
+ -@mkdir -p $(BASE_DIR)/packages
+ cd $(BASE_DIR)/packages
+ -mv $(BUILD_DIR)/*.ipk .
+ $(IPKG_MAKE_INDEX) . > Packages
@echo "ALL DONE."
.PHONY: all world clean dirclean distclean source $(TARGETS) \
#############################################################
clean:
rm -rf $(TOOL_BUILD_DIR) $(BUILD_DIR) $(IMAGE) \
+ $(BASE_DIR)/packages \
openwrt-linux.trx openwrt-g-code.bin openwrt-gs-code.bin \
openwrt-kmodules.tar.bz2
dirclean: $(TARGETS_DIRCLEAN)
rm -rf $(TARGET_DIR) $(STAGING_DIR) $(IMAGE) \
+ $(BASE_DIR)/packages \
openwrt-linux.trx openwrt-g-code.bin openwrt-gs-code.bin \
openwrt-kmodules.tar.bz2
openwrt-linux.trx openwrt-g-code.bin openwrt-gs-code.bin \
openwrt-kmodules.tar.bz2
-publish:
- chmod 644 $(BUILD_DIR)/Packages
- chmod 644 $(BUILD_DIR)/Packages.filelist
- chmod 644 $(BUILD_DIR)/*.ipk
- cp $(BUILD_DIR)/Packages $(PUB_DIR)
- cp $(BUILD_DIR)/Packages.filelist $(PUB_DIR)
- cp $(BUILD_DIR)/*.ipk $(PUB_DIR)
-
sourceball:
rm -rf $(BUILD_DIR)
set -e; \
$(MAKE) $(JLEVEL) -C $(BINUTILS_DIR1) install
binutils-dependancies:
- @if [ ! -x /usr/bin/bison ] ; then \
+ @if [ -z "`which bison`" ] ; then \
echo -e "\n\nYou must install 'bison' on your build machine\n"; \
exit 1; \
fi;
- @if [ ! -x /usr/bin/flex ] ; then \
+ @if [ -z "`which flex`" ] ; then \
echo -e "\n\nYou must install 'flex' on your build machine\n"; \
exit 1; \
fi;
- @if [ ! -x /usr/bin/msgfmt ] ; then \
+ @if [ -z "`which msgfmt`" ] ; then \
echo -e "\n\nYou must install 'gettext' on your build machine\n"; \
exit 1; \
fi;
IPKG_BUILDPACKAGE := PATH=$(TARGET_PATH) ipkg-buildpackage -c -o root -g root
+IPKG_BUILD := PATH=$(TARGET_PATH) ipkg-build -c -o root -g root
IPKG_MAKE_INDEX := PATH=$(TARGET_PATH) ipkg-make-index
cp $(OPENSSH_IPK_BUILD_DIR)/usr/sbin/sshd $(OPENSSH_IPK_BUILD_DIR)/build/usr/sbin
mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
cp $(OPENSSH_IPK_BUILD_DIR)/usr/bin/ssh-keygen $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
- cd $(BUILD_DIR); $(STAGING_DIR)/bin/ipkg-build -c -o root -g root $(OPENSSH_IPK_BUILD_DIR)/build
+ cd $(BUILD_DIR); $(IPKG_BUILD) $(OPENSSH_IPK_BUILD_DIR)/build
rm -rf $(OPENSSH_IPK_BUILD_DIR)/build
$(OPENSSH_CLIENT_IPK): $(OPENSSH_IPK_BUILD_DIR)/usr/bin/ssh
mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
cp $(OPENSSH_IPK_BUILD_DIR)/usr/bin/ssh $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
cp $(OPENSSH_IPK_BUILD_DIR)/usr/bin/scp $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
- cd $(BUILD_DIR); $(STAGING_DIR)/bin/ipkg-build -c -o root -g root $(OPENSSH_IPK_BUILD_DIR)/build
+ cd $(BUILD_DIR); $(IPKG_BUILD) $(OPENSSH_IPK_BUILD_DIR)/build
rm -rf $(OPENSSH_IPK_BUILD_DIR)/build
$(OPENSSH_SFTP_SERVER_IPK): $(OPENSSH_IPK_BUILD_DIR)/usr/bin/ssh
cp $(OPENSSH_IPK_DIR)/openssh.sftp-server.control $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL/control
mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/usr/sbin
cp $(OPENSSH_IPK_BUILD_DIR)/usr/sbin/sftp-server $(OPENSSH_IPK_BUILD_DIR)/build/usr/sbin
- cd $(BUILD_DIR); $(STAGING_DIR)/bin/ipkg-build -c -o root -g root $(OPENSSH_IPK_BUILD_DIR)/build
+ cd $(BUILD_DIR); $(IPKG_BUILD) $(OPENSSH_IPK_BUILD_DIR)/build
rm -rf $(OPENSSH_IPK_BUILD_DIR)/build
$(OPENSSH_SFTP_CLIENT_IPK): $(OPENSSH_IPK_BUILD_DIR)/usr/bin/ssh
cp $(OPENSSH_IPK_DIR)/openssh.sftp-client.control $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL/control
mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
cp $(OPENSSH_IPK_BUILD_DIR)/usr/bin/sftp $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
- cd $(BUILD_DIR); $(STAGING_DIR)/bin/ipkg-build -c -o root -g root $(OPENSSH_IPK_BUILD_DIR)/build
+ cd $(BUILD_DIR); $(IPKG_BUILD) $(OPENSSH_IPK_BUILD_DIR)/build
rm -rf $(OPENSSH_IPK_BUILD_DIR)/build
$(OPENSSH_CLIENT_EX_IPK): $(OPENSSH_IPK_BUILD_DIR)/usr/bin/ssh
cp $(OPENSSH_IPK_BUILD_DIR)/usr/bin/ssh-keyscan $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/usr/sbin
cp $(OPENSSH_IPK_BUILD_DIR)/usr/sbin/ssh-keysign $(OPENSSH_IPK_BUILD_DIR)/build/usr/sbin
- cd $(BUILD_DIR); $(STAGING_DIR)/bin/ipkg-build -c -o root -g root $(OPENSSH_IPK_BUILD_DIR)/build
+ cd $(BUILD_DIR); $(IPKG_BUILD) $(OPENSSH_IPK_BUILD_DIR)/build
rm -rf $(OPENSSH_IPK_BUILD_DIR)/build
openssh-ipk: $(OPENSSH_SERVER_IPK) $(OPENSSH_CLIENT_IPK) \
cp -fa $(STAGING_DIR)/lib/libssl.so* $(OPENSSL_IPK_BUILD_DIR)/usr/lib/
-$(STRIP) --strip-unneeded $(OPENSSL_IPK_BUILD_DIR)/usr/lib/libssl.so.0.9.7
-$(STRIP) --strip-unneeded $(OPENSSL_IPK_BUILD_DIR)/usr/lib/libcrypto.so.0.9.7
- cd $(BUILD_DIR); $(STAGING_DIR)/bin/ipkg-build -c -o root -g root $(OPENSSL_IPK_BUILD_DIR)
+ cd $(BUILD_DIR); $(IPKG_BUILD) $(OPENSSL_IPK_BUILD_DIR)
openssl-ipk: $(LIBSSL_IPK)
touch $(LINUX_DIR)/.unpacked
$(LINUX_DIR)/.patched: $(WRT54G_DIR)/.prepared
- $(SOURCE_DIR)/patch-kernel.sh $(LINUX_DIR)/../.. $(SOURCE_DIR)/openwrt/kernel/patches
+ $(SOURCE_DIR)/patch-kernel.sh $(LINUX_DIR) $(SOURCE_DIR)/openwrt/kernel/patches
# use replacement diag module code
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
openwrt-kmodules.tar.bz2: $(LINUX_DIR)/$(LINUX_BINLOC)
$(MAKE) -C $(LINUX_DIR) modules
- $(MAKE) -C $(LINUX_DIR) DEPMOD=/bin/true \
+ $(MAKE) -C $(LINUX_DIR) DEPMOD=true \
INSTALL_MOD_PATH=$(LINUX_DIR)/modules modules_install
tar -C $(LINUX_DIR)/modules/lib -cjf openwrt-kmodules.tar.bz2 modules
######################################################################
-openwrt-prune: openwrt-base
- -@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIP) 2>/dev/null || true;
+openwrt-prune: $(STAGING_DIR)/bin/sstrip openwrt-base
+ -@find $(TARGET_DIR) -type f -perm +111 | xargs $(STAGING_DIR)/bin/sstrip 2>/dev/null || true;
# remove unneeded uClibc libs
rm -rf $(TARGET_DIR)/lib/libthread_db*
rm -rf $(TARGET_DIR)/lib/libpthread*
######################################################################
+$(STAGING_DIR)/bin/sstrip:
+ $(CC) -o $(STAGING_DIR)/bin/sstrip -I$(STAGING_DIR)/mipsel-linux-uclibc/include $(SOURCE_DIR)/openwrt/tools/sstrip.c
+
wrt-tools:
$(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
# build the ipk package
$(PPPOECD_PACKAGE): $(PPPOECD_IPK_BIN) $(PPPOECD_IPK_BUILD_DIR)/CONTROL/control
- cd $(BUILD_DIR); $(STAGING_DIR)/bin/ipkg-build -c -o root -g root $(PPPOECD_IPK_BUILD_DIR)
+ cd $(BUILD_DIR); $(IPKG_BUILD) $(PPPOECD_IPK_BUILD_DIR)
# main target for building the ipk version
pppoecd-ipk: $(PPPOECD_PACKAGE)
cp -dpf $(STAGING_DIR)/lib/libz.so* $(ZLIB_IPK_DIR)/lib;
-$(STRIP) --strip-unneeded $(ZLIB_IPK_DIR)/lib/libz.so*
touch -c $(ZLIB_IPK_DIR)/lib/libz.so.1.1.4
- cd $(BUILD_DIR); $(STAGING_DIR)/bin/ipkg-build -c -o root -g root $(ZLIB_IPK_DIR)
+ cd $(ZLIB_IPK_DIR) $(IPKG_BUILDPACKAGE)
zlib-ipk: $(ZLIB_IPK)
#
-# Automatically generated make config: don't edit
+# Automatically generated by make menuconfig: don't edit
#
CONFIG_MIPS=y
CONFIG_MIPS32=y
CONFIG_MTD_PARTITIONS=y
# CONFIG_MTD_CONCAT is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
-
-#
-# User Modules And Translation Layers
-#
CONFIG_MTD_CHAR=y
# CONFIG_MTD_BLOCK is not set
CONFIG_MTD_BLOCK_RO=y
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_BLKMTD is not set
-
-#
-# Disk-On-Chip Device Drivers
-#
# CONFIG_MTD_DOC1000 is not set
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_KHTTPD is not set
# CONFIG_ATM is not set
CONFIG_VLAN_8021Q=y
-
-#
-#
-#
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
CONFIG_PPP=y
# CONFIG_PPP_MULTILINK is not set
# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=y
+CONFIG_PPP_ASYNC=m
# CONFIG_PPP_SYNC_TTY is not set
-CONFIG_PPP_DEFLATE=y
-CONFIG_PPP_BSDCOMP=y
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
CONFIG_PPPOE=m
# CONFIG_SLIP is not set
# Joysticks
#
# CONFIG_INPUT_GAMEPORT is not set
-
-#
-# Input core support is needed for gameports
-#
-
-#
-# Input core support is needed for joysticks
-#
# CONFIG_QIC02_TAPE is not set
#
-diff -Nurb src/linux/linux/include/linux/netfilter_ipv4/ip_conntrack.h src/linux/linux.stock/include/linux/netfilter_ipv4/ip_conntrack.h
---- src/linux/linux/include/linux/netfilter_ipv4/ip_conntrack.h 2003-08-12 07:43:11.000000000 -0400
-+++ src/linux/linux.stock/include/linux/netfilter_ipv4/ip_conntrack.h 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/include/linux/netfilter_ipv4/ip_conntrack.h linux.stock/include/linux/netfilter_ipv4/ip_conntrack.h
+--- linux/include/linux/netfilter_ipv4/ip_conntrack.h 2003-08-12 07:43:11.000000000 -0400
++++ linux.stock/include/linux/netfilter_ipv4/ip_conntrack.h 2004-05-09 04:13:03.000000000 -0400
@@ -45,39 +45,27 @@
#include <linux/netfilter_ipv4/ip_conntrack_tcp.h>
-extern int sysctl_ip_conntrack_udp_timeouts[2];
#endif /* __KERNEL__ */
#endif /* _IP_CONNTRACK_H */
-diff -Nurb src/linux/linux/include/linux/netfilter_ipv4/ip_conntrack_h323.h src/linux/linux.stock/include/linux/netfilter_ipv4/ip_conntrack_h323.h
---- src/linux/linux/include/linux/netfilter_ipv4/ip_conntrack_h323.h 2003-07-04 04:12:27.000000000 -0400
-+++ src/linux/linux.stock/include/linux/netfilter_ipv4/ip_conntrack_h323.h 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/include/linux/netfilter_ipv4/ip_conntrack_h323.h linux.stock/include/linux/netfilter_ipv4/ip_conntrack_h323.h
+--- linux/include/linux/netfilter_ipv4/ip_conntrack_h323.h 2003-07-04 04:12:27.000000000 -0400
++++ linux.stock/include/linux/netfilter_ipv4/ip_conntrack_h323.h 1969-12-31 19:00:00.000000000 -0500
@@ -1,30 +0,0 @@
-#ifndef _IP_CONNTRACK_H323_H
-#define _IP_CONNTRACK_H323_H
-};
-
-#endif /* _IP_CONNTRACK_H323_H */
-diff -Nurb src/linux/linux/include/linux/netfilter_ipv4/ip_conntrack_mms.h src/linux/linux.stock/include/linux/netfilter_ipv4/ip_conntrack_mms.h
---- src/linux/linux/include/linux/netfilter_ipv4/ip_conntrack_mms.h 2003-07-04 04:12:27.000000000 -0400
-+++ src/linux/linux.stock/include/linux/netfilter_ipv4/ip_conntrack_mms.h 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/include/linux/netfilter_ipv4/ip_conntrack_mms.h linux.stock/include/linux/netfilter_ipv4/ip_conntrack_mms.h
+--- linux/include/linux/netfilter_ipv4/ip_conntrack_mms.h 2003-07-04 04:12:27.000000000 -0400
++++ linux.stock/include/linux/netfilter_ipv4/ip_conntrack_mms.h 1969-12-31 19:00:00.000000000 -0500
@@ -1,31 +0,0 @@
-#ifndef _IP_CONNTRACK_MMS_H
-#define _IP_CONNTRACK_MMS_H
-};
-
-#endif /* _IP_CONNTRACK_MMS_H */
-diff -Nurb src/linux/linux/include/linux/netfilter_ipv4/ip_conntrack_pptp.h src/linux/linux.stock/include/linux/netfilter_ipv4/ip_conntrack_pptp.h
---- src/linux/linux/include/linux/netfilter_ipv4/ip_conntrack_pptp.h 2003-07-04 04:12:27.000000000 -0400
-+++ src/linux/linux.stock/include/linux/netfilter_ipv4/ip_conntrack_pptp.h 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/include/linux/netfilter_ipv4/ip_conntrack_pptp.h linux.stock/include/linux/netfilter_ipv4/ip_conntrack_pptp.h
+--- linux/include/linux/netfilter_ipv4/ip_conntrack_pptp.h 2003-07-04 04:12:27.000000000 -0400
++++ linux.stock/include/linux/netfilter_ipv4/ip_conntrack_pptp.h 1969-12-31 19:00:00.000000000 -0500
@@ -1,313 +0,0 @@
-/* PPTP constants and structs */
-#ifndef _CONNTRACK_PPTP_H
-
-#endif /* __KERNEL__ */
-#endif /* _CONNTRACK_PPTP_H */
-diff -Nurb src/linux/linux/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h src/linux/linux.stock/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h
---- src/linux/linux/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h 2003-07-04 04:12:27.000000000 -0400
-+++ src/linux/linux.stock/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h linux.stock/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h
+--- linux/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h 2003-07-04 04:12:27.000000000 -0400
++++ linux.stock/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h 1969-12-31 19:00:00.000000000 -0500
@@ -1,121 +0,0 @@
-#ifndef _CONNTRACK_PROTO_GRE_H
-#define _CONNTRACK_PROTO_GRE_H
-#endif /* __KERNEL__ */
-
-#endif /* _CONNTRACK_PROTO_GRE_H */
-diff -Nurb src/linux/linux/include/linux/netfilter_ipv4/ip_conntrack_tftp.h src/linux/linux.stock/include/linux/netfilter_ipv4/ip_conntrack_tftp.h
---- src/linux/linux/include/linux/netfilter_ipv4/ip_conntrack_tftp.h 2003-07-04 04:12:27.000000000 -0400
-+++ src/linux/linux.stock/include/linux/netfilter_ipv4/ip_conntrack_tftp.h 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/include/linux/netfilter_ipv4/ip_conntrack_tftp.h linux.stock/include/linux/netfilter_ipv4/ip_conntrack_tftp.h
+--- linux/include/linux/netfilter_ipv4/ip_conntrack_tftp.h 2003-07-04 04:12:27.000000000 -0400
++++ linux.stock/include/linux/netfilter_ipv4/ip_conntrack_tftp.h 1969-12-31 19:00:00.000000000 -0500
@@ -1,13 +0,0 @@
-#ifndef _IP_CT_TFTP
-#define _IP_CT_TFTP
-#define TFTP_OPCODE_WRITE 2
-
-#endif /* _IP_CT_TFTP */
-diff -Nurb src/linux/linux/include/linux/netfilter_ipv4/ip_conntrack_tuple.h src/linux/linux.stock/include/linux/netfilter_ipv4/ip_conntrack_tuple.h
---- src/linux/linux/include/linux/netfilter_ipv4/ip_conntrack_tuple.h 2003-07-04 04:12:27.000000000 -0400
-+++ src/linux/linux.stock/include/linux/netfilter_ipv4/ip_conntrack_tuple.h 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/include/linux/netfilter_ipv4/ip_conntrack_tuple.h linux.stock/include/linux/netfilter_ipv4/ip_conntrack_tuple.h
+--- linux/include/linux/netfilter_ipv4/ip_conntrack_tuple.h 2003-07-04 04:12:27.000000000 -0400
++++ linux.stock/include/linux/netfilter_ipv4/ip_conntrack_tuple.h 2004-05-09 04:13:03.000000000 -0400
@@ -14,7 +14,7 @@
union ip_conntrack_manip_proto
{
#define CTINFO2DIR(ctinfo) ((ctinfo) >= IP_CT_IS_REPLY ? IP_CT_DIR_REPLY : IP_CT_DIR_ORIGINAL)
-diff -Nurb src/linux/linux/include/linux/netfilter_ipv4/ip_nat_pptp.h src/linux/linux.stock/include/linux/netfilter_ipv4/ip_nat_pptp.h
---- src/linux/linux/include/linux/netfilter_ipv4/ip_nat_pptp.h 2003-07-04 04:12:27.000000000 -0400
-+++ src/linux/linux.stock/include/linux/netfilter_ipv4/ip_nat_pptp.h 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/include/linux/netfilter_ipv4/ip_nat_pptp.h linux.stock/include/linux/netfilter_ipv4/ip_nat_pptp.h
+--- linux/include/linux/netfilter_ipv4/ip_nat_pptp.h 2003-07-04 04:12:27.000000000 -0400
++++ linux.stock/include/linux/netfilter_ipv4/ip_nat_pptp.h 1969-12-31 19:00:00.000000000 -0500
@@ -1,11 +0,0 @@
-/* PPTP constants and structs */
-#ifndef _NAT_PPTP_H
-};
-
-#endif /* _NAT_PPTP_H */
-diff -Nurb src/linux/linux/include/linux/netfilter_ipv4/ip_pool.h src/linux/linux.stock/include/linux/netfilter_ipv4/ip_pool.h
---- src/linux/linux/include/linux/netfilter_ipv4/ip_pool.h 2003-07-04 04:12:27.000000000 -0400
-+++ src/linux/linux.stock/include/linux/netfilter_ipv4/ip_pool.h 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/include/linux/netfilter_ipv4/ip_pool.h linux.stock/include/linux/netfilter_ipv4/ip_pool.h
+--- linux/include/linux/netfilter_ipv4/ip_pool.h 2003-07-04 04:12:27.000000000 -0400
++++ linux.stock/include/linux/netfilter_ipv4/ip_pool.h 1969-12-31 19:00:00.000000000 -0500
@@ -1,64 +0,0 @@
-#ifndef _IP_POOL_H
-#define _IP_POOL_H
-#endif
-
-#endif /*_IP_POOL_H*/
-diff -Nurb src/linux/linux/include/linux/netfilter_ipv4/ipt_pool.h src/linux/linux.stock/include/linux/netfilter_ipv4/ipt_pool.h
---- src/linux/linux/include/linux/netfilter_ipv4/ipt_pool.h 2003-07-04 04:12:27.000000000 -0400
-+++ src/linux/linux.stock/include/linux/netfilter_ipv4/ipt_pool.h 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/include/linux/netfilter_ipv4/ipt_pool.h linux.stock/include/linux/netfilter_ipv4/ipt_pool.h
+--- linux/include/linux/netfilter_ipv4/ipt_pool.h 2003-07-04 04:12:27.000000000 -0400
++++ linux.stock/include/linux/netfilter_ipv4/ipt_pool.h 1969-12-31 19:00:00.000000000 -0500
@@ -1,25 +0,0 @@
-#ifndef _IPT_POOL_H
-#define _IPT_POOL_H
-};
-
-#endif /*_IPT_POOL_H*/
-diff -Nurb src/linux/linux/net/ipv4/netfilter/Config.in src/linux/linux.stock/net/ipv4/netfilter/Config.in
---- src/linux/linux/net/ipv4/netfilter/Config.in 2004-02-19 06:04:35.000000000 -0500
-+++ src/linux/linux.stock/net/ipv4/netfilter/Config.in 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/net/ipv4/netfilter/Config.in linux.stock/net/ipv4/netfilter/Config.in
+--- linux/net/ipv4/netfilter/Config.in 2004-02-19 06:04:35.000000000 -0500
++++ linux.stock/net/ipv4/netfilter/Config.in 2004-05-09 04:13:03.000000000 -0400
@@ -7,12 +7,7 @@
tristate 'Connection tracking (required for masq/NAT)' CONFIG_IP_NF_CONNTRACK
if [ "$CONFIG_IP_NF_CONNTRACK" != "n" ]; then
fi
fi
-diff -Nurb src/linux/linux/net/ipv4/netfilter/Makefile src/linux/linux.stock/net/ipv4/netfilter/Makefile
---- src/linux/linux/net/ipv4/netfilter/Makefile 2004-02-19 06:04:35.000000000 -0500
-+++ src/linux/linux.stock/net/ipv4/netfilter/Makefile 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/net/ipv4/netfilter/Makefile linux.stock/net/ipv4/netfilter/Makefile
+--- linux/net/ipv4/netfilter/Makefile 2004-02-19 06:04:35.000000000 -0500
++++ linux.stock/net/ipv4/netfilter/Makefile 2004-05-09 04:13:03.000000000 -0400
@@ -31,48 +31,20 @@
# connection tracking
obj-$(CONFIG_IP_NF_CONNTRACK) += ip_conntrack.o
# generic ARP tables
obj-$(CONFIG_IP_NF_ARPTABLES) += arp_tables.o
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_conntrack_core.c src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_core.c
---- src/linux/linux/net/ipv4/netfilter/ip_conntrack_core.c 2003-08-12 07:33:45.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_core.c 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_core.c linux.stock/net/ipv4/netfilter/ip_conntrack_core.c
+--- linux/net/ipv4/netfilter/ip_conntrack_core.c 2003-08-12 07:33:45.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_conntrack_core.c 2004-05-09 04:13:03.000000000 -0400
@@ -47,7 +47,11 @@
#define IP_CONNTRACK_VERSION "2.1"
{ 0 }
};
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_conntrack_ftp.c src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_ftp.c
---- src/linux/linux/net/ipv4/netfilter/ip_conntrack_ftp.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_ftp.c 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_ftp.c linux.stock/net/ipv4/netfilter/ip_conntrack_ftp.c
+--- linux/net/ipv4/netfilter/ip_conntrack_ftp.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_conntrack_ftp.c 2004-05-09 04:13:03.000000000 -0400
@@ -24,7 +24,11 @@
static int loose = 0;
MODULE_PARM(loose, "i");
if (tcp_v4_check(tcph, tcplen, iph->saddr, iph->daddr,
csum_partial((char *)tcph, tcplen, 0))) {
DEBUGP("ftp_help: bad csum: %p %u %u.%u.%u.%u %u.%u.%u.%u\n",
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_conntrack_h323.c src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_h323.c
---- src/linux/linux/net/ipv4/netfilter/ip_conntrack_h323.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_h323.c 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_h323.c linux.stock/net/ipv4/netfilter/ip_conntrack_h323.c
+--- linux/net/ipv4/netfilter/ip_conntrack_h323.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_conntrack_h323.c 1969-12-31 19:00:00.000000000 -0500
@@ -1,302 +0,0 @@
-/*
- * H.323 'brute force' extension for H.323 connection tracking.
-
-module_init(init);
-module_exit(fini);
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_conntrack_mms.c src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_mms.c
---- src/linux/linux/net/ipv4/netfilter/ip_conntrack_mms.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_mms.c 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_mms.c linux.stock/net/ipv4/netfilter/ip_conntrack_mms.c
+--- linux/net/ipv4/netfilter/ip_conntrack_mms.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_conntrack_mms.c 1969-12-31 19:00:00.000000000 -0500
@@ -1,292 +0,0 @@
-/* MMS extension for IP connection tracking
- * (C) 2002 by Filip Sneppe <filip.sneppe@cronos.be>
-
-module_init(init);
-module_exit(fini);
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_conntrack_pptp.c src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_pptp.c
---- src/linux/linux/net/ipv4/netfilter/ip_conntrack_pptp.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_pptp.c 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_pptp.c linux.stock/net/ipv4/netfilter/ip_conntrack_pptp.c
+--- linux/net/ipv4/netfilter/ip_conntrack_pptp.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_conntrack_pptp.c 1969-12-31 19:00:00.000000000 -0500
@@ -1,531 +0,0 @@
-/*
- * ip_conntrack_pptp.c - Version 1.11
-module_exit(fini);
-
-EXPORT_SYMBOL(ip_pptp_lock);
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_conntrack_pptp_priv.h src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_pptp_priv.h
---- src/linux/linux/net/ipv4/netfilter/ip_conntrack_pptp_priv.h 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_pptp_priv.h 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_pptp_priv.h linux.stock/net/ipv4/netfilter/ip_conntrack_pptp_priv.h
+--- linux/net/ipv4/netfilter/ip_conntrack_pptp_priv.h 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_conntrack_pptp_priv.h 1969-12-31 19:00:00.000000000 -0500
@@ -1,24 +0,0 @@
-#ifndef _IP_CT_PPTP_PRIV_H
-#define _IP_CT_PPTP_PRIV_H
-};
-
-#endif
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_conntrack_proto_gre.c src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_proto_gre.c
---- src/linux/linux/net/ipv4/netfilter/ip_conntrack_proto_gre.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_proto_gre.c 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_proto_gre.c linux.stock/net/ipv4/netfilter/ip_conntrack_proto_gre.c
+--- linux/net/ipv4/netfilter/ip_conntrack_proto_gre.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_conntrack_proto_gre.c 1969-12-31 19:00:00.000000000 -0500
@@ -1,320 +0,0 @@
-/*
- * ip_conntrack_proto_gre.c - Version 1.11
-
-module_init(init);
-module_exit(fini);
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_conntrack_proto_tcp.c src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
---- src/linux/linux/net/ipv4/netfilter/ip_conntrack_proto_tcp.c 2003-08-12 07:33:45.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_proto_tcp.c 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_proto_tcp.c linux.stock/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
+--- linux/net/ipv4/netfilter/ip_conntrack_proto_tcp.c 2003-08-12 07:33:45.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_conntrack_proto_tcp.c 2004-05-09 04:13:03.000000000 -0400
@@ -15,11 +15,17 @@
#include <linux/netfilter_ipv4/ip_conntrack_protocol.h>
#include <linux/netfilter_ipv4/lockhelp.h>
}
return NF_ACCEPT;
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_conntrack_proto_udp.c src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_proto_udp.c
---- src/linux/linux/net/ipv4/netfilter/ip_conntrack_proto_udp.c 2003-08-12 07:33:45.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_proto_udp.c 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_proto_udp.c linux.stock/net/ipv4/netfilter/ip_conntrack_proto_udp.c
+--- linux/net/ipv4/netfilter/ip_conntrack_proto_udp.c 2003-08-12 07:33:45.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_conntrack_proto_udp.c 2004-05-09 04:13:03.000000000 -0400
@@ -5,7 +5,9 @@
#include <linux/in.h>
#include <linux/udp.h>
return NF_ACCEPT;
}
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_conntrack_standalone.c src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_standalone.c
---- src/linux/linux/net/ipv4/netfilter/ip_conntrack_standalone.c 2003-08-12 07:33:45.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_standalone.c 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_standalone.c linux.stock/net/ipv4/netfilter/ip_conntrack_standalone.c
+--- linux/net/ipv4/netfilter/ip_conntrack_standalone.c 2003-08-12 07:33:45.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_conntrack_standalone.c 2004-05-09 04:13:03.000000000 -0400
@@ -27,7 +27,11 @@
#include <linux/netfilter_ipv4/ip_conntrack_helper.h>
#include <linux/netfilter_ipv4/listhelp.h>
EXPORT_SYMBOL(ip_conntrack_expect_related);
EXPORT_SYMBOL(ip_conntrack_change_expect);
EXPORT_SYMBOL(ip_conntrack_unexpect_related);
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_conntrack_tftp.c src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_tftp.c
---- src/linux/linux/net/ipv4/netfilter/ip_conntrack_tftp.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_conntrack_tftp.c 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_tftp.c linux.stock/net/ipv4/netfilter/ip_conntrack_tftp.c
+--- linux/net/ipv4/netfilter/ip_conntrack_tftp.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_conntrack_tftp.c 1969-12-31 19:00:00.000000000 -0500
@@ -1,126 +0,0 @@
-/*
- * Licensed under GNU GPL version 2 Copyright Magnus Boden <mb@ozaba.mine.nu>
-
-module_init(init);
-module_exit(fini);
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_nat_core.c src/linux/linux.stock/net/ipv4/netfilter/ip_nat_core.c
---- src/linux/linux/net/ipv4/netfilter/ip_nat_core.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_nat_core.c 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/net/ipv4/netfilter/ip_nat_core.c linux.stock/net/ipv4/netfilter/ip_nat_core.c
+--- linux/net/ipv4/netfilter/ip_nat_core.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_nat_core.c 2004-05-09 04:13:03.000000000 -0400
@@ -31,7 +31,11 @@
#include <linux/netfilter_ipv4/ip_conntrack_helper.h>
#include <linux/netfilter_ipv4/listhelp.h>
IP_NF_ASSERT(ip_conntrack_destroyed == NULL);
ip_conntrack_destroyed = &ip_nat_cleanup_conntrack;
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_nat_h323.c src/linux/linux.stock/net/ipv4/netfilter/ip_nat_h323.c
---- src/linux/linux/net/ipv4/netfilter/ip_nat_h323.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_nat_h323.c 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/net/ipv4/netfilter/ip_nat_h323.c linux.stock/net/ipv4/netfilter/ip_nat_h323.c
+--- linux/net/ipv4/netfilter/ip_nat_h323.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_nat_h323.c 1969-12-31 19:00:00.000000000 -0500
@@ -1,403 +0,0 @@
-/*
- * H.323 'brute force' extension for NAT alteration.
-
-module_init(init);
-module_exit(fini);
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_nat_helper.c src/linux/linux.stock/net/ipv4/netfilter/ip_nat_helper.c
---- src/linux/linux/net/ipv4/netfilter/ip_nat_helper.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_nat_helper.c 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/net/ipv4/netfilter/ip_nat_helper.c linux.stock/net/ipv4/netfilter/ip_nat_helper.c
+--- linux/net/ipv4/netfilter/ip_nat_helper.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_nat_helper.c 2004-05-09 04:13:03.000000000 -0400
@@ -8,9 +8,6 @@
* - add support for SACK adjustment
* 14 Mar 2002 Harald Welte <laforge@gnumonks.org>:
/* Adjust one found SACK option including checksum correction */
static void
sack_adjust(struct tcphdr *tcph,
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_nat_mms.c src/linux/linux.stock/net/ipv4/netfilter/ip_nat_mms.c
---- src/linux/linux/net/ipv4/netfilter/ip_nat_mms.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_nat_mms.c 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/net/ipv4/netfilter/ip_nat_mms.c linux.stock/net/ipv4/netfilter/ip_nat_mms.c
+--- linux/net/ipv4/netfilter/ip_nat_mms.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_nat_mms.c 1969-12-31 19:00:00.000000000 -0500
@@ -1,330 +0,0 @@
-/* MMS extension for TCP NAT alteration.
- * (C) 2002 by Filip Sneppe <filip.sneppe@cronos.be>
-
-module_init(init);
-module_exit(fini);
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_nat_pptp.c src/linux/linux.stock/net/ipv4/netfilter/ip_nat_pptp.c
---- src/linux/linux/net/ipv4/netfilter/ip_nat_pptp.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_nat_pptp.c 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/net/ipv4/netfilter/ip_nat_pptp.c linux.stock/net/ipv4/netfilter/ip_nat_pptp.c
+--- linux/net/ipv4/netfilter/ip_nat_pptp.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_nat_pptp.c 1969-12-31 19:00:00.000000000 -0500
@@ -1,412 +0,0 @@
-/*
- * ip_nat_pptp.c - Version 1.11
-
-module_init(init);
-module_exit(fini);
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_nat_proto_gre.c src/linux/linux.stock/net/ipv4/netfilter/ip_nat_proto_gre.c
---- src/linux/linux/net/ipv4/netfilter/ip_nat_proto_gre.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_nat_proto_gre.c 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/net/ipv4/netfilter/ip_nat_proto_gre.c linux.stock/net/ipv4/netfilter/ip_nat_proto_gre.c
+--- linux/net/ipv4/netfilter/ip_nat_proto_gre.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_nat_proto_gre.c 1969-12-31 19:00:00.000000000 -0500
@@ -1,212 +0,0 @@
-/*
- * ip_nat_proto_gre.c - Version 1.11
-
-module_init(init);
-module_exit(fini);
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_nat_standalone.c src/linux/linux.stock/net/ipv4/netfilter/ip_nat_standalone.c
---- src/linux/linux/net/ipv4/netfilter/ip_nat_standalone.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_nat_standalone.c 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/net/ipv4/netfilter/ip_nat_standalone.c linux.stock/net/ipv4/netfilter/ip_nat_standalone.c
+--- linux/net/ipv4/netfilter/ip_nat_standalone.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_nat_standalone.c 2004-05-09 04:13:03.000000000 -0400
@@ -37,7 +37,11 @@
#include <linux/netfilter_ipv4/ip_conntrack_core.h>
#include <linux/netfilter_ipv4/listhelp.h>
-EXPORT_SYMBOL(ip_nat_mangle_udp_packet);
EXPORT_SYMBOL(ip_nat_used_tuple);
MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_nat_tftp.c src/linux/linux.stock/net/ipv4/netfilter/ip_nat_tftp.c
---- src/linux/linux/net/ipv4/netfilter/ip_nat_tftp.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_nat_tftp.c 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/net/ipv4/netfilter/ip_nat_tftp.c linux.stock/net/ipv4/netfilter/ip_nat_tftp.c
+--- linux/net/ipv4/netfilter/ip_nat_tftp.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_nat_tftp.c 1969-12-31 19:00:00.000000000 -0500
@@ -1,186 +0,0 @@
-/*
- * Licensed under GNU GPL version 2 Copyright Magnus Boden <mb@ozaba.mine.nu>
-
-module_init(init);
-module_exit(fini);
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_pool.c src/linux/linux.stock/net/ipv4/netfilter/ip_pool.c
---- src/linux/linux/net/ipv4/netfilter/ip_pool.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_pool.c 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/net/ipv4/netfilter/ip_pool.c linux.stock/net/ipv4/netfilter/ip_pool.c
+--- linux/net/ipv4/netfilter/ip_pool.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_pool.c 1969-12-31 19:00:00.000000000 -0500
@@ -1,328 +0,0 @@
-/* Kernel module for IP pool management */
-
-
-module_init(init);
-module_exit(fini);
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ip_tables.c src/linux/linux.stock/net/ipv4/netfilter/ip_tables.c
---- src/linux/linux/net/ipv4/netfilter/ip_tables.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ip_tables.c 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/net/ipv4/netfilter/ip_tables.c linux.stock/net/ipv4/netfilter/ip_tables.c
+--- linux/net/ipv4/netfilter/ip_tables.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ip_tables.c 2004-05-09 04:13:03.000000000 -0400
@@ -62,6 +62,11 @@
#include <linux/netfilter_ipv4/lockhelp.h>
#include <linux/netfilter_ipv4/listhelp.h>
#endif
}
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ipchains_core.c src/linux/linux.stock/net/ipv4/netfilter/ipchains_core.c
---- src/linux/linux/net/ipv4/netfilter/ipchains_core.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ipchains_core.c 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/net/ipv4/netfilter/ipchains_core.c linux.stock/net/ipv4/netfilter/ipchains_core.c
+--- linux/net/ipv4/netfilter/ipchains_core.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ipchains_core.c 2004-05-09 04:13:03.000000000 -0400
@@ -977,10 +977,17 @@
|| ftmp->ipfw.fw_dst.s_addr!=frwl->ipfw.fw_dst.s_addr
|| ftmp->ipfw.fw_smsk.s_addr!=frwl->ipfw.fw_smsk.s_addr
int reset = 0;
#endif
struct ip_chain *i;
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ipfwadm_core.c src/linux/linux.stock/net/ipv4/netfilter/ipfwadm_core.c
---- src/linux/linux/net/ipv4/netfilter/ipfwadm_core.c 2003-10-14 04:09:33.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ipfwadm_core.c 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/net/ipv4/netfilter/ipfwadm_core.c linux.stock/net/ipv4/netfilter/ipfwadm_core.c
+--- linux/net/ipv4/netfilter/ipfwadm_core.c 2003-10-14 04:09:33.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ipfwadm_core.c 2004-05-09 04:13:03.000000000 -0400
@@ -20,7 +20,7 @@
* license in recognition of the original copyright.
* -- Alan Cox.
int reset = 0;
#endif
return ip_chain_procinfo(IP_FW_FWD, buffer,start,offset,length,
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ipt_ECN.c src/linux/linux.stock/net/ipv4/netfilter/ipt_ECN.c
---- src/linux/linux/net/ipv4/netfilter/ipt_ECN.c 2003-10-14 04:02:57.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ipt_ECN.c 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/net/ipv4/netfilter/ipt_ECN.c linux.stock/net/ipv4/netfilter/ipt_ECN.c
+--- linux/net/ipv4/netfilter/ipt_ECN.c 2003-10-14 04:02:57.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ipt_ECN.c 2004-05-09 04:13:03.000000000 -0400
@@ -87,8 +87,8 @@
}
tcph->check = csum_fold(csum_partial((char *)diffs,
sizeof(diffs),
tcph->check^0xFFFF));
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ipt_LOG.c src/linux/linux.stock/net/ipv4/netfilter/ipt_LOG.c
---- src/linux/linux/net/ipv4/netfilter/ipt_LOG.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ipt_LOG.c 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/net/ipv4/netfilter/ipt_LOG.c linux.stock/net/ipv4/netfilter/ipt_LOG.c
+--- linux/net/ipv4/netfilter/ipt_LOG.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ipt_LOG.c 2004-05-09 04:13:03.000000000 -0400
@@ -14,11 +14,15 @@
#include <net/route.h>
#include <linux/netfilter_ipv4/ipt_LOG.h>
/* Use lock to serialize, so printks don't overlap */
static spinlock_t log_lock = SPIN_LOCK_UNLOCKED;
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ipt_REJECT.c src/linux/linux.stock/net/ipv4/netfilter/ipt_REJECT.c
---- src/linux/linux/net/ipv4/netfilter/ipt_REJECT.c 2003-07-04 04:12:31.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ipt_REJECT.c 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/net/ipv4/netfilter/ipt_REJECT.c linux.stock/net/ipv4/netfilter/ipt_REJECT.c
+--- linux/net/ipv4/netfilter/ipt_REJECT.c 2003-07-04 04:12:31.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ipt_REJECT.c 2004-05-09 04:13:03.000000000 -0400
@@ -6,8 +6,6 @@
#include <linux/module.h>
#include <linux/skbuff.h>
memcpy(data, skb_in->nh.iph,
length - sizeof(struct iphdr) - sizeof(struct icmphdr));
icmph->checksum = ip_compute_csum((unsigned char *)icmph,
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ipt_ULOG.c src/linux/linux.stock/net/ipv4/netfilter/ipt_ULOG.c
---- src/linux/linux/net/ipv4/netfilter/ipt_ULOG.c 2003-07-04 04:12:32.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ipt_ULOG.c 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/net/ipv4/netfilter/ipt_ULOG.c linux.stock/net/ipv4/netfilter/ipt_ULOG.c
+--- linux/net/ipv4/netfilter/ipt_ULOG.c 2003-07-04 04:12:32.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ipt_ULOG.c 2004-05-09 04:13:03.000000000 -0400
@@ -12,7 +12,6 @@
* module loadtime -HW
* 2002/07/07 remove broken nflog_rcv() function -HW
if (in)
strncpy(pm->indev_name, in->name, sizeof(pm->indev_name));
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ipt_multiport.c src/linux/linux.stock/net/ipv4/netfilter/ipt_multiport.c
---- src/linux/linux/net/ipv4/netfilter/ipt_multiport.c 2003-07-04 04:12:32.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ipt_multiport.c 2004-05-09 04:13:03.000000000 -0400
+diff -Nurb linux/net/ipv4/netfilter/ipt_multiport.c linux.stock/net/ipv4/netfilter/ipt_multiport.c
+--- linux/net/ipv4/netfilter/ipt_multiport.c 2003-07-04 04:12:32.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ipt_multiport.c 2004-05-09 04:13:03.000000000 -0400
@@ -8,7 +8,11 @@
#include <linux/netfilter_ipv4/ipt_multiport.h>
#include <linux/netfilter_ipv4/ip_tables.h>
&& matchsize == IPT_ALIGN(sizeof(struct ipt_multiport))
&& (multiinfo->flags == IPT_MULTIPORT_SOURCE
|| multiinfo->flags == IPT_MULTIPORT_DESTINATION
-diff -Nurb src/linux/linux/net/ipv4/netfilter/ipt_pool.c src/linux/linux.stock/net/ipv4/netfilter/ipt_pool.c
---- src/linux/linux/net/ipv4/netfilter/ipt_pool.c 2003-07-04 04:12:32.000000000 -0400
-+++ src/linux/linux.stock/net/ipv4/netfilter/ipt_pool.c 1969-12-31 19:00:00.000000000 -0500
+diff -Nurb linux/net/ipv4/netfilter/ipt_pool.c linux.stock/net/ipv4/netfilter/ipt_pool.c
+--- linux/net/ipv4/netfilter/ipt_pool.c 2003-07-04 04:12:32.000000000 -0400
++++ linux.stock/net/ipv4/netfilter/ipt_pool.c 1969-12-31 19:00:00.000000000 -0500
@@ -1,71 +0,0 @@
-/* Kernel module to match an IP address pool. */
-
-
-module_init(init);
-module_exit(fini);
-diff -Nurb src/linux/linux/net/ipv6/mcast.c src/linux/linux.stock/net/ipv6/mcast.c
---- src/linux/linux/net/ipv6/mcast.c 2003-10-14 04:09:34.000000000 -0400
-+++ src/linux/linux.stock/net/ipv6/mcast.c 2004-05-09 04:13:22.000000000 -0400
+diff -Nurb linux/net/ipv6/mcast.c linux.stock/net/ipv6/mcast.c
+--- linux/net/ipv6/mcast.c 2003-10-14 04:09:34.000000000 -0400
++++ linux.stock/net/ipv6/mcast.c 2004-05-09 04:13:22.000000000 -0400
@@ -5,7 +5,7 @@
* Authors:
* Pedro Roque <roque@di.fc.ul.pt>
*
* Based on linux/ipv4/igmp.c and linux/ipv4/ip_sockglue.c
*
+--- linux/include/linux/ppp-comp.h 2004-08-16 20:58:32.089851872 -0400
++++ linux.stock/include/linux/ppp-comp.h 2004-08-16 20:59:48.217278744 -0400
+@@ -24,7 +24,7 @@
+ * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
+ * OR MODIFICATIONS.
+ *
+- * $Id: ppp-comp.h,v 1.1.1.4 2003/10/14 08:09:26 sparq Exp $
++ * $Id: ppp-comp.h,v 1.6 1997/11/27 06:04:44 paulus Exp $
+ */
+
+ /*
---- src/linux/linux/net/sched/sch_htb.c 2003-10-14 01:09:35.000000000 -0700
-+++ src/linux/linux.2.4.26/net/sched/sch_htb.c 2004-05-10 00:05:51.000000000 -0700
+--- linux/net/sched/sch_htb.c 2003-10-14 01:09:35.000000000 -0700
++++ linux.2.4.26/net/sched/sch_htb.c 2004-05-10 00:05:51.000000000 -0700
@@ -9,6 +9,8 @@
* Authors: Martin Devera, <devik@cdi.cz>
*
cl->un.leaf.quantum = 200000;
}
if (hopt->quantum)
---- src/linux/linux/include/net/pkt_cls.h 2003-07-04 01:12:28.000000000 -0700
-+++ src/linux/linux.2.4.26/include/net/pkt_cls.h 2004-05-10 22:21:40.000000000 -0700
+--- linux/include/net/pkt_cls.h 2003-07-04 01:12:28.000000000 -0700
++++ linux.2.4.26/include/net/pkt_cls.h 2004-05-10 22:21:40.000000000 -0700
@@ -77,7 +77,11 @@
return -1;
}
-diff -Nurb src/linux/linux.orig/Makefile src/linux/linux/Makefile
---- src/linux/linux.orig/Makefile 2003-10-14 04:00:10.000000000 -0400
-+++ src/linux/linux/Makefile 2004-05-25 21:12:24.000000000 -0400
+diff -Nurb linux.orig/Makefile linux/Makefile
+--- linux.orig/Makefile 2003-10-14 04:00:10.000000000 -0400
++++ linux/Makefile 2004-05-25 21:12:24.000000000 -0400
@@ -17,7 +17,7 @@
FINDHPATH = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net $(HPATH)/math-emu
-fno-strict-aliasing -fno-common
# Turn on -pg to instrument the kernel with calls to mcount().
-diff -Nurb src/linux/linux.orig/arch/mips/brcm-boards/bcm947xx/setup.c src/linux/linux/arch/mips/brcm-boards/bcm947xx/setup.c
---- src/linux/linux.orig/arch/mips/brcm-boards/bcm947xx/setup.c 2003-11-11 09:08:46.000000000 -0500
-+++ src/linux/linux/arch/mips/brcm-boards/bcm947xx/setup.c 2004-05-25 21:12:24.000000000 -0400
+diff -Nurb linux.orig/arch/mips/brcm-boards/bcm947xx/setup.c linux/arch/mips/brcm-boards/bcm947xx/setup.c
+--- linux.orig/arch/mips/brcm-boards/bcm947xx/setup.c 2003-11-11 09:08:46.000000000 -0500
++++ linux/arch/mips/brcm-boards/bcm947xx/setup.c 2004-05-25 21:12:24.000000000 -0400
@@ -27,6 +27,7 @@
#include <linux/ext2_fs.h>
#include <linux/romfs_fs.h>
return bcm947xx_parts;
}
-diff -Nurb src/linux/linux.orig/drivers/mtd/maps/bcm947xx-flash.c src/linux/linux/drivers/mtd/maps/bcm947xx-flash.c
---- src/linux/linux.orig/drivers/mtd/maps/bcm947xx-flash.c 2003-11-08 04:35:52.000000000 -0500
-+++ src/linux/linux/drivers/mtd/maps/bcm947xx-flash.c 2004-05-25 21:12:24.000000000 -0400
+diff -Nurb linux.orig/drivers/mtd/maps/bcm947xx-flash.c linux/drivers/mtd/maps/bcm947xx-flash.c
+--- linux.orig/drivers/mtd/maps/bcm947xx-flash.c 2003-11-08 04:35:52.000000000 -0500
++++ linux/drivers/mtd/maps/bcm947xx-flash.c 2004-05-25 21:12:24.000000000 -0400
@@ -82,7 +82,21 @@
void bcm947xx_map_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
}
void bcm947xx_map_write8(struct map_info *map, __u8 d, unsigned long adr)
-diff -Nurb src/linux/linux.orig/drivers/net/Makefile src/linux/linux/drivers/net/Makefile
---- src/linux/linux.orig/drivers/net/Makefile 2004-02-12 21:35:15.000000000 -0500
-+++ src/linux/linux/drivers/net/Makefile 2004-05-25 21:12:24.000000000 -0400
+diff -Nurb linux.orig/drivers/net/Makefile linux/drivers/net/Makefile
+--- linux.orig/drivers/net/Makefile 2004-02-12 21:35:15.000000000 -0500
++++ linux/drivers/net/Makefile 2004-05-25 21:12:24.000000000 -0400
@@ -25,7 +25,7 @@
list-multi := rcpci.o
rcpci-objs := rcpci45.o rclanmtl.o
subdir-m += diag
ifeq ($(CONFIG_HW_QOS),y)
-diff -Nurb src/linux/linux.orig/fs/Config.in src/linux/linux/fs/Config.in
---- src/linux/linux.orig/fs/Config.in 2003-07-04 04:12:05.000000000 -0400
-+++ src/linux/linux/fs/Config.in 2004-05-25 21:13:03.000000000 -0400
+diff -Nurb linux.orig/fs/Config.in linux/fs/Config.in
+--- linux.orig/fs/Config.in 2003-07-04 04:12:05.000000000 -0400
++++ linux/fs/Config.in 2004-05-25 21:13:03.000000000 -0400
@@ -47,6 +47,7 @@
int 'JFFS2 debugging verbosity (0 = quiet, 2 = noisy)' CONFIG_JFFS2_FS_DEBUG 0
fi
bool 'Virtual memory file system support (former shm fs)' CONFIG_TMPFS
define_bool CONFIG_RAMFS y
-diff -Nurb src/linux/linux.orig/fs/Makefile src/linux/linux/fs/Makefile
---- src/linux/linux.orig/fs/Makefile 2003-07-04 04:12:05.000000000 -0400
-+++ src/linux/linux/fs/Makefile 2004-05-25 21:13:03.000000000 -0400
+diff -Nurb linux.orig/fs/Makefile linux/fs/Makefile
+--- linux.orig/fs/Makefile 2003-07-04 04:12:05.000000000 -0400
++++ linux/fs/Makefile 2004-05-25 21:13:03.000000000 -0400
@@ -68,6 +68,7 @@
subdir-$(CONFIG_SUN_OPENPROMFS) += openpromfs
subdir-$(CONFIG_BEFS_FS) += befs
obj-$(CONFIG_BINFMT_AOUT) += binfmt_aout.o
-diff -Nurb src/linux/linux.orig/fs/squashfs/Makefile src/linux/linux/fs/squashfs/Makefile
---- src/linux/linux.orig/fs/squashfs/Makefile 1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/fs/squashfs/Makefile 2004-05-25 21:13:03.000000000 -0400
+diff -Nurb linux.orig/fs/squashfs/Makefile linux/fs/squashfs/Makefile
+--- linux.orig/fs/squashfs/Makefile 1969-12-31 19:00:00.000000000 -0500
++++ linux/fs/squashfs/Makefile 2004-05-25 21:13:03.000000000 -0400
@@ -0,0 +1,11 @@
+#
+# Makefile for the linux squashfs routines.
+obj-m := $(O_TARGET)
+
+include $(TOPDIR)/Rules.make
-diff -Nurb src/linux/linux.orig/fs/squashfs/inode.c src/linux/linux/fs/squashfs/inode.c
---- src/linux/linux.orig/fs/squashfs/inode.c 1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/fs/squashfs/inode.c 2004-05-25 21:13:03.000000000 -0400
+diff -Nurb linux.orig/fs/squashfs/inode.c linux/fs/squashfs/inode.c
+--- linux.orig/fs/squashfs/inode.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/fs/squashfs/inode.c 2004-05-25 21:13:03.000000000 -0400
@@ -0,0 +1,1515 @@
+/*
+ * Squashfs - a compressed read only filesystem for Linux
+MODULE_DESCRIPTION("squashfs, a compressed read-only filesystem");
+MODULE_AUTHOR("Phillip Lougher <plougher@users.sourceforge.net>");
+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.orig/include/linux/fs.h src/linux/linux/include/linux/fs.h
---- src/linux/linux.orig/include/linux/fs.h 2003-07-04 04:12:25.000000000 -0400
-+++ src/linux/linux/include/linux/fs.h 2004-05-25 21:13:03.000000000 -0400
+diff -Nurb linux.orig/include/linux/fs.h linux/include/linux/fs.h
+--- linux.orig/include/linux/fs.h 2003-07-04 04:12:25.000000000 -0400
++++ linux/include/linux/fs.h 2004-05-25 21:13:03.000000000 -0400
@@ -313,6 +313,7 @@
#include <linux/usbdev_fs_i.h>
#include <linux/jffs2_fs_i.h>
void *generic_sbp;
} u;
/*
-diff -Nurb src/linux/linux.orig/include/linux/squashfs_fs.h src/linux/linux/include/linux/squashfs_fs.h
---- src/linux/linux.orig/include/linux/squashfs_fs.h 1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/squashfs_fs.h 2004-05-25 21:13:03.000000000 -0400
+diff -Nurb linux.orig/include/linux/squashfs_fs.h linux/include/linux/squashfs_fs.h
+--- linux.orig/include/linux/squashfs_fs.h 1969-12-31 19:00:00.000000000 -0500
++++ linux/include/linux/squashfs_fs.h 2004-05-25 21:13:03.000000000 -0400
@@ -0,0 +1,474 @@
+#ifndef SQUASHFS_FS
+#define SQUASHFS_FS
+#define SQUASHFS_MEMSET(s, d, n) memset(s, 0, n);
+#endif
+#endif
-diff -Nurb src/linux/linux.orig/include/linux/squashfs_fs_i.h src/linux/linux/include/linux/squashfs_fs_i.h
---- src/linux/linux.orig/include/linux/squashfs_fs_i.h 1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/squashfs_fs_i.h 2004-05-25 21:13:03.000000000 -0400
+diff -Nurb linux.orig/include/linux/squashfs_fs_i.h linux/include/linux/squashfs_fs_i.h
+--- linux.orig/include/linux/squashfs_fs_i.h 1969-12-31 19:00:00.000000000 -0500
++++ linux/include/linux/squashfs_fs_i.h 2004-05-25 21:13:03.000000000 -0400
@@ -0,0 +1,33 @@
+#ifndef SQUASHFS_FS_I
+#define SQUASHFS_FS_I
+ unsigned int fragment_offset;
+ } squashfs_inode_info;
+#endif
-diff -Nurb src/linux/linux.orig/include/linux/squashfs_fs_sb.h src/linux/linux/include/linux/squashfs_fs_sb.h
---- src/linux/linux.orig/include/linux/squashfs_fs_sb.h 1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/linux/squashfs_fs_sb.h 2004-05-25 21:13:03.000000000 -0400
+diff -Nurb linux.orig/include/linux/squashfs_fs_sb.h linux/include/linux/squashfs_fs_sb.h
+--- linux.orig/include/linux/squashfs_fs_sb.h 1969-12-31 19:00:00.000000000 -0500
++++ linux/include/linux/squashfs_fs_sb.h 2004-05-25 21:13:03.000000000 -0400
@@ -0,0 +1,65 @@
+#ifndef SQUASHFS_FS_SB
+#define SQUASHFS_FS_SB
+ char *block_list, char **block_p, unsigned int *bsize);
+ } squashfs_sb_info;
+#endif
-diff -Nurb src/linux/linux.orig/init/do_mounts.c src/linux/linux/init/do_mounts.c
---- src/linux/linux.orig/init/do_mounts.c 2003-11-08 03:13:20.000000000 -0500
-+++ src/linux/linux/init/do_mounts.c 2004-05-25 21:13:03.000000000 -0400
+diff -Nurb linux.orig/init/do_mounts.c linux/init/do_mounts.c
+--- linux.orig/init/do_mounts.c 2003-11-08 03:13:20.000000000 -0500
++++ linux/init/do_mounts.c 2004-05-25 21:13:03.000000000 -0400
@@ -16,6 +16,7 @@
#include <linux/ext2_fs.h>
#include <linux/romfs_fs.h>
/*
* Read block 1 to test for minix and ext2 superblock
*/
-diff -Nurb src/linux/linux.orig/kernel/ksyms.c src/linux/linux/kernel/ksyms.c
---- src/linux/linux.orig/kernel/ksyms.c 2003-07-04 04:12:28.000000000 -0400
-+++ src/linux/linux/kernel/ksyms.c 2004-05-25 21:12:24.000000000 -0400
+diff -Nurb linux.orig/kernel/ksyms.c linux/kernel/ksyms.c
+--- linux.orig/kernel/ksyms.c 2003-07-04 04:12:28.000000000 -0400
++++ linux/kernel/ksyms.c 2004-05-25 21:12:24.000000000 -0400
@@ -482,9 +482,9 @@
EXPORT_SYMBOL(simple_strtoull);
EXPORT_SYMBOL(system_utsname); /* UTS data */
EXPORT_SYMBOL(machine_restart);
EXPORT_SYMBOL(machine_halt);
EXPORT_SYMBOL(machine_power_off);
-diff -Nurb src/linux/linux.orig/lib/Config.in src/linux/linux/lib/Config.in
---- src/linux/linux.orig/lib/Config.in 2003-07-04 04:12:29.000000000 -0400
-+++ src/linux/linux/lib/Config.in 2004-05-25 21:13:03.000000000 -0400
+diff -Nurb linux.orig/lib/Config.in linux/lib/Config.in
+--- linux.orig/lib/Config.in 2003-07-04 04:12:29.000000000 -0400
++++ linux/lib/Config.in 2004-05-25 21:13:03.000000000 -0400
@@ -8,12 +8,14 @@
# Do we need the compression support?
#
-diff -Nurb src/linux/linux.orig/Documentation/netswap.txt src/linux/linux/Documentation/netswap.txt
---- src/linux/linux.orig/Documentation/netswap.txt 1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/Documentation/netswap.txt 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/Documentation/netswap.txt linux/Documentation/netswap.txt
+--- linux.orig/Documentation/netswap.txt 1969-12-31 19:00:00.000000000 -0500
++++ linux/Documentation/netswap.txt 2004-05-31 02:18:03.000000000 -0400
@@ -0,0 +1,51 @@
+ Swapping over network
+
+
+Swapping over the network is insecure unless the data would be
+encrypted, which is not the case with NFS. It is also very slow.
-diff -Nurb src/linux/linux.orig/Documentation/nfsswap.txt src/linux/linux/Documentation/nfsswap.txt
---- src/linux/linux.orig/Documentation/nfsswap.txt 1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/Documentation/nfsswap.txt 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/Documentation/nfsswap.txt linux/Documentation/nfsswap.txt
+--- linux.orig/Documentation/nfsswap.txt 1969-12-31 19:00:00.000000000 -0500
++++ linux/Documentation/nfsswap.txt 2004-05-31 02:18:03.000000000 -0400
@@ -0,0 +1,41 @@
+ Swapping to files on NFS volumes
+
+Swapping over the network is insecure unless the data would be
+encrypted, which is not the case with NFS. It is also very slow.
+
-diff -Nurb src/linux/linux.orig/drivers/block/blkpg.c src/linux/linux/drivers/block/blkpg.c
---- src/linux/linux.orig/drivers/block/blkpg.c 2003-07-04 04:11:31.000000000 -0400
-+++ src/linux/linux/drivers/block/blkpg.c 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/drivers/block/blkpg.c linux/drivers/block/blkpg.c
+--- linux.orig/drivers/block/blkpg.c 2003-07-04 04:11:31.000000000 -0400
++++ linux/drivers/block/blkpg.c 2004-05-31 02:18:03.000000000 -0400
@@ -34,7 +34,7 @@
#include <linux/blk.h> /* for set_device_ro() */
#include <linux/blkpg.h>
/*
* Delete a partition given by partition number
*
-diff -Nurb src/linux/linux.orig/fs/Config.in src/linux/linux/fs/Config.in
---- src/linux/linux.orig/fs/Config.in 2004-05-31 02:02:43.000000000 -0400
-+++ src/linux/linux/fs/Config.in 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/fs/Config.in linux/fs/Config.in
+--- linux.orig/fs/Config.in 2004-05-31 02:02:43.000000000 -0400
++++ linux/fs/Config.in 2004-05-31 02:18:03.000000000 -0400
@@ -4,6 +4,12 @@
mainmenu_option next_comment
comment 'File systems'
dep_tristate 'NFS server support' CONFIG_NFSD $CONFIG_INET
dep_mbool ' Provide NFSv3 server support' CONFIG_NFSD_V3 $CONFIG_NFSD
-diff -Nurb src/linux/linux.orig/fs/Makefile src/linux/linux/fs/Makefile
---- src/linux/linux.orig/fs/Makefile 2004-05-31 02:02:42.000000000 -0400
-+++ src/linux/linux/fs/Makefile 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/fs/Makefile linux/fs/Makefile
+--- linux.orig/fs/Makefile 2004-05-31 02:02:42.000000000 -0400
++++ linux/fs/Makefile 2004-05-31 02:18:03.000000000 -0400
@@ -8,7 +8,7 @@
O_TARGET := fs.o
obj-$(CONFIG_BINFMT_AOUT) += binfmt_aout.o
obj-$(CONFIG_BINFMT_EM86) += binfmt_em86.o
-diff -Nurb src/linux/linux.orig/fs/blkdev_swap.c src/linux/linux/fs/blkdev_swap.c
---- src/linux/linux.orig/fs/blkdev_swap.c 1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/fs/blkdev_swap.c 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/fs/blkdev_swap.c linux/fs/blkdev_swap.c
+--- linux.orig/fs/blkdev_swap.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/fs/blkdev_swap.c 2004-05-31 02:18:03.000000000 -0400
@@ -0,0 +1,309 @@
+/*
+ * Swapping to partitions or files located on partitions.
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Many. Stuffed into a module by cH (Claus-Justus Heine)");
+MODULE_DESCRIPTION("Swapping to partitions and files on local hard-disks");
-diff -Nurb src/linux/linux.orig/fs/buffer.c src/linux/linux/fs/buffer.c
---- src/linux/linux.orig/fs/buffer.c 2003-07-04 04:12:05.000000000 -0400
-+++ src/linux/linux/fs/buffer.c 2004-05-31 02:21:05.000000000 -0400
+diff -Nurb linux.orig/fs/buffer.c linux/fs/buffer.c
+--- linux.orig/fs/buffer.c 2003-07-04 04:12:05.000000000 -0400
++++ linux/fs/buffer.c 2004-05-31 02:21:05.000000000 -0400
@@ -743,7 +743,7 @@
bh->b_private = private;
}
int block_symlink(struct inode *inode, const char *symname, int len)
{
struct address_space *mapping = inode->i_mapping;
-diff -Nurb src/linux/linux.orig/fs/nfs/Makefile src/linux/linux/fs/nfs/Makefile
---- src/linux/linux.orig/fs/nfs/Makefile 2003-07-04 04:12:07.000000000 -0400
-+++ src/linux/linux/fs/nfs/Makefile 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/fs/nfs/Makefile linux/fs/nfs/Makefile
+--- linux.orig/fs/nfs/Makefile 2003-07-04 04:12:07.000000000 -0400
++++ linux/fs/nfs/Makefile 2004-05-31 02:18:03.000000000 -0400
@@ -15,6 +15,14 @@
obj-$(CONFIG_ROOT_NFS) += nfsroot.o mount_clnt.o
obj-$(CONFIG_NFS_V3) += nfs3proc.o nfs3xdr.o
+endif
include $(TOPDIR)/Rules.make
-diff -Nurb src/linux/linux.orig/fs/nfs/file.c src/linux/linux/fs/nfs/file.c
---- src/linux/linux.orig/fs/nfs/file.c 2003-07-04 04:12:07.000000000 -0400
-+++ src/linux/linux/fs/nfs/file.c 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/fs/nfs/file.c linux/fs/nfs/file.c
+--- linux.orig/fs/nfs/file.c 2003-07-04 04:12:07.000000000 -0400
++++ linux/fs/nfs/file.c 2004-05-31 02:18:03.000000000 -0400
@@ -58,11 +58,6 @@
setattr: nfs_notify_change,
};
}
/*
-diff -Nurb src/linux/linux.orig/fs/nfs/nfs_syms.c src/linux/linux/fs/nfs/nfs_syms.c
---- src/linux/linux.orig/fs/nfs/nfs_syms.c 1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/fs/nfs/nfs_syms.c 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/fs/nfs/nfs_syms.c linux/fs/nfs/nfs_syms.c
+--- linux.orig/fs/nfs/nfs_syms.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/fs/nfs/nfs_syms.c 2004-05-31 02:18:03.000000000 -0400
@@ -0,0 +1,10 @@
+#include <linux/config.h>
+#define __NO_VERSION__
+EXPORT_SYMBOL(__nfs_refresh_inode);
+EXPORT_SYMBOL(nfs_write_attributes);
+
-diff -Nurb src/linux/linux.orig/fs/nfs/nfsswap.c src/linux/linux/fs/nfs/nfsswap.c
---- src/linux/linux.orig/fs/nfs/nfsswap.c 1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/fs/nfs/nfsswap.c 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/fs/nfs/nfsswap.c linux/fs/nfs/nfsswap.c
+--- linux.orig/fs/nfs/nfsswap.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/fs/nfs/nfsswap.c 2004-05-31 02:18:03.000000000 -0400
@@ -0,0 +1,350 @@
+/*
+ * Swapping to files located on NFS mounted volumes
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("(c) 1996-2002 cH (Claus-Justus Heine)");
+MODULE_DESCRIPTION("Swapping to files located on volumes mounted via NFS");
-diff -Nurb src/linux/linux.orig/fs/nfs/read.c src/linux/linux/fs/nfs/read.c
---- src/linux/linux.orig/fs/nfs/read.c 2003-07-04 04:12:08.000000000 -0400
-+++ src/linux/linux/fs/nfs/read.c 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/fs/nfs/read.c linux/fs/nfs/read.c
+--- linux.orig/fs/nfs/read.c 2003-07-04 04:12:08.000000000 -0400
++++ linux/fs/nfs/read.c 2004-05-31 02:18:03.000000000 -0400
@@ -50,11 +50,6 @@
*/
static void nfs_readpage_result(struct rpc_task *task);
out:
return error;
-diff -Nurb src/linux/linux.orig/fs/nfs/write.c src/linux/linux/fs/nfs/write.c
---- src/linux/linux.orig/fs/nfs/write.c 2003-07-04 04:12:08.000000000 -0400
-+++ src/linux/linux/fs/nfs/write.c 2004-05-31 02:20:47.000000000 -0400
+diff -Nurb linux.orig/fs/nfs/write.c linux/fs/nfs/write.c
+--- linux.orig/fs/nfs/write.c 2003-07-04 04:12:08.000000000 -0400
++++ linux/fs/nfs/write.c 2004-05-31 02:20:47.000000000 -0400
@@ -3,7 +3,6 @@
#include <linux/config.h>
#include <linux/types.h>
while (!list_empty(&data->pages)) {
req = nfs_list_entry(data->pages.next);
nfs_list_remove_request(req);
-diff -Nurb src/linux/linux.orig/include/linux/fs.h src/linux/linux/include/linux/fs.h
---- src/linux/linux.orig/include/linux/fs.h 2004-05-31 02:06:19.000000000 -0400
-+++ src/linux/linux/include/linux/fs.h 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/include/linux/fs.h linux/include/linux/fs.h
+--- linux.orig/include/linux/fs.h 2004-05-31 02:06:19.000000000 -0400
++++ linux/include/linux/fs.h 2004-05-31 02:18:03.000000000 -0400
@@ -1500,6 +1500,10 @@
extern int inode_change_ok(struct inode *, struct iattr *);
extern int inode_setattr(struct inode *, struct iattr *);
/*
* Common dentry functions for inclusion in the VFS
* or in other stackable file systems. Some of these
-diff -Nurb src/linux/linux.orig/include/linux/nfs_fs.h src/linux/linux/include/linux/nfs_fs.h
---- src/linux/linux.orig/include/linux/nfs_fs.h 2004-05-31 02:06:28.000000000 -0400
-+++ src/linux/linux/include/linux/nfs_fs.h 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/include/linux/nfs_fs.h linux/include/linux/nfs_fs.h
+--- linux.orig/include/linux/nfs_fs.h 2004-05-31 02:06:28.000000000 -0400
++++ linux/include/linux/nfs_fs.h 2004-05-31 02:18:03.000000000 -0400
@@ -40,8 +40,8 @@
*/
#define NFS_MAX_DIRCACHE 16
#define NFSDBG_ALL 0xFFFF
#ifdef __KERNEL__
-diff -Nurb src/linux/linux.orig/include/linux/slab.h src/linux/linux/include/linux/slab.h
---- src/linux/linux.orig/include/linux/slab.h 2004-05-31 02:06:19.000000000 -0400
-+++ src/linux/linux/include/linux/slab.h 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/include/linux/slab.h linux/include/linux/slab.h
+--- linux.orig/include/linux/slab.h 2004-05-31 02:06:19.000000000 -0400
++++ linux/include/linux/slab.h 2004-05-31 02:18:03.000000000 -0400
@@ -39,6 +39,7 @@
#define SLAB_HWCACHE_ALIGN 0x00002000UL /* align objs on a h/w cache lines */
#define SLAB_CACHE_DMA 0x00004000UL /* use GFP_DMA memory */
/* flags passed to a constructor func */
#define SLAB_CTOR_CONSTRUCTOR 0x001UL /* if not set, then deconstructor */
-diff -Nurb src/linux/linux.orig/include/linux/swap.h src/linux/linux/include/linux/swap.h
---- src/linux/linux.orig/include/linux/swap.h 2004-05-31 02:06:19.000000000 -0400
-+++ src/linux/linux/include/linux/swap.h 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/include/linux/swap.h linux/include/linux/swap.h
+--- linux.orig/include/linux/swap.h 2004-05-31 02:06:19.000000000 -0400
++++ linux/include/linux/swap.h 2004-05-31 02:18:03.000000000 -0400
@@ -58,15 +58,29 @@
#define SWAP_MAP_MAX 0x7fff
#define SWAP_MAP_BAD 0x8000
extern int swap_duplicate(swp_entry_t);
extern int swap_count(struct page *);
extern int valid_swaphandles(swp_entry_t, unsigned long *);
-diff -Nurb src/linux/linux.orig/include/net/netswapping.h src/linux/linux/include/net/netswapping.h
---- src/linux/linux.orig/include/net/netswapping.h 1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/include/net/netswapping.h 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/include/net/netswapping.h linux/include/net/netswapping.h
+--- linux.orig/include/net/netswapping.h 1969-12-31 19:00:00.000000000 -0500
++++ linux/include/net/netswapping.h 2004-05-31 02:18:03.000000000 -0400
@@ -0,0 +1,47 @@
+#ifndef _LINUX_NETSWAPPING_H
+#define _LINUX_NETSWAPPING_H
+#endif
+
+#endif
-diff -Nurb src/linux/linux.orig/include/net/sock.h src/linux/linux/include/net/sock.h
---- src/linux/linux.orig/include/net/sock.h 2004-05-31 02:07:17.000000000 -0400
-+++ src/linux/linux/include/net/sock.h 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/include/net/sock.h linux/include/net/sock.h
+--- linux.orig/include/net/sock.h 2004-05-31 02:07:17.000000000 -0400
++++ linux/include/net/sock.h 2004-05-31 02:18:03.000000000 -0400
@@ -103,6 +103,10 @@
#include <linux/filter.h>
#endif
skb->dev = NULL;
skb_set_owner_r(skb, sk);
-diff -Nurb src/linux/linux.orig/kernel/ksyms.c src/linux/linux/kernel/ksyms.c
---- src/linux/linux.orig/kernel/ksyms.c 2004-05-31 02:02:43.000000000 -0400
-+++ src/linux/linux/kernel/ksyms.c 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/kernel/ksyms.c linux/kernel/ksyms.c
+--- linux.orig/kernel/ksyms.c 2004-05-31 02:02:43.000000000 -0400
++++ linux/kernel/ksyms.c 2004-05-31 02:18:03.000000000 -0400
@@ -41,6 +41,7 @@
#include <linux/mm.h>
#include <linux/capability.h>
EXPORT_SYMBOL(__inode_dir_notify);
#ifdef CONFIG_UID16
-diff -Nurb src/linux/linux.orig/mm/page_io.c src/linux/linux/mm/page_io.c
---- src/linux/linux.orig/mm/page_io.c 2003-07-04 04:12:29.000000000 -0400
-+++ src/linux/linux/mm/page_io.c 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/mm/page_io.c linux/mm/page_io.c
+--- linux.orig/mm/page_io.c 2003-07-04 04:12:29.000000000 -0400
++++ linux/mm/page_io.c 2004-05-31 02:18:03.000000000 -0400
@@ -36,11 +36,8 @@
static int rw_swap_page_base(int rw, swp_entry_t entry, struct page *page)
{
return 1;
}
-diff -Nurb src/linux/linux.orig/mm/slab.c src/linux/linux/mm/slab.c
---- src/linux/linux.orig/mm/slab.c 2003-07-04 04:12:29.000000000 -0400
-+++ src/linux/linux/mm/slab.c 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/mm/slab.c linux/mm/slab.c
+--- linux.orig/mm/slab.c 2003-07-04 04:12:29.000000000 -0400
++++ linux/mm/slab.c 2004-05-31 02:18:03.000000000 -0400
@@ -111,10 +111,12 @@
# define CREATE_MASK (SLAB_DEBUG_INITIAL | SLAB_RED_ZONE | \
SLAB_POISON | SLAB_HWCACHE_ALIGN | \
if (flags & CFLGS_OFF_SLAB && cachep->num > offslab_limit) {
/* Oops, this num of objs will cause problems. */
cachep->gfporder--;
-diff -Nurb src/linux/linux.orig/mm/swapfile.c src/linux/linux/mm/swapfile.c
---- src/linux/linux.orig/mm/swapfile.c 2003-07-04 04:12:29.000000000 -0400
-+++ src/linux/linux/mm/swapfile.c 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/mm/swapfile.c linux/mm/swapfile.c
+--- linux.orig/mm/swapfile.c 2003-07-04 04:12:29.000000000 -0400
++++ linux/mm/swapfile.c 2004-05-31 02:18:03.000000000 -0400
@@ -11,12 +11,17 @@
#include <linux/swap.h>
#include <linux/swapctl.h>
}
/*
-diff -Nurb src/linux/linux.orig/net/Config.in src/linux/linux/net/Config.in
---- src/linux/linux.orig/net/Config.in 2003-07-04 04:12:29.000000000 -0400
-+++ src/linux/linux/net/Config.in 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/net/Config.in linux/net/Config.in
+--- linux.orig/net/Config.in 2003-07-04 04:12:29.000000000 -0400
++++ linux/net/Config.in 2004-05-31 02:18:03.000000000 -0400
@@ -16,6 +16,9 @@
fi
bool 'Socket Filtering' CONFIG_FILTER
bool 'TCP/IP networking' CONFIG_INET
if [ "$CONFIG_INET" = "y" ]; then
source net/ipv4/Config.in
-diff -Nurb src/linux/linux.orig/net/Makefile src/linux/linux/net/Makefile
---- src/linux/linux.orig/net/Makefile 2003-07-04 04:12:29.000000000 -0400
-+++ src/linux/linux/net/Makefile 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/net/Makefile linux/net/Makefile
+--- linux.orig/net/Makefile 2003-07-04 04:12:29.000000000 -0400
++++ linux/net/Makefile 2004-05-31 02:18:03.000000000 -0400
@@ -51,6 +51,7 @@
ifeq ($(CONFIG_NET),y)
obj-$(CONFIG_MODULES) += netsyms.o
endif
include $(TOPDIR)/Rules.make
-diff -Nurb src/linux/linux.orig/net/core/sock.c src/linux/linux/net/core/sock.c
---- src/linux/linux.orig/net/core/sock.c 2003-10-14 04:09:32.000000000 -0400
-+++ src/linux/linux/net/core/sock.c 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/net/core/sock.c linux/net/core/sock.c
+--- linux.orig/net/core/sock.c 2003-10-14 04:09:32.000000000 -0400
++++ linux/net/core/sock.c 2004-05-31 02:18:03.000000000 -0400
@@ -402,6 +402,21 @@
ret = -ENONET;
break;
/* Dubious BSD thing... Probably nobody even uses it, but
* the UNIX standard wants it for whatever reason... -DaveM
*/
-diff -Nurb src/linux/linux.orig/net/ipv4/tcp_ipv4.c src/linux/linux/net/ipv4/tcp_ipv4.c
---- src/linux/linux.orig/net/ipv4/tcp_ipv4.c 2003-10-14 04:09:33.000000000 -0400
-+++ src/linux/linux/net/ipv4/tcp_ipv4.c 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/net/ipv4/tcp_ipv4.c linux/net/ipv4/tcp_ipv4.c
+--- linux.orig/net/ipv4/tcp_ipv4.c 2003-10-14 04:09:33.000000000 -0400
++++ linux/net/ipv4/tcp_ipv4.c 2004-05-31 02:18:03.000000000 -0400
@@ -1657,6 +1657,12 @@
if (filter && sk_filter(skb, filter))
goto discard;
IP_INC_STATS_BH(IpInDelivers);
-diff -Nurb src/linux/linux.orig/net/ipv6/tcp_ipv6.c src/linux/linux/net/ipv6/tcp_ipv6.c
---- src/linux/linux.orig/net/ipv6/tcp_ipv6.c 2003-10-14 04:09:34.000000000 -0400
-+++ src/linux/linux/net/ipv6/tcp_ipv6.c 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/net/ipv6/tcp_ipv6.c linux/net/ipv6/tcp_ipv6.c
+--- linux.orig/net/ipv6/tcp_ipv6.c 2003-10-14 04:09:34.000000000 -0400
++++ linux/net/ipv6/tcp_ipv6.c 2004-05-31 02:18:03.000000000 -0400
@@ -1424,6 +1424,12 @@
if (filter && sk_filter(skb, filter))
goto discard;
/*
* socket locking is here for SMP purposes as backlog rcv
-diff -Nurb src/linux/linux.orig/net/netswapping.c src/linux/linux/net/netswapping.c
---- src/linux/linux.orig/net/netswapping.c 1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/netswapping.c 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/net/netswapping.c linux/net/netswapping.c
+--- linux.orig/net/netswapping.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/netswapping.c 2004-05-31 02:18:03.000000000 -0400
@@ -0,0 +1,76 @@
+/*
+ * linux/net/swapping.c
+
+module_init(netswap_init)
+module_exit(netswap_exit)
-diff -Nurb src/linux/linux.orig/net/netsyms.c src/linux/linux/net/netsyms.c
---- src/linux/linux.orig/net/netsyms.c 2004-05-31 02:02:49.000000000 -0400
-+++ src/linux/linux/net/netsyms.c 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/net/netsyms.c linux/net/netsyms.c
+--- linux.orig/net/netsyms.c 2004-05-31 02:02:49.000000000 -0400
++++ linux/net/netsyms.c 2004-05-31 02:18:03.000000000 -0400
@@ -601,4 +601,10 @@
EXPORT_SYMBOL(wireless_send_event);
#endif /* CONFIG_NET_RADIO || CONFIG_NET_PCMCIA_RADIO */
+#endif
+
#endif /* CONFIG_NET */
-diff -Nurb src/linux/linux.orig/net/packet/af_packet.c src/linux/linux/net/packet/af_packet.c
---- src/linux/linux.orig/net/packet/af_packet.c 2003-10-14 04:09:35.000000000 -0400
-+++ src/linux/linux/net/packet/af_packet.c 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/net/packet/af_packet.c linux/net/packet/af_packet.c
+--- linux.orig/net/packet/af_packet.c 2003-10-14 04:09:35.000000000 -0400
++++ linux/net/packet/af_packet.c 2004-05-31 02:18:03.000000000 -0400
@@ -449,6 +449,12 @@
snaplen = res;
}
if (sk->type == SOCK_DGRAM) {
macoff = netoff = TPACKET_ALIGN(TPACKET_HDRLEN) + 16;
-diff -Nurb src/linux/linux.orig/net/sunrpc/sched.c src/linux/linux/net/sunrpc/sched.c
---- src/linux/linux.orig/net/sunrpc/sched.c 2003-07-04 04:12:33.000000000 -0400
-+++ src/linux/linux/net/sunrpc/sched.c 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/net/sunrpc/sched.c linux/net/sunrpc/sched.c
+--- linux.orig/net/sunrpc/sched.c 2003-07-04 04:12:33.000000000 -0400
++++ linux/net/sunrpc/sched.c 2004-05-31 02:18:03.000000000 -0400
@@ -79,10 +79,11 @@
*/
static spinlock_t rpc_sched_lock = SPIN_LOCK_UNLOCKED;
}
/*
-diff -Nurb src/linux/linux.orig/net/sunrpc/xprt.c src/linux/linux/net/sunrpc/xprt.c
---- src/linux/linux.orig/net/sunrpc/xprt.c 2003-07-04 04:12:33.000000000 -0400
-+++ src/linux/linux/net/sunrpc/xprt.c 2004-05-31 02:18:03.000000000 -0400
+diff -Nurb linux.orig/net/sunrpc/xprt.c linux/net/sunrpc/xprt.c
+--- linux.orig/net/sunrpc/xprt.c 2003-07-04 04:12:33.000000000 -0400
++++ linux/net/sunrpc/xprt.c 2004-05-31 02:18:03.000000000 -0400
@@ -139,7 +139,7 @@
__xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task)
{
-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
+diff -Nurb linux.stock/include/linux/if_bridge.h linux/include/linux/if_bridge.h
+--- linux.stock/include/linux/if_bridge.h 2003-10-14 04:09:25.000000000 -0400
++++ linux/include/linux/if_bridge.h 2004-07-10 23:46:39.000000000 -0400
@@ -102,7 +102,8 @@
struct net_bridge_port;
#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
+diff -Nurb linux.stock/include/linux/netfilter.h linux/include/linux/netfilter.h
+--- linux.stock/include/linux/netfilter.h 2004-07-10 23:30:09.000000000 -0400
++++ 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 */
/* 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
+diff -Nurb linux.stock/include/linux/netfilter_bridge/ebt_802_3.h linux/include/linux/netfilter_bridge/ebt_802_3.h
+--- linux.stock/include/linux/netfilter_bridge/ebt_802_3.h 1969-12-31 19:00:00.000000000 -0500
++++ 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
+};
+
+#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
+diff -Nurb linux.stock/include/linux/netfilter_bridge/ebt_among.h linux/include/linux/netfilter_bridge/ebt_among.h
+--- linux.stock/include/linux/netfilter_bridge/ebt_among.h 1969-12-31 19:00:00.000000000 -0500
++++ 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_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
+diff -Nurb linux.stock/include/linux/netfilter_bridge/ebt_arp.h linux/include/linux/netfilter_bridge/ebt_arp.h
+--- linux.stock/include/linux/netfilter_bridge/ebt_arp.h 1969-12-31 19:00:00.000000000 -0500
++++ 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
+};
+
+#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
+diff -Nurb linux.stock/include/linux/netfilter_bridge/ebt_arpreply.h linux/include/linux/netfilter_bridge/ebt_arpreply.h
+--- linux.stock/include/linux/netfilter_bridge/ebt_arpreply.h 1969-12-31 19:00:00.000000000 -0500
++++ 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
+#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
+diff -Nurb linux.stock/include/linux/netfilter_bridge/ebt_ip.h linux/include/linux/netfilter_bridge/ebt_ip.h
+--- linux.stock/include/linux/netfilter_bridge/ebt_ip.h 1969-12-31 19:00:00.000000000 -0500
++++ linux/include/linux/netfilter_bridge/ebt_ip.h 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,43 @@
+/*
+ * ebt_ip
+};
+
+#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
+diff -Nurb linux.stock/include/linux/netfilter_bridge/ebt_limit.h linux/include/linux/netfilter_bridge/ebt_limit.h
+--- linux.stock/include/linux/netfilter_bridge/ebt_limit.h 1969-12-31 19:00:00.000000000 -0500
++++ 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
+};
+
+#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
+diff -Nurb linux.stock/include/linux/netfilter_bridge/ebt_log.h linux/include/linux/netfilter_bridge/ebt_log.h
+--- linux.stock/include/linux/netfilter_bridge/ebt_log.h 1969-12-31 19:00:00.000000000 -0500
++++ 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
+};
+
+#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
+diff -Nurb linux.stock/include/linux/netfilter_bridge/ebt_mark_m.h linux/include/linux/netfilter_bridge/ebt_mark_m.h
+--- linux.stock/include/linux/netfilter_bridge/ebt_mark_m.h 1969-12-31 19:00:00.000000000 -0500
++++ 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_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
+diff -Nurb linux.stock/include/linux/netfilter_bridge/ebt_mark_t.h linux/include/linux/netfilter_bridge/ebt_mark_t.h
+--- linux.stock/include/linux/netfilter_bridge/ebt_mark_t.h 1969-12-31 19:00:00.000000000 -0500
++++ 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
+#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
+diff -Nurb linux.stock/include/linux/netfilter_bridge/ebt_nat.h linux/include/linux/netfilter_bridge/ebt_nat.h
+--- linux.stock/include/linux/netfilter_bridge/ebt_nat.h 1969-12-31 19:00:00.000000000 -0500
++++ 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
+#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
+diff -Nurb linux.stock/include/linux/netfilter_bridge/ebt_pkttype.h linux/include/linux/netfilter_bridge/ebt_pkttype.h
+--- linux.stock/include/linux/netfilter_bridge/ebt_pkttype.h 1969-12-31 19:00:00.000000000 -0500
++++ 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
+#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
+diff -Nurb linux.stock/include/linux/netfilter_bridge/ebt_redirect.h linux/include/linux/netfilter_bridge/ebt_redirect.h
+--- linux.stock/include/linux/netfilter_bridge/ebt_redirect.h 1969-12-31 19:00:00.000000000 -0500
++++ 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
+#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
+diff -Nurb linux.stock/include/linux/netfilter_bridge/ebt_stp.h linux/include/linux/netfilter_bridge/ebt_stp.h
+--- linux.stock/include/linux/netfilter_bridge/ebt_stp.h 1969-12-31 19:00:00.000000000 -0500
++++ 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
+};
+
+#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
+diff -Nurb linux.stock/include/linux/netfilter_bridge/ebt_vlan.h linux/include/linux/netfilter_bridge/ebt_vlan.h
+--- linux.stock/include/linux/netfilter_bridge/ebt_vlan.h 1969-12-31 19:00:00.000000000 -0500
++++ 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
+};
+
+#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
+diff -Nurb linux.stock/include/linux/netfilter_bridge/ebtables.h linux/include/linux/netfilter_bridge/ebtables.h
+--- linux.stock/include/linux/netfilter_bridge/ebtables.h 1969-12-31 19:00:00.000000000 -0500
++++ linux/include/linux/netfilter_bridge/ebtables.h 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,361 @@
+/*
+ * ebtables
+})
+
+#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
+diff -Nurb linux.stock/include/linux/netfilter_bridge.h linux/include/linux/netfilter_bridge.h
+--- linux.stock/include/linux/netfilter_bridge.h 2003-07-04 04:12:26.000000000 -0400
++++ linux/include/linux/netfilter_bridge.h 2004-07-10 23:46:39.000000000 -0400
@@ -6,6 +6,10 @@
#include <linux/config.h>
+#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
+diff -Nurb linux.stock/include/linux/netfilter_ipv4/ipt_physdev.h linux/include/linux/netfilter_ipv4/ipt_physdev.h
+--- linux.stock/include/linux/netfilter_ipv4/ipt_physdev.h 1969-12-31 19:00:00.000000000 -0500
++++ 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
+};
+
+#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
+diff -Nurb linux.stock/include/linux/netfilter_ipv4.h linux/include/linux/netfilter_ipv4.h
+--- linux.stock/include/linux/netfilter_ipv4.h 2004-07-10 23:30:09.000000000 -0400
++++ 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_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
+diff -Nurb linux.stock/include/linux/skbuff.h linux/include/linux/skbuff.h
+--- linux.stock/include/linux/skbuff.h 2003-07-04 04:12:26.000000000 -0400
++++ 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;
#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
+diff -Nurb linux.stock/include/linux/sysctl.h linux/include/linux/sysctl.h
+--- linux.stock/include/linux/sysctl.h 2004-07-10 23:29:55.000000000 -0400
++++ linux/include/linux/sysctl.h 2004-07-10 23:46:39.000000000 -0400
@@ -547,6 +547,15 @@
NET_DECNET_CONF_DEV_STATE = 7
};
/* 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
+diff -Nurb linux.stock/net/8021q/vlan_dev.c linux/net/8021q/vlan_dev.c
+--- linux.stock/net/8021q/vlan_dev.c 2003-07-04 04:12:29.000000000 -0400
++++ 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;
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
+diff -Nurb linux.stock/net/Config.in linux/net/Config.in
+--- linux.stock/net/Config.in 2004-07-10 23:29:49.000000000 -0400
++++ linux/net/Config.in 2004-07-10 23:46:39.000000000 -0400
@@ -68,6 +68,9 @@
source net/decnet/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
+diff -Nurb linux.stock/net/Makefile linux/net/Makefile
+--- linux.stock/net/Makefile 2004-07-10 23:29:49.000000000 -0400
++++ linux/net/Makefile 2004-07-10 23:49:10.000000000 -0400
@@ -26,6 +26,12 @@
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
+diff -Nurb linux.stock/net/bridge/Makefile linux/net/bridge/Makefile
+--- linux.stock/net/bridge/Makefile 2003-07-04 04:12:30.000000000 -0400
++++ 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...
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
+diff -Nurb linux.stock/net/bridge/br.c linux/net/bridge/br.c
+--- linux.stock/net/bridge/br.c 2003-10-14 04:09:32.000000000 -0400
++++ linux/net/bridge/br.c 2004-07-10 23:46:39.000000000 -0400
@@ -29,6 +29,8 @@
#include "../atm/lec.h"
#endif
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
+diff -Nurb linux.stock/net/bridge/br_forward.c linux/net/bridge/br_forward.c
+--- linux.stock/net/bridge/br_forward.c 2003-10-14 04:09:32.000000000 -0400
++++ linux/net/bridge/br_forward.c 2004-07-10 23:46:39.000000000 -0400
@@ -30,18 +30,21 @@
return 1;
}
}
/* 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
+diff -Nurb linux.stock/net/bridge/br_input.c linux/net/bridge/br_input.c
+--- linux.stock/net/bridge/br_input.c 2003-10-14 04:09:32.000000000 -0400
++++ 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)
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
+diff -Nurb linux.stock/net/bridge/br_netfilter.c linux/net/bridge/br_netfilter.c
+--- linux.stock/net/bridge/br_netfilter.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/br_netfilter.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,896 @@
+/*
+ * Handle firewalling
+#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
+diff -Nurb linux.stock/net/bridge/br_private.h linux/net/bridge/br_private.h
+--- linux.stock/net/bridge/br_private.h 2003-10-14 04:09:32.000000000 -0400
++++ 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,
/* 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
+diff -Nurb linux.stock/net/bridge/netfilter/Config.in linux/net/bridge/netfilter/Config.in
+--- linux.stock/net/bridge/netfilter/Config.in 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/Config.in 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,22 @@
+#
+# Bridge netfilter configuration
+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
+diff -Nurb linux.stock/net/bridge/netfilter/Makefile linux/net/bridge/netfilter/Makefile
+--- linux.stock/net/bridge/netfilter/Makefile 1969-12-31 19:00:00.000000000 -0500
++++ 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.
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebt_802_3.c linux/net/bridge/netfilter/ebt_802_3.c
+--- linux.stock/net/bridge/netfilter/ebt_802_3.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/ebt_802_3.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,74 @@
+/*
+ * 802_3
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebt_among.c linux/net/bridge/netfilter/ebt_among.c
+--- linux.stock/net/bridge/netfilter/ebt_among.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/ebt_among.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,223 @@
+/*
+ * ebt_among
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebt_arp.c linux/net/bridge/netfilter/ebt_arp.c
+--- linux.stock/net/bridge/netfilter/ebt_arp.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/ebt_arp.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,149 @@
+/*
+ * ebt_arp
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebt_arpreply.c linux/net/bridge/netfilter/ebt_arpreply.c
+--- linux.stock/net/bridge/netfilter/ebt_arpreply.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/ebt_arpreply.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,86 @@
+/*
+ * ebt_arpreply
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebt_dnat.c linux/net/bridge/netfilter/ebt_dnat.c
+--- linux.stock/net/bridge/netfilter/ebt_dnat.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/ebt_dnat.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,65 @@
+/*
+ * ebt_dnat
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebt_ip.c linux/net/bridge/netfilter/ebt_ip.c
+--- linux.stock/net/bridge/netfilter/ebt_ip.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/ebt_ip.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,121 @@
+/*
+ * ebt_ip
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebt_limit.c linux/net/bridge/netfilter/ebt_limit.c
+--- linux.stock/net/bridge/netfilter/ebt_limit.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/ebt_limit.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,101 @@
+/*
+ * ebt_limit
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebt_log.c linux/net/bridge/netfilter/ebt_log.c
+--- linux.stock/net/bridge/netfilter/ebt_log.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/ebt_log.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,152 @@
+/*
+ * ebt_log
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebt_mark.c linux/net/bridge/netfilter/ebt_mark.c
+--- linux.stock/net/bridge/netfilter/ebt_mark.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/ebt_mark.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,66 @@
+/*
+ * ebt_mark
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebt_mark_m.c linux/net/bridge/netfilter/ebt_mark_m.c
+--- linux.stock/net/bridge/netfilter/ebt_mark_m.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/ebt_mark_m.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,61 @@
+/*
+ * ebt_mark_m
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebt_pkttype.c linux/net/bridge/netfilter/ebt_pkttype.c
+--- linux.stock/net/bridge/netfilter/ebt_pkttype.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/ebt_pkttype.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,60 @@
+/*
+ * ebt_pkttype
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebt_redirect.c linux/net/bridge/netfilter/ebt_redirect.c
+--- linux.stock/net/bridge/netfilter/ebt_redirect.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/ebt_redirect.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,71 @@
+/*
+ * ebt_redirect
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebt_snat.c linux/net/bridge/netfilter/ebt_snat.c
+--- linux.stock/net/bridge/netfilter/ebt_snat.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/ebt_snat.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,64 @@
+/*
+ * ebt_snat
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebt_stp.c linux/net/bridge/netfilter/ebt_stp.c
+--- linux.stock/net/bridge/netfilter/ebt_stp.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/ebt_stp.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,191 @@
+/*
+ * ebt_stp
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebt_vlan.c linux/net/bridge/netfilter/ebt_vlan.c
+--- linux.stock/net/bridge/netfilter/ebt_vlan.c 1969-12-31 19:00:00.000000000 -0500
++++ 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.
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebtable_broute.c linux/net/bridge/netfilter/ebtable_broute.c
+--- linux.stock/net/bridge/netfilter/ebtable_broute.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/ebtable_broute.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,79 @@
+/*
+ * ebtable_broute
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebtable_filter.c linux/net/bridge/netfilter/ebtable_filter.c
+--- linux.stock/net/bridge/netfilter/ebtable_filter.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/ebtable_filter.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,90 @@
+/*
+ * ebtable_filter
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebtable_nat.c linux/net/bridge/netfilter/ebtable_nat.c
+--- linux.stock/net/bridge/netfilter/ebtable_nat.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/ebtable_nat.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,96 @@
+/*
+ * ebtable_nat
+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
+diff -Nurb linux.stock/net/bridge/netfilter/ebtables.c linux/net/bridge/netfilter/ebtables.c
+--- linux.stock/net/bridge/netfilter/ebtables.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/bridge/netfilter/ebtables.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,1490 @@
+/*
+ * ebtables
+module_init(init);
+module_exit(fini);
+MODULE_LICENSE("GPL");
-diff -Nurb src/linux/linux.stock/net/core/dev.c src/linux/linux/net/core/dev.c
---- src/linux/linux.stock/net/core/dev.c 2003-10-14 04:02:55.000000000 -0400
-+++ src/linux/linux/net/core/dev.c 2004-07-10 23:46:39.000000000 -0400
+diff -Nurb linux.stock/net/core/dev.c linux/net/core/dev.c
+--- linux.stock/net/core/dev.c 2003-10-14 04:02:55.000000000 -0400
++++ linux/net/core/dev.c 2004-07-10 23:46:39.000000000 -0400
@@ -1393,7 +1393,7 @@
}
#endif
-diff -Nurb src/linux/linux.stock/net/core/netfilter.c src/linux/linux/net/core/netfilter.c
---- src/linux/linux.stock/net/core/netfilter.c 2004-07-10 23:29:56.000000000 -0400
-+++ src/linux/linux/net/core/netfilter.c 2004-07-10 23:46:39.000000000 -0400
+diff -Nurb linux.stock/net/core/netfilter.c linux/net/core/netfilter.c
+--- linux.stock/net/core/netfilter.c 2004-07-10 23:29:56.000000000 -0400
++++ linux/net/core/netfilter.c 2004-07-10 23:46:39.000000000 -0400
@@ -344,10 +344,15 @@
const struct net_device *indev,
const struct net_device *outdev,
}
switch (verdict) {
-diff -Nurb src/linux/linux.stock/net/core/skbuff.c src/linux/linux/net/core/skbuff.c
---- src/linux/linux.stock/net/core/skbuff.c 2003-10-14 04:09:32.000000000 -0400
-+++ src/linux/linux/net/core/skbuff.c 2004-07-10 23:46:39.000000000 -0400
+diff -Nurb linux.stock/net/core/skbuff.c linux/net/core/skbuff.c
+--- linux.stock/net/core/skbuff.c 2003-10-14 04:09:32.000000000 -0400
++++ linux/net/core/skbuff.c 2004-07-10 23:46:39.000000000 -0400
@@ -244,6 +244,9 @@
#ifdef CONFIG_NETFILTER_DEBUG
skb->nf_debug = 0;
BUG();
copy_skb_header(n, skb);
-diff -Nurb src/linux/linux.stock/net/ipv4/ip_output.c src/linux/linux/net/ipv4/ip_output.c
---- src/linux/linux.stock/net/ipv4/ip_output.c 2003-10-14 04:09:33.000000000 -0400
-+++ src/linux/linux/net/ipv4/ip_output.c 2004-07-10 23:46:39.000000000 -0400
+diff -Nurb linux.stock/net/ipv4/ip_output.c linux/net/ipv4/ip_output.c
+--- linux.stock/net/ipv4/ip_output.c 2003-10-14 04:09:33.000000000 -0400
++++ linux/net/ipv4/ip_output.c 2004-07-10 23:46:39.000000000 -0400
@@ -879,6 +879,10 @@
/* Connection association is same as pre-frag packet */
skb2->nfct = skb->nfct;
#ifdef CONFIG_NETFILTER_DEBUG
skb2->nf_debug = skb->nf_debug;
#endif
-diff -Nurb src/linux/linux.stock/net/ipv4/netfilter/Config.in src/linux/linux/net/ipv4/netfilter/Config.in
---- src/linux/linux.stock/net/ipv4/netfilter/Config.in 2004-07-10 23:30:19.000000000 -0400
-+++ src/linux/linux/net/ipv4/netfilter/Config.in 2004-07-10 23:46:39.000000000 -0400
+diff -Nurb linux.stock/net/ipv4/netfilter/Config.in linux/net/ipv4/netfilter/Config.in
+--- linux.stock/net/ipv4/netfilter/Config.in 2004-07-10 23:30:19.000000000 -0400
++++ linux/net/ipv4/netfilter/Config.in 2004-07-10 23:46:39.000000000 -0400
@@ -83,6 +83,9 @@
dep_tristate ' String match support (EXPERIMENTAL)' CONFIG_IP_NF_MATCH_STRING $CONFIG_IP_NF_IPTABLES
dep_tristate ' Owner match support (EXPERIMENTAL)' CONFIG_IP_NF_MATCH_OWNER $CONFIG_IP_NF_IPTABLES
# The targets
dep_tristate ' Packet filtering' CONFIG_IP_NF_FILTER $CONFIG_IP_NF_IPTABLES
if [ "$CONFIG_IP_NF_FILTER" != "n" ]; then
-diff -Nurb src/linux/linux.stock/net/ipv4/netfilter/Makefile src/linux/linux/net/ipv4/netfilter/Makefile
---- src/linux/linux.stock/net/ipv4/netfilter/Makefile 2004-07-10 23:30:19.000000000 -0400
-+++ src/linux/linux/net/ipv4/netfilter/Makefile 2004-07-10 23:46:39.000000000 -0400
+diff -Nurb linux.stock/net/ipv4/netfilter/Makefile linux/net/ipv4/netfilter/Makefile
+--- linux.stock/net/ipv4/netfilter/Makefile 2004-07-10 23:30:19.000000000 -0400
++++ linux/net/ipv4/netfilter/Makefile 2004-07-10 23:46:39.000000000 -0400
@@ -149,6 +149,8 @@
obj-$(CONFIG_IP_NF_MATCH_TCPMSS) += ipt_tcpmss.o
obj-$(CONFIG_IP_NF_MATCH_REALM) += ipt_realm.o
# targets
obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o
obj-$(CONFIG_IP_NF_TARGET_MIRROR) += ipt_MIRROR.o
-diff -Nurb src/linux/linux.stock/net/ipv4/netfilter/ip_tables.c src/linux/linux/net/ipv4/netfilter/ip_tables.c
---- src/linux/linux.stock/net/ipv4/netfilter/ip_tables.c 2004-07-10 23:29:53.000000000 -0400
-+++ src/linux/linux/net/ipv4/netfilter/ip_tables.c 2004-07-10 23:46:39.000000000 -0400
+diff -Nurb linux.stock/net/ipv4/netfilter/ip_tables.c linux/net/ipv4/netfilter/ip_tables.c
+--- linux.stock/net/ipv4/netfilter/ip_tables.c 2004-07-10 23:29:53.000000000 -0400
++++ linux/net/ipv4/netfilter/ip_tables.c 2004-07-10 23:46:39.000000000 -0400
@@ -121,12 +121,19 @@
static inline int
ip_packet_match(const struct iphdr *ip,
struct ipt_entry_target *t;
if (IPT_MATCH_ITERATE(e, do_match,
-diff -Nurb src/linux/linux.stock/net/ipv4/netfilter/ipt_LOG.c src/linux/linux/net/ipv4/netfilter/ipt_LOG.c
---- src/linux/linux.stock/net/ipv4/netfilter/ipt_LOG.c 2004-07-10 23:29:56.000000000 -0400
-+++ src/linux/linux/net/ipv4/netfilter/ipt_LOG.c 2004-07-10 23:46:39.000000000 -0400
+diff -Nurb linux.stock/net/ipv4/netfilter/ipt_LOG.c linux/net/ipv4/netfilter/ipt_LOG.c
+--- linux.stock/net/ipv4/netfilter/ipt_LOG.c 2004-07-10 23:29:56.000000000 -0400
++++ linux/net/ipv4/netfilter/ipt_LOG.c 2004-07-10 23:46:39.000000000 -0400
@@ -319,6 +319,18 @@
prefix == NULL ? loginfo->prefix : prefix,
in ? in->name : "",
if (in && !out) {
/* MAC logging for input chain only. */
printk("MAC=");
-diff -Nurb src/linux/linux.stock/net/ipv4/netfilter/ipt_physdev.c src/linux/linux/net/ipv4/netfilter/ipt_physdev.c
---- src/linux/linux.stock/net/ipv4/netfilter/ipt_physdev.c 1969-12-31 19:00:00.000000000 -0500
-+++ src/linux/linux/net/ipv4/netfilter/ipt_physdev.c 2004-07-10 23:46:39.000000000 -0400
+diff -Nurb linux.stock/net/ipv4/netfilter/ipt_physdev.c linux/net/ipv4/netfilter/ipt_physdev.c
+--- linux.stock/net/ipv4/netfilter/ipt_physdev.c 1969-12-31 19:00:00.000000000 -0500
++++ linux/net/ipv4/netfilter/ipt_physdev.c 2004-07-10 23:46:39.000000000 -0400
@@ -0,0 +1,127 @@
+/* Kernel module to match the bridge port in and
+ * out device for IP packets coming into contact with a bridge. */
--- /dev/null
+diff -ruN linux-2.4.21.orig/drivers/net/Config.in linux-2.4.21/drivers/net/Config.in
+--- linux-2.4.21.orig/drivers/net/Config.in 2003-06-13 16:51:34.000000000 +0200
++++ linux-2.4.21/drivers/net/Config.in 2003-07-08 07:27:10.000000000 +0200
+@@ -301,6 +301,7 @@
+ dep_tristate ' PPP support for sync tty ports' CONFIG_PPP_SYNC_TTY $CONFIG_PPP
+ dep_tristate ' PPP Deflate compression' CONFIG_PPP_DEFLATE $CONFIG_PPP
+ dep_tristate ' PPP BSD-Compress compression' CONFIG_PPP_BSDCOMP $CONFIG_PPP
++ dep_tristate ' Microsoft PPP compression/encryption (MPPC/MPPE)' CONFIG_PPP_MPPE $CONFIG_PPP
+ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ dep_tristate ' PPP over Ethernet (EXPERIMENTAL)' CONFIG_PPPOE $CONFIG_PPP
+ fi
+diff -ruN linux-2.4.21.orig/drivers/net/Makefile linux-2.4.21/drivers/net/Makefile
+--- linux-2.4.21.orig/drivers/net/Makefile 2003-06-13 16:51:34.000000000 +0200
++++ linux-2.4.21/drivers/net/Makefile 2003-07-14 23:53:15.000000000 +0200
+@@ -18,8 +18,9 @@
+ export-objs := 8390.o arlan.o aironet4500_core.o aironet4500_card.o \
+ ppp_async.o ppp_generic.o slhc.o pppox.o auto_irq.o \
+ net_init.o mii.o
+-list-multi := rcpci.o
++list-multi := rcpci.o ppp_mppe_mppc.o
+ rcpci-objs := rcpci45.o rclanmtl.o
++ppp_mppe_c-objs := ppp_mppe_mppc_comp.o ppp_mppe_crypto.o
+
+ ifeq ($(CONFIG_TULIP),y)
+ obj-y += tulip/tulip.o
+@@ -149,6 +150,15 @@
+ obj-$(CONFIG_PPP_SYNC_TTY) += ppp_synctty.o
+ obj-$(CONFIG_PPP_DEFLATE) += ppp_deflate.o
+ obj-$(CONFIG_PPP_BSDCOMP) += bsd_comp.o
++
++ifeq ($(CONFIG_PPP_MPPE),y)
++ obj-y += $(ppp_mppe_c-objs)
++else
++ ifeq ($(CONFIG_PPP_MPPE),m)
++ obj-m += ppp_mppe_mppc.o
++ endif
++endif
++
+ obj-$(CONFIG_PPPOE) += pppox.o pppoe.o
+
+ obj-$(CONFIG_SLIP) += slip.o
+@@ -258,3 +268,5 @@
+ rcpci.o: $(rcpci-objs)
+ $(LD) -r -o $@ $(rcpci-objs)
+
++ppp_mppe_mppc.o: $(ppp_mppe_c-objs)
++ $(LD) -r -o $@ $(ppp_mppe_c-objs)
+diff -ruN linux-2.4.21.orig/drivers/net/ppp_generic.c linux-2.4.21/drivers/net/ppp_generic.c
+--- linux-2.4.21.orig/drivers/net/ppp_generic.c 2003-06-13 16:51:35.000000000 +0200
++++ linux-2.4.21/drivers/net/ppp_generic.c 2003-07-12 04:39:03.000000000 +0200
+@@ -19,7 +19,7 @@
+ * PPP driver, written by Michael Callahan and Al Longyear, and
+ * subsequently hacked by Paul Mackerras.
+ *
+- * ==FILEVERSION 20020217==
++ * ==FILEVERSION 20030706==
+ */
+
+ #include <linux/config.h>
+@@ -102,6 +102,7 @@
+ spinlock_t rlock; /* lock for receive side 58 */
+ spinlock_t wlock; /* lock for transmit side 5c */
+ int mru; /* max receive unit 60 */
++ int mru_alloc; /* MAX(1500,MRU) for dev_alloc_skb() */
+ unsigned int flags; /* control bits 64 */
+ unsigned int xstate; /* transmit state bits 68 */
+ unsigned int rstate; /* receive state bits 6c */
+@@ -129,6 +130,7 @@
+ struct sock_fprog pass_filter; /* filter for packets to pass */
+ struct sock_fprog active_filter;/* filter for pkts to reset idle */
+ #endif /* CONFIG_PPP_FILTER */
++ int xpad; /* ECP or CCP (MPPE) transmit padding */
+ };
+
+ /*
+@@ -552,7 +554,9 @@
+ case PPPIOCSMRU:
+ if (get_user(val, (int *) arg))
+ break;
+- ppp->mru = val;
++ ppp->mru_alloc = ppp->mru = val;
++ if (ppp->mru_alloc < PPP_MRU)
++ ppp->mru_alloc = PPP_MRU; /* increase for broken peers */
+ err = 0;
+ break;
+
+@@ -1023,14 +1027,35 @@
+ case PPP_CCP:
+ /* peek at outbound CCP frames */
+ ppp_ccp_peek(ppp, skb, 0);
++ /*
++ * When LZS or MPPE/MPPC is negotiated we don't send
++ * CCP_RESETACK after receiving CCP_RESETREQ; in fact pppd
++ * sends such a packet but we silently discard it here
++ */
++ if (CCP_CODE(skb->data+2) == CCP_RESETACK
++ && (ppp->xcomp->compress_proto == CI_MPPE
++ || ppp->xcomp->compress_proto == CI_LZS)) {
++ --ppp->stats.tx_packets;
++ ppp->stats.tx_bytes -= skb->len - 2;
++ kfree_skb(skb);
++ return;
++ }
+ break;
+ }
+
+ /* try to do packet compression */
+ if ((ppp->xstate & SC_COMP_RUN) && ppp->xc_state != 0
+ && proto != PPP_LCP && proto != PPP_CCP) {
+- new_skb = alloc_skb(ppp->dev->mtu + ppp->dev->hard_header_len,
+- GFP_ATOMIC);
++ int comp_ovhd = 0;
++ /* because of possible data expansion when MPPC or LZS
++ is used, allocate compressor's buffer about 12.5% bigger
++ than MTU */
++ if (ppp->xcomp->compress_proto == CI_MPPE)
++ comp_ovhd = (((ppp->dev->mtu * 9) / 8) + 1);
++ else if (ppp->xcomp->compress_proto == CI_LZS)
++ comp_ovhd = (((ppp->dev->mtu * 9) / 8) + 1) + LZS_OVHD;
++ new_skb = alloc_skb(ppp->dev->mtu + ppp->dev->hard_header_len
++ + ppp->xpad + comp_ovhd, GFP_ATOMIC);
+ if (new_skb == 0) {
+ printk(KERN_ERR "PPP: no memory (comp pkt)\n");
+ goto drop;
+@@ -1042,15 +1067,28 @@
+ /* compressor still expects A/C bytes in hdr */
+ len = ppp->xcomp->compress(ppp->xc_state, skb->data - 2,
+ new_skb->data, skb->len + 2,
+- ppp->dev->mtu + PPP_HDRLEN);
++ ppp->dev->mtu + ppp->xpad
++ + PPP_HDRLEN);
+ if (len > 0 && (ppp->flags & SC_CCP_UP)) {
+ kfree_skb(skb);
+ skb = new_skb;
+ skb_put(skb, len);
+ skb_pull(skb, 2); /* pull off A/C bytes */
+- } else {
++ } else if (len == 0) {
+ /* didn't compress, or CCP not up yet */
+ kfree_skb(new_skb);
++ } else {
++ /*
++ * (len < 0)
++ * MPPE requires that we do not send unencrypted
++ * frames. The compressor will return -1 if we
++ * should drop the frame. We cannot simply test
++ * the compress_proto because MPPE and MPPC share
++ * the same number.
++ */
++ printk(KERN_ERR "ppp: compressor dropped pkt\n");
++ kfree_skb(new_skb);
++ goto drop;
+ }
+ }
+
+@@ -1538,14 +1576,15 @@
+ int len;
+
+ if (proto == PPP_COMP) {
+- ns = dev_alloc_skb(ppp->mru + PPP_HDRLEN);
++ ns = dev_alloc_skb(ppp->mru_alloc + PPP_HDRLEN);
+ if (ns == 0) {
+ printk(KERN_ERR "ppp_decompress_frame: no memory\n");
+ goto err;
+ }
+ /* the decompressor still expects the A/C bytes in the hdr */
+ len = ppp->rcomp->decompress(ppp->rc_state, skb->data - 2,
+- skb->len + 2, ns->data, ppp->mru + PPP_HDRLEN);
++ skb->len + 2, ns->data,
++ ppp->mru_alloc + PPP_HDRLEN);
+ if (len < 0) {
+ /* Pass the compressed frame to pppd as an
+ error indication. */
+@@ -1571,7 +1610,12 @@
+ return skb;
+
+ err:
+- ppp->rstate |= SC_DC_ERROR;
++ if (ppp->rcomp->compress_proto != CI_MPPE
++ && ppp->rcomp->compress_proto != CI_LZS) {
++ /* If decompression protocol isn't MPPE/MPPC or LZS, we set
++ SC_DC_ERROR flag and wait for CCP_RESETACK */
++ ppp->rstate |= SC_DC_ERROR;
++ }
+ ppp_receive_error(ppp);
+ return skb;
+ }
+@@ -1980,6 +2024,20 @@
+ ocomp->comp_free(ostate);
+ err = 0;
+ }
++ if (ccp_option[0] == CI_MPPE)
++ /*
++ * pppd (userland) has reduced the MTU by MPPE_PAD,
++ * to accomodate "compressor" growth. We must
++ * increase the space allocated for compressor
++ * output in ppp_send_frame() accordingly. Note
++ * that from a purist's view, it may be more correct
++ * to require multilink and fragment large packets,
++ * but that seems inefficient compared to this
++ * little trick.
++ */
++ ppp->xpad = MPPE_PAD;
++ else
++ ppp->xpad = 0;
+
+ } else {
+ state = cp->decomp_alloc(ccp_option, data.length);
+@@ -2251,6 +2309,7 @@
+ /* Initialize the new ppp unit */
+ ppp->file.index = unit;
+ ppp->mru = PPP_MRU;
++ ppp->mru_alloc = PPP_MRU;
+ init_ppp_file(&ppp->file, INTERFACE);
+ ppp->file.hdrlen = PPP_HDRLEN - 2; /* don't count proto bytes */
+ for (i = 0; i < NUM_NP; ++i)
+diff -ruN linux-2.4.21.orig/drivers/net/ppp_mppe_crypto.c linux-2.4.21/drivers/net/ppp_mppe_crypto.c
+--- linux-2.4.21.orig/drivers/net/ppp_mppe_crypto.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.4.21/drivers/net/ppp_mppe_crypto.c 2003-07-08 19:07:18.000000000 +0200
+@@ -0,0 +1,257 @@
++/*
++ * ppp_mppe_crypto.c - cryptografic funtions for MPPE
++ *
++ * This code is Public Domain. Please see comments below.
++ *
++ * I have just put SHA1 and ARCFOUR implementations into one file
++ * in order to not pollute kernel namespace.
++ *
++ * Jan Dubiec <jdx@slackware.pl>, 2003-07-08
++ */
++
++/*
++ * ftp://ftp.funet.fi/pub/crypt/hash/sha/sha1.c
++ *
++ * SHA-1 in C
++ * By Steve Reid <steve@edmweb.com>
++ * 100% Public Domain
++ *
++ * Test Vectors (from FIPS PUB 180-1)
++ * "abc"
++ * A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
++ * "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
++ * 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1
++ * A million repetitions of "a"
++ * 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
++ */
++
++/* #define SHA1HANDSOFF * Copies data before messing with it. */
++
++#if defined(__linux__)
++#include <asm/byteorder.h>
++#include <linux/string.h>
++#elif defined(__solaris__)
++#include <sys/isa_defs.h>
++#include <sys/ddi.h>
++#include <sys/sunddi.h>
++#define memcpy(d, s, c) bcopy(s, d, c)
++#define memset(d, b, c) bzero(d, c)
++#endif
++
++#include "ppp_mppe_crypto.h"
++
++static void SHA1_Transform(unsigned long[5], const unsigned char[64]);
++
++#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
++
++/* blk0() and blk() perform the initial expand. */
++/* I got the idea of expanding during the round function from SSLeay */
++#if defined(__LITTLE_ENDIAN) || defined(_LITTLE_ENDIAN)
++#define blk0(i) (block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \
++ |(rol(block->l[i],8)&0x00FF00FF))
++#elif defined(__BIG_ENDIAN) || defined(_BIG_ENDIAN)
++#define blk0(i) block->l[i]
++#else
++#error Endianness not defined
++#endif
++#define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \
++ ^block->l[(i+2)&15]^block->l[i&15],1))
++
++/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
++#define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30);
++#define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30);
++#define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30);
++#define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30);
++#define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30);
++
++/* Hash a single 512-bit block. This is the core of the algorithm. */
++static void
++SHA1_Transform(unsigned long state[5], const unsigned char buffer[64])
++{
++ unsigned long a, b, c, d, e;
++ typedef union {
++ unsigned char c[64];
++ unsigned long l[16];
++ } CHAR64LONG16;
++ CHAR64LONG16 *block;
++
++#ifdef SHA1HANDSOFF
++ static unsigned char workspace[64];
++ block = (CHAR64LONG16 *) workspace;
++ memcpy(block, buffer, 64);
++#else
++ block = (CHAR64LONG16 *) buffer;
++#endif
++ /* Copy context->state[] to working vars */
++ a = state[0];
++ b = state[1];
++ c = state[2];
++ d = state[3];
++ e = state[4];
++ /* 4 rounds of 20 operations each. Loop unrolled. */
++ R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3);
++ R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7);
++ R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11);
++ R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15);
++ R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19);
++ R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23);
++ R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27);
++ R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31);
++ R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35);
++ R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39);
++ R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43);
++ R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47);
++ R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51);
++ R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55);
++ R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59);
++ R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63);
++ R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67);
++ R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71);
++ R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75);
++ R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79);
++ /* Add the working vars back into context.state[] */
++ state[0] += a;
++ state[1] += b;
++ state[2] += c;
++ state[3] += d;
++ state[4] += e;
++ /* Wipe variables */
++ a = b = c = d = e = 0;
++}
++
++/* SHA1Init - Initialize new context */
++void
++SHA1_Init(SHA1_CTX *context)
++{
++ /* SHA1 initialization constants */
++ context->state[0] = 0x67452301;
++ context->state[1] = 0xEFCDAB89;
++ context->state[2] = 0x98BADCFE;
++ context->state[3] = 0x10325476;
++ context->state[4] = 0xC3D2E1F0;
++ context->count[0] = context->count[1] = 0;
++}
++
++/* Run your data through this. */
++void
++SHA1_Update(SHA1_CTX *context, const unsigned char *data, unsigned int len)
++{
++ unsigned int i, j;
++
++ j = (context->count[0] >> 3) & 63;
++ if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++;
++ context->count[1] += (len >> 29);
++ if ((j + len) > 63) {
++ memcpy(&context->buffer[j], data, (i = 64-j));
++ SHA1_Transform(context->state, context->buffer);
++ for ( ; i + 63 < len; i += 64) {
++ SHA1_Transform(context->state, &data[i]);
++ }
++ j = 0;
++ }
++ else
++ i = 0;
++
++ memcpy(&context->buffer[j], &data[i], len - i);
++}
++
++/* Add padding and return the message digest. */
++void
++SHA1_Final(unsigned char digest[20], SHA1_CTX *context)
++{
++ unsigned long i, j;
++ unsigned char finalcount[8];
++
++ for (i = 0; i < 8; i++) {
++ finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)]
++ >> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */
++ }
++ SHA1_Update(context, (unsigned char *) "\200", 1);
++ while ((context->count[0] & 504) != 448) {
++ SHA1_Update(context, (unsigned char *) "\0", 1);
++ }
++ SHA1_Update(context, finalcount, 8); /* Should cause a SHA1Transform() */
++ for (i = 0; i < 20; i++) {
++ digest[i] = (unsigned char)
++ ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
++ }
++ /* Wipe variables */
++ i = j = 0;
++ memset(context->buffer, 0, 64);
++ memset(context->state, 0, 20);
++ memset(context->count, 0, 8);
++ memset(&finalcount, 0, 8);
++#ifdef SHA1HANDSOFF /* make SHA1Transform overwrite it's own static vars */
++ SHA1Transform(context->state, context->buffer);
++#endif
++}
++
++/*
++ * arcfour.c
++ * by Frank Cusack <frank@google.com>
++ * 100% public domain
++ *
++ * Implemented from the description in _Applied Cryptography_, 2nd ed.
++ *
++ * ** Distribution ** of this software is unlimited and unrestricted.
++ *
++ * ** Use ** of this software is almost certainly legal; however, refer
++ * to <http://theory.lcs.mit.edu/~rivest/faq.html>.
++ */
++
++#define swap(a, b) \
++{ \
++ unsigned char t = b; \
++ b = a; \
++ a = t; \
++}
++
++/*
++ * Initialize arcfour from a key.
++ */
++void
++arcfour_setkey(arcfour_context *context, const unsigned char *key,
++ unsigned keylen)
++{
++ unsigned i, j;
++ unsigned char K[256];
++
++ context->i = context->j = 0;
++
++ for (i = 0; i < 256; i++) {
++ context->S[i] = i;
++ K[i] = key[i % keylen];
++ }
++
++ j = 0;
++ for (i = 0; i < 256; i++) {
++ j = (j + context->S[i] + K[i]) % 256;
++ swap(context->S[i], context->S[j]);
++ }
++
++ memset(K, 0, sizeof(K));
++}
++
++/*
++ * plaintext -> ciphertext (or vice versa)
++ */
++void
++arcfour_encrypt(arcfour_context *context, const unsigned char *in, unsigned len,
++ unsigned char *out)
++{
++ unsigned i = context->i;
++ unsigned j = context->j;
++ unsigned char *S = context->S;
++ unsigned char K;
++
++ while (len--) {
++ i = (i + 1) % 256;
++ j = (j + S[i]) % 256;
++ swap(S[i], S[j]);
++ K = S[(S[i] + S[j]) % 256];
++ *out++ = *in++ ^ K;
++ }
++
++ context->i = i;
++ context->j = j;
++}
+diff -ruN linux-2.4.21.orig/drivers/net/ppp_mppe_crypto.h linux-2.4.21/drivers/net/ppp_mppe_crypto.h
+--- linux-2.4.21.orig/drivers/net/ppp_mppe_crypto.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.4.21/drivers/net/ppp_mppe_crypto.h 2003-07-08 19:07:25.000000000 +0200
+@@ -0,0 +1,40 @@
++/*
++ * ppp_mppe_crypto.h - cryptografic funtion prototypes for MPPE
++ *
++ * This code is Public Domain. Please see comments below.
++ *
++ * I have just put SHA1 and ARCFOUR declarations into one file
++ * in order to not pollute kernel namespace.
++ *
++ * Jan Dubiec <jdx@slackware.pl>, 2003-07-08
++ */
++
++#ifndef _PPP_MPPE_CRYPTO_
++#define _PPP_MPPE_CRYPTO_
++
++/* SHA1 definitions and prototypes */
++typedef struct {
++ unsigned long state[5];
++ unsigned long count[2];
++ unsigned char buffer[64];
++} SHA1_CTX;
++
++#define SHA1_SIGNATURE_SIZE 20
++
++extern void SHA1_Init(SHA1_CTX *);
++extern void SHA1_Update(SHA1_CTX *, const unsigned char *, unsigned int);
++extern void SHA1_Final(unsigned char[SHA1_SIGNATURE_SIZE], SHA1_CTX *);
++
++/* ARCFOUR (aka RC4) definitions and prototypes */
++typedef struct {
++ unsigned i;
++ unsigned j;
++ unsigned char S[256];
++} arcfour_context;
++
++extern void arcfour_setkey(arcfour_context *, const unsigned char *, unsigned);
++extern void arcfour_encrypt(arcfour_context *, const unsigned char *, unsigned,
++ unsigned char *);
++#define arcfour_decrypt arcfour_encrypt
++
++#endif /* _PPP_MPPE_CRYPTO_ */
+diff -ruN linux-2.4.21.orig/drivers/net/ppp_mppe_mppc_comp.c linux-2.4.21/drivers/net/ppp_mppe_mppc_comp.c
+--- linux-2.4.21.orig/drivers/net/ppp_mppe_mppc_comp.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.4.21/drivers/net/ppp_mppe_mppc_comp.c 2003-08-07 22:36:59.000000000 +0200
+@@ -0,0 +1,1144 @@
++/*
++ * ppp_mppe_mppc_comp.c - MPPC/MPPE "compressor/decompressor" module.
++ *
++ * Copyright (c) 1994 Árpád Magosányi <mag@bunuel.tii.matav.hu>
++ * Copyright (c) 1999 Tim Hockin, Cobalt Networks Inc. <thockin@cobaltnet.com>
++ * Copyright (c) 2002, 2003 Jan Dubiec <jdx@slackware.pl>
++ *
++ * Permission to use, copy, modify, and distribute this software and its
++ * documentation is hereby granted, provided that the above copyright
++ * notice appears in all copies. This software is provided without any
++ * warranty, express or implied.
++ *
++ * The code is based on MPPE kernel module written by Árpád Magosányi and
++ * Tim Hockin which can be found on http://planetmirror.com/pub/mppe/.
++ * I have added MPPC and 56 bit session keys support in MPPE.
++ *
++ * WARNING! Although this is open source code, its usage in some countries
++ * (in particular in the USA) may violate Stac Inc. patent for MPPC.
++ *
++ * Compile command:
++ * gcc -O2 -Wall -I/usr/src/linux/include -D__KERNEL__ -DMODULE -c ppp_mppe_mppc_comp.c
++ *
++ * ==FILEVERSION 20030807==
++ *
++ */
++
++#include <linux/module.h>
++#include <linux/slab.h>
++#include <linux/vmalloc.h>
++#include <linux/init.h>
++
++#include <linux/ppp_defs.h>
++#include <linux/ppp-comp.h>
++
++#include "ppp_mppe_crypto.h"
++
++/*
++ * State for a mppc/mppe "(de)compressor".
++ */
++struct ppp_mppe_state {
++ arcfour_context arcfour_context;
++ u8 master_key[MPPE_MAX_KEY_LEN];
++ u8 session_key[MPPE_MAX_KEY_LEN];
++ u8 mppc; /* do we use compression (MPPC)? */
++ u8 mppe; /* do we use encryption (MPPE)? */
++ u8 keylen; /* key length in bytes */
++ u8 bitkeylen; /* key length in bits */
++ u16 ccount; /* coherency counter */
++ u16 bits; /* MPPC/MPPE control bits */
++ u8 stateless; /* do we use stateless mode? */
++ u8 nextflushed; /* set A bit in the next outgoing packet;
++ used only by compressor*/
++ u8 flushexpected; /* drop packets until A bit is received;
++ used only by decompressor*/
++ u8 *hist; /* MPPC history */
++ u16 *hash; /* Hash table; used only by compressor */
++ u16 histptr; /* history "cursor" */
++ int unit;
++ int debug;
++ int mru;
++ struct compstat stats;
++};
++
++#define MPPE_OVHD 2 /* MPPE overhead */
++#define MPPE_HIST_LEN 8192 /* MPPC history size */
++#define MPPE_MAX_CCOUNT 0x0FFF /* max. coherency counter value */
++
++#define MPPE_BIT_FLUSHED 0x80 /* bit A */
++#define MPPE_BIT_RESET 0x40 /* bit B */
++#define MPPE_BIT_COMP 0x20 /* bit C */
++#define MPPE_BIT_ENCRYPTED 0x10 /* bit D */
++
++#define MPPE_SALT0 0xD1 /* values used in MPPE key derivation */
++#define MPPE_SALT1 0x26 /* according to RFC3079 */
++#define MPPE_SALT2 0x9E
++
++#define MPPE_CCOUNT(x) ((((x)[4] & 0x0f) << 8) + (x)[5])
++#define MPPE_BITS(x) ((x)[4] & 0xf0)
++#define MPPE_CTRLHI(x) ((((x)->ccount & 0xf00)>>8)|((x)->bits))
++#define MPPE_CTRLLO(x) ((x)->ccount & 0xff)
++
++/*
++ * Key Derivation, from RFC 3078, RFC 3079.
++ * Equivalent to Get_Key() for MS-CHAP as described in RFC 3079.
++ */
++static void
++GetNewKeyFromSHA(unsigned char *MasterKey, unsigned char *SessionKey,
++ unsigned long SessionKeyLength, unsigned char *InterimKey)
++{
++ /*Pads used in key derivation */
++ static unsigned char SHAPad1[40] =
++ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
++
++ static unsigned char SHAPad2[40] =
++ { 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2,
++ 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2,
++ 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2,
++ 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2 };
++
++ SHA1_CTX Context;
++ unsigned char Digest[SHA1_SIGNATURE_SIZE];
++
++ SHA1_Init(&Context);
++ SHA1_Update(&Context, MasterKey, SessionKeyLength);
++ SHA1_Update(&Context, SHAPad1, sizeof(SHAPad1));
++ SHA1_Update(&Context, SessionKey, SessionKeyLength);
++ SHA1_Update(&Context, SHAPad2, sizeof(SHAPad2));
++ SHA1_Final(Digest,&Context);
++ memcpy(InterimKey, Digest, SessionKeyLength);
++}
++
++static void
++mppe_change_key(struct ppp_mppe_state *state, int initialize)
++{
++ unsigned char InterimKey[MPPE_MAX_KEY_LEN];
++
++ GetNewKeyFromSHA(state->master_key, state->session_key,
++ state->keylen, InterimKey);
++ if (initialize) {
++ memcpy(state->session_key, InterimKey, state->keylen);
++ } else {
++ arcfour_setkey(&state->arcfour_context, InterimKey, state->keylen);
++ arcfour_encrypt(&state->arcfour_context, InterimKey, state->keylen,
++ state->session_key);
++ }
++ if (state->keylen == 8) {
++ if (state->bitkeylen == 40) {
++ state->session_key[0] = MPPE_SALT0;
++ state->session_key[1] = MPPE_SALT1;
++ state->session_key[2] = MPPE_SALT2;
++ } else {
++ state->session_key[0] = MPPE_SALT0;
++ }
++ }
++ arcfour_setkey(&state->arcfour_context, state->session_key, state->keylen);
++}
++
++/* increase 12-bit coherency counter */
++static inline void
++mppe_increase_ccount(struct ppp_mppe_state *state)
++{
++ state->ccount = (state->ccount + 1) & MPPE_MAX_CCOUNT;
++ if (state->mppe) {
++ if (state->stateless) {
++ mppe_change_key(state, 0);
++ state->nextflushed = 1;
++ } else {
++ if ((state->ccount & 0xff) == 0xff) {
++ mppe_change_key(state, 0);
++ state->nextflushed = 1;
++ }
++ }
++ }
++}
++
++/* allocate space for a MPPE/MPPC (de)compressor. */
++/* comp != 0 -> init compressor */
++/* comp = 0 -> init decompressor */
++static void *
++mppe_alloc(unsigned char *options, int opt_len, int comp)
++{
++ struct ppp_mppe_state *state;
++ u8* fname;
++
++ fname = comp ? "mppe_comp_alloc" : "mppe_decomp_alloc";
++
++ /*
++ Hack warning - additionally to the standard MPPC/MPPE configuration
++ options, pppd passes to the (de)copressor 8 or 16 byte session key.
++ Therefore options[1] contains MPPC/MPPE configuration option length
++ (CILEN_MPPE = 6), but the real options length, depending on the key
++ length, is 6+8 or 6+16.
++ */
++ if (opt_len < CILEN_MPPE) {
++ printk(KERN_WARNING "%s: wrong options length: %u\n", fname, opt_len);
++ return NULL;
++ }
++
++ if (options[0] != CI_MPPE || options[1] != CILEN_MPPE ||
++ (options[2] & ~MPPE_STATELESS) != 0 ||
++ options[3] != 0 || options[4] != 0 ||
++ (options[5] & ~(MPPE_128BIT|MPPE_56BIT|MPPE_40BIT|MPPE_MPPC)) != 0 ||
++ (options[5] & (MPPE_128BIT|MPPE_56BIT|MPPE_40BIT|MPPE_MPPC)) == 0) {
++ printk(KERN_WARNING "%s: options rejected: o[0]=%02x, o[1]=%02x, "
++ "o[2]=%02x, o[3]=%02x, o[4]=%02x, o[5]=%02x\n", fname, options[0],
++ options[1], options[2], options[3], options[4], options[5]);
++ return NULL;
++ }
++
++ state = (struct ppp_mppe_state *)kmalloc(sizeof(*state), GFP_KERNEL);
++ if (state == NULL) {
++ printk(KERN_ERR "%s: cannot allocate space for %scompressor\n", fname,
++ comp ? "" : "de");
++ return NULL;
++ }
++ memset(state, 0, sizeof(struct ppp_mppe_state));
++
++ state->mppc = options[5] & MPPE_MPPC; /* Do we use MPPC? */
++ state->mppe = options[5] & (MPPE_128BIT | MPPE_56BIT |
++ MPPE_40BIT); /* Do we use MPPE? */
++
++ if (state->mppc) {
++ /* allocate MPPC history */
++ state->hist = (u8*)vmalloc(2*MPPE_HIST_LEN*sizeof(u8));
++ if (state->hist == NULL) {
++ kfree(state);
++ printk(KERN_ERR "%s: cannot allocate space for MPPC history\n",
++ fname);
++ return NULL;
++ }
++
++ /* allocate hashtable for MPPC compressor */
++ if (comp) {
++ state->hash = (u16*)vmalloc(MPPE_HIST_LEN*sizeof(u16));
++ if (state->hash == NULL) {
++ vfree(state->hist);
++ kfree(state);
++ printk(KERN_ERR "%s: cannot allocate space for MPPC history\n",
++ fname);
++ return NULL;
++ }
++ }
++ }
++
++ MOD_INC_USE_COUNT;
++
++ if (state->mppe) { /* specific for MPPE */
++ memcpy(state->master_key, options+CILEN_MPPE, MPPE_MAX_KEY_LEN);
++ memcpy(state->session_key, state->master_key, MPPE_MAX_KEY_LEN);
++ /* initial key generation is done in mppe_init() */
++ }
++
++ return (void *) state;
++}
++
++static void *
++mppe_comp_alloc(unsigned char *options, int opt_len)
++{
++ return mppe_alloc(options, opt_len, 1);
++}
++
++static void *
++mppe_decomp_alloc(unsigned char *options, int opt_len)
++{
++ return mppe_alloc(options, opt_len, 0);
++}
++
++/* cleanup the (de)compressor */
++static void
++mppe_comp_free(void *arg)
++{
++ struct ppp_mppe_state *state = (struct ppp_mppe_state *) arg;
++
++ if (state != NULL) {
++ if (state->hist != NULL)
++ vfree(state->hist);
++ if (state->hash != NULL)
++ vfree(state->hash);
++ kfree(state);
++ }
++ MOD_DEC_USE_COUNT;
++}
++
++/* init MPPC/MPPE (de)compresor */
++/* comp != 0 -> init compressor */
++/* comp = 0 -> init decompressor */
++static int
++mppe_init(void *arg, unsigned char *options, int opt_len, int unit,
++ int hdrlen, int mru, int debug, int comp)
++{
++ struct ppp_mppe_state *state = (struct ppp_mppe_state *) arg;
++ u8* fname;
++
++ fname = comp ? "mppe_comp_init" : "mppe_decomp_init";
++
++ if (opt_len < CILEN_MPPE) {
++ if (debug)
++ printk(KERN_WARNING "%s: wrong options length: %u\n",
++ fname, opt_len);
++ return 0;
++ }
++
++ if (options[0] != CI_MPPE || options[1] != CILEN_MPPE ||
++ (options[2] & ~MPPE_STATELESS) != 0 ||
++ options[3] != 0 || options[4] != 0 ||
++ (options[5] & ~(MPPE_56BIT|MPPE_128BIT|MPPE_40BIT|MPPE_MPPC)) != 0 ||
++ (options[5] & (MPPE_56BIT|MPPE_128BIT|MPPE_40BIT|MPPE_MPPC)) == 0) {
++ if (debug)
++ printk(KERN_WARNING "%s: options rejected: o[0]=%02x, o[1]=%02x, "
++ "o[2]=%02x, o[3]=%02x, o[4]=%02x, o[5]=%02x\n", fname,
++ options[0], options[1], options[2], options[3], options[4],
++ options[5]);
++ return 0;
++ }
++
++ if ((options[5] & ~MPPE_MPPC) != MPPE_128BIT &&
++ (options[5] & ~MPPE_MPPC) != MPPE_56BIT &&
++ (options[5] & ~MPPE_MPPC) != MPPE_40BIT &&
++ (options[5] & MPPE_MPPC) != MPPE_MPPC) {
++ if (debug)
++ printk(KERN_WARNING "%s: don't know what to do: o[5]=%02x\n",
++ fname, options[5]);
++ return 0;
++ }
++
++ state->mppc = options[5] & MPPE_MPPC; /* Do we use MPPC? */
++ state->mppe = options[5] & (MPPE_128BIT | MPPE_56BIT |
++ MPPE_40BIT); /* Do we use MPPE? */
++ state->stateless = options[2] & MPPE_STATELESS; /* Do we use stateless mode? */
++
++ switch (state->mppe) {
++ case MPPE_40BIT: /* 40 bit key */
++ state->keylen = 8;
++ state->bitkeylen = 40;
++ break;
++ case MPPE_56BIT: /* 56 bit key */
++ state->keylen = 8;
++ state->bitkeylen = 56;
++ break;
++ case MPPE_128BIT: /* 128 bit key */
++ state->keylen = 16;
++ state->bitkeylen = 128;
++ break;
++ default:
++ state->keylen = 0;
++ state->bitkeylen = 0;
++ }
++
++ state->ccount = MPPE_MAX_CCOUNT;
++ state->bits = 0;
++ state->unit = unit;
++ state->debug = debug;
++ state->histptr = MPPE_HIST_LEN;
++ if (state->mppc) { /* reset history if MPPC was negotiated */
++ memset(state->hist, 0, 2*MPPE_HIST_LEN*sizeof(u8));
++ }
++
++ if (state->mppe) { /* generate initial session keys */
++ mppe_change_key(state, 1);
++ }
++
++ if (comp) { /* specific for compressor */
++ state->nextflushed = 1;
++ } else { /* specific for decompressor */
++ state->mru = mru;
++ state->flushexpected = 1;
++ }
++
++ return 1;
++}
++
++static int
++mppe_comp_init(void *arg, unsigned char *options, int opt_len, int unit,
++ int hdrlen, int debug)
++{
++ return mppe_init(arg, options, opt_len, unit, hdrlen, 0, debug, 1);
++}
++
++
++static int
++mppe_decomp_init(void *arg, unsigned char *options, int opt_len, int unit,
++ int hdrlen, int mru, int debug)
++{
++ return mppe_init(arg, options, opt_len, unit, hdrlen, mru, debug, 0);
++}
++
++static void
++mppe_comp_reset(void *arg)
++{
++ struct ppp_mppe_state *state = (struct ppp_mppe_state *)arg;
++
++ if (state->debug)
++ printk(KERN_DEBUG "%s%d: resetting MPPC/MPPE compressor\n",
++ __FUNCTION__, state->unit);
++
++ state->nextflushed = 1;
++ if (state->mppe)
++ arcfour_setkey(&state->arcfour_context, state->session_key,
++ state->keylen);
++}
++
++static void
++mppe_decomp_reset(void *arg)
++{
++ /* When MPPC/MPPE is in use, we shouldn't receive any CCP Reset-Ack.
++ But when we receive such a packet, we just ignore it. */
++ return;
++}
++
++static void
++mppe_stats(void *arg, struct compstat *stats)
++{
++ struct ppp_mppe_state *state = (struct ppp_mppe_state *)arg;
++
++ *stats = state->stats;
++}
++
++/***************************/
++/**** Compression stuff ****/
++/***************************/
++/* inserts 1 to max. 8 bits into the output buffer */
++static inline void putbits8(u8 *buf, u32 val, const u32 n, u32 *i, u32 *l)
++{
++ buf += *i;
++ if (*l >= n) {
++ *l = (*l) - n;
++ val <<= *l;
++ *buf = *buf | (val & 0xff);
++ if (*l == 0) {
++ *l = 8;
++ (*i)++;
++ *(++buf) = 0;
++ }
++ } else {
++ (*i)++;
++ *l = 8 - n + (*l);
++ val <<= *l;
++ *buf = *buf | ((val >> 8) & 0xff);
++ *(++buf) = val & 0xff;
++ }
++}
++
++/* inserts 9 to max. 16 bits into the output buffer */
++static inline void putbits16(u8 *buf, u32 val, const u32 n, u32 *i, u32 *l)
++{
++ buf += *i;
++ if (*l >= n - 8) {
++ (*i)++;
++ *l = 8 - n + (*l);
++ val <<= *l;
++ *buf = *buf | ((val >> 8) & 0xff);
++ *(++buf) = val & 0xff;
++ if (*l == 0) {
++ *l = 8;
++ (*i)++;
++ *(++buf) = 0;
++ }
++ } else {
++ (*i)++; (*i)++;
++ *l = 16 - n + (*l);
++ val <<= *l;
++ *buf = *buf | ((val >> 16) & 0xff);
++ *(++buf) = (val >> 8) & 0xff;
++ *(++buf) = val & 0xff;
++ }
++}
++
++/* inserts 17 to max. 24 bits into the output buffer */
++static inline void putbits24(u8 *buf, u32 val, const u32 n, u32 *i, u32 *l)
++{
++ buf += *i;
++ if (*l >= n - 16) {
++ (*i)++; (*i)++;
++ *l = 16 - n + (*l);
++ val <<= *l;
++ *buf = *buf | ((val >> 16) & 0xff);
++ *(++buf) = (val >> 8) & 0xff;
++ *(++buf) = val & 0xff;
++ if (*l == 0) {
++ *l = 8;
++ (*i)++;
++ *(++buf) = 0;
++ }
++ } else {
++ (*i)++; (*i)++; (*i)++;
++ *l = 24 - n + (*l);
++ val <<= *l;
++ *buf = *buf | ((val >> 24) & 0xff);
++ *(++buf) = (val >> 16) & 0xff;
++ *(++buf) = (val >> 8) & 0xff;
++ *(++buf) = val & 0xff;
++ }
++}
++
++static int
++mppc_compress(struct ppp_mppe_state *state, unsigned char *ibuf,
++ unsigned char *obuf, int isize, int osize)
++{
++ u32 olen, off, len, idx, i, l;
++ u8 *hist, *sbuf, *p, *q, *r, *s;
++
++ /*
++ At this point, to avoid possible buffer overflow caused by packet
++ expansion during/after compression, we should make sure that
++ osize >= (((isize*9)/8)+1)+2, but we don't do that because in
++ ppp_generic.c we just allocate bigger obuf.
++
++ Maximum MPPC packet expansion is 12.5%. This is the worst case when
++ all octets in the input buffer are >= 0x80 and we cannot find any
++ repeated tokens. Additionally we have to reserve 2 bytes for MPPE/MPPC
++ status bits and coherency counter.
++ */
++
++ hist = state->hist + MPPE_HIST_LEN;
++ /* check if there is enough room at the end of the history */
++ if (state->histptr + isize >= 2*MPPE_HIST_LEN) {
++ state->bits |= MPPE_BIT_RESET;
++ state->histptr = MPPE_HIST_LEN;
++ memcpy(state->hist, hist, MPPE_HIST_LEN);
++ }
++ /* add packet to the history; isize must be <= MPPE_HIST_LEN */
++ sbuf = state->hist + state->histptr;
++ memcpy(sbuf, ibuf, isize);
++ state->histptr += isize;
++
++ /* compress data */
++ r = sbuf + isize;
++ *obuf = olen = i = 0;
++ l = 8;
++ while (i < isize - 2) {
++ s = q = sbuf + i;
++ idx = ((40542*((((s[0]<<4)^s[1])<<4)^s[2]))>>4) & 0x1FFF;
++ p = hist + state->hash[idx];
++ state->hash[idx] = (u16) (s - hist);
++ off = s - p;
++ if (off > 8191 || off < 1 || *p++ != *s++ || *p++ != *s++ || *p++ != *s++)
++ goto literal;
++ if (r - q >= 64) {
++ *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
++ *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
++ *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
++ *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
++ *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
++ *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
++ *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
++ *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
++ *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
++ *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
++ *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
++ *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
++ *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
++ *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
++ *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
++ *p++ != *s++;
++ if (s - q == 64) {
++ p--; s--;
++ while((*p++ == *s++) && (s < r));
++ }
++ } else {
++ while((*p++ == *s++) && (s < r));
++ }
++ len = s - q - 1;
++ i += len;
++
++ /* at least 3 character match found; code data */
++ /* encode offset */
++ if (off < 64) { /* 10-bit offset; 0 <= offset < 64 */
++ putbits16(obuf, 0x3c0|off, 10, &olen, &l);
++ } else if (off < 320) { /* 12-bit offset; 64 <= offset < 320 */
++ putbits16(obuf, 0xe00|(off-64), 12, &olen, &l);
++ } else if (off < 8192) { /* 16-bit offset; 320 <= offset < 8192 */
++ putbits16(obuf, 0xc000|(off-320), 16, &olen, &l);
++ } else {
++ /* This shouldn't happen; we return 0 what means "packet expands",
++ and we send packet uncompressed. */
++ if (state->debug)
++ printk(KERN_DEBUG "%s%d: wrong offset value: %d\n",
++ __FUNCTION__, state->unit, off);
++ return 0;
++ }
++ /* encode length of match */
++ if (len < 4) { /* length = 3 */
++ putbits8(obuf, 0, 1, &olen, &l);
++ } else if (len < 8) { /* 4 <= length < 8 */
++ putbits8(obuf, 0x08|(len&0x03), 4, &olen, &l);
++ } else if (len < 16) { /* 8 <= length < 16 */
++ putbits8(obuf, 0x30|(len&0x07), 6, &olen, &l);
++ } else if (len < 32) { /* 16 <= length < 32 */
++ putbits8(obuf, 0xe0|(len&0x0f), 8, &olen, &l);
++ } else if (len < 64) { /* 32 <= length < 64 */
++ putbits16(obuf, 0x3c0|(len&0x1f), 10, &olen, &l);
++ } else if (len < 128) { /* 64 <= length < 128 */
++ putbits16(obuf, 0xf80|(len&0x3f), 12, &olen, &l);
++ } else if (len < 256) { /* 128 <= length < 256 */
++ putbits16(obuf, 0x3f00|(len&0x7f), 14, &olen, &l);
++ } else if (len < 512) { /* 256 <= length < 512 */
++ putbits16(obuf, 0xfe00|(len&0xff), 16, &olen, &l);
++ } else if (len < 1024) { /* 512 <= length < 1024 */
++ putbits24(obuf, 0x3fc00|(len&0x1ff), 18, &olen, &l);
++ } else if (len < 2048) { /* 1024 <= length < 2048 */
++ putbits24(obuf, 0xff800|(len&0x3ff), 20, &olen, &l);
++ } else if (len < 4096) { /* 2048 <= length < 4096 */
++ putbits24(obuf, 0x3ff000|(len&0x7ff), 22, &olen, &l);
++ } else if (len < 8192) { /* 4096 <= length < 8192 */
++ putbits24(obuf, 0xffe000|(len&0xfff), 24, &olen, &l);
++ } else {
++ /* This shouldn't happen; we return 0 what means "packet expands",
++ and send packet uncompressed. */
++ if (state->debug)
++ printk(KERN_DEBUG "%s%d: wrong length of match value: %d\n",
++ __FUNCTION__, state->unit, len);
++ return 0;
++ }
++ continue;
++
++ literal:
++ /* no match found; encode literal byte */
++ if (ibuf[i] < 0x80) { /* literal byte < 0x80 */
++ putbits8(obuf, (u32) ibuf[i++], 8, &olen, &l);
++ } else { /* literal byte >= 0x80 */
++ putbits16(obuf, (u32) (0x100|(ibuf[i++]&0x7f)), 9, &olen, &l);
++ }
++ }
++
++ /* Add remaining octets to the output */
++ while(isize - i > 0) {
++ if (ibuf[i] < 0x80) { /* literal byte < 0x80 */
++ putbits8(obuf, (u32) ibuf[i++], 8, &olen, &l);
++ } else { /* literal byte >= 0x80 */
++ putbits16(obuf, (u32) (0x100|(ibuf[i++]&0x7f)), 9, &olen, &l);
++ }
++ }
++ /* Reset unused bits of the last output octet */
++ if ((l != 0) && (l != 8)) {
++ putbits8(obuf, 0, l, &olen, &l);
++ }
++
++ return (int) olen;
++}
++
++int
++mppe_compress(void *arg, unsigned char *ibuf, unsigned char *obuf,
++ int isize, int osize)
++{
++ struct ppp_mppe_state *state = (struct ppp_mppe_state *) arg;
++ int proto, olen, complen;
++ unsigned char *wptr;
++
++ /* Check that the protocol is in the range we handle. */
++ proto = PPP_PROTOCOL(ibuf);
++ if (proto < 0x0021 || proto > 0x00fa)
++ return 0;
++
++ wptr = obuf;
++ /* Copy over the PPP header */
++ wptr[0] = PPP_ADDRESS(ibuf);
++ wptr[1] = PPP_CONTROL(ibuf);
++ wptr[2] = PPP_COMP >> 8;
++ wptr[3] = PPP_COMP;
++ wptr += PPP_HDRLEN + MPPE_OVHD; /* Leave two octets for MPPE/MPPC bits */
++
++ mppe_increase_ccount(state);
++
++ if (state->nextflushed) {
++ if (!state->stateless) {
++ state->nextflushed = 0;
++ }
++ state->bits |= MPPE_BIT_FLUSHED;
++ if (state->mppc) { /* reset history */
++ state->bits |= MPPE_BIT_RESET;
++ state->histptr = MPPE_HIST_LEN;
++ memset(state->hist + MPPE_HIST_LEN, 0, MPPE_HIST_LEN*sizeof(u8));
++ }
++ }
++
++ if (state->mppc && !state->mppe) { /* Do only compression */
++ complen = mppc_compress(state, ibuf+2, wptr, isize-2,
++ osize-PPP_HDRLEN-MPPE_OVHD);
++ if ((complen > isize) || (complen == 0)) {
++ /* packet expands */
++ state->nextflushed = 1;
++ memcpy(wptr, ibuf+2, isize-2);
++ olen = isize + (PPP_HDRLEN / 2) + MPPE_OVHD;
++ (state->stats).inc_bytes += olen;
++ (state->stats).inc_packets++;
++ } else {
++ state->bits |= MPPE_BIT_COMP;
++ olen = complen + PPP_HDRLEN + MPPE_OVHD;
++ (state->stats).comp_bytes += olen;
++ (state->stats).comp_packets++;
++ }
++ } else {
++ if (!state->mppc && state->mppe) { /* Do only encryption */
++ /* read from ibuf, write to wptr, adjust for PPP_HDRLEN */
++ arcfour_encrypt(&state->arcfour_context, ibuf+2, isize-2, wptr);
++ state->bits |= MPPE_BIT_ENCRYPTED;
++ olen = isize + (PPP_HDRLEN / 2) + MPPE_OVHD;
++ (state->stats).inc_bytes += olen;
++ (state->stats).inc_packets++;
++ } else { /* Do compression and then encryption - RFC3078 */
++ complen = mppc_compress(state, ibuf+2, wptr, isize-2,
++ osize-PPP_HDRLEN-MPPE_OVHD);
++ if ((complen > isize) || (complen == 0)) {
++ /* packet expands */
++ memcpy(wptr, ibuf+2, isize-2);
++ state->nextflushed = 1;
++ arcfour_encrypt(&state->arcfour_context, ibuf+2, isize-2, wptr);
++ olen = isize + (PPP_HDRLEN / 2) + MPPE_OVHD;
++ (state->stats).inc_bytes += olen;
++ (state->stats).inc_packets++;
++ } else {
++ state->bits |= MPPE_BIT_COMP;
++ /* Hack warning !!! RC4 implementation which we use does
++ encryption "in place" - it means that input and output
++ buffers can be *the same* memory area. Therefore we don't
++ need to use a temporary buffer. But be careful - other
++ implementations don't have to be so nice.
++ I used to use ibuf as temporary buffer here, but it led
++ packet sniffers into error. Thanks to Wilfried Weissmann
++ for pointing that. */
++ arcfour_encrypt(&state->arcfour_context, wptr, complen, wptr);
++ olen = complen + PPP_HDRLEN + MPPE_OVHD;
++ (state->stats).comp_bytes += olen;
++ (state->stats).comp_packets++;
++ }
++ state->bits |= MPPE_BIT_ENCRYPTED;
++ }
++ }
++
++ /* write status bits and coherency counter into the output buffer */
++ wptr = obuf + PPP_HDRLEN;
++ wptr[0] = MPPE_CTRLHI(state);
++ wptr[1] = MPPE_CTRLLO(state);
++
++ state->bits = 0;
++
++ (state->stats).unc_bytes += isize;
++ (state->stats).unc_packets++;
++
++ return olen;
++}
++
++/***************************/
++/*** Decompression stuff ***/
++/***************************/
++static inline u32 getbits(const u8 *buf, const u32 n, u32 *i, u32 *l)
++{
++ static u32 m[] = {0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff};
++ u32 res, ol;
++
++ ol = *l;
++ if (*l >= n) {
++ *l = (*l) - n;
++ res = (buf[*i] & m[ol]) >> (*l);
++ if (*l == 0) {
++ *l = 8;
++ (*i)++;
++ }
++ } else {
++ *l = 8 - n + (*l);
++ res = (buf[(*i)++] & m[ol]) << 8;
++ res = (res | buf[*i]) >> (*l);
++ }
++
++ return res;
++}
++
++static inline u32 getbyte(const u8 *buf, const u32 i, const u32 l)
++{
++ if (l == 8) {
++ return buf[i];
++ } else {
++ return (((buf[i] << 8) | buf[i+1]) >> l) & 0xff;
++ }
++}
++
++static inline void lamecopy(u8 *dst, u8 *src, u32 len)
++{
++ while (len--)
++ *dst++ = *src++;
++}
++
++static int
++mppc_decompress(struct ppp_mppe_state *state, unsigned char *ibuf,
++ unsigned char *obuf, int isize, int osize)
++{
++ u32 olen, off, len, bits, val, sig, i, l;
++ u8 *history, *s;
++
++ history = state->hist + state->histptr;
++ olen = len = i = 0;
++ l = 8;
++ bits = isize * 8;
++ while (bits >= 8) {
++ val = getbyte(ibuf, i++, l);
++ if (val < 0x80) { /* literal byte < 0x80 */
++ if (state->histptr < 2*MPPE_HIST_LEN) {
++ /* copy uncompressed byte to the history */
++ (state->hist)[(state->histptr)++] = (u8) val;
++ } else {
++ /* buffer overflow; drop packet */
++ if (state->debug)
++ printk(KERN_ERR "%s%d: trying to write outside history "
++ "buffer\n", __FUNCTION__, state->unit);
++ return DECOMP_ERROR;
++ }
++ olen++;
++ bits -= 8;
++ continue;
++ }
++
++ sig = val & 0xc0;
++ if (sig == 0x80) { /* literal byte >= 0x80 */
++ if (state->histptr < 2*MPPE_HIST_LEN) {
++ /* copy uncompressed byte to the history */
++ (state->hist)[(state->histptr)++] =
++ (u8) (0x80|((val&0x3f)<<1)|getbits(ibuf, 1 , &i ,&l));
++ } else {
++ /* buffer overflow; drop packet */
++ if (state->debug)
++ printk(KERN_ERR "%s%d: trying to write outside history "
++ "buffer\n", __FUNCTION__, state->unit);
++ return DECOMP_ERROR;
++ }
++ olen++;
++ bits -= 9;
++ continue;
++ }
++
++ /* Not a literal byte so it must be an (offset,length) pair */
++ /* decode offset */
++ sig = val & 0xf0;
++ if (sig == 0xf0) { /* 10-bit offset; 0 <= offset < 64 */
++ off = (((val&0x0f)<<2)|getbits(ibuf, 2 , &i ,&l));
++ bits -= 10;
++ } else {
++ if (sig == 0xe0) { /* 12-bit offset; 64 <= offset < 320 */
++ off = ((((val&0x0f)<<4)|getbits(ibuf, 4 , &i ,&l))+64);
++ bits -= 12;
++ } else {
++ if ((sig&0xe0) == 0xc0) {/* 16-bit offset; 320 <= offset < 8192 */
++ off = ((((val&0x1f)<<8)|getbyte(ibuf, i++, l))+320);
++ bits -= 16;
++ if (off > MPPE_HIST_LEN - 1) {
++ if (state->debug)
++ printk(KERN_DEBUG "%s%d: too big offset value: %d\n",
++ __FUNCTION__, state->unit, off);
++ return DECOMP_ERROR;
++ }
++ } else { /* this shouldn't happen */
++ if (state->debug)
++ printk(KERN_DEBUG "%s%d: cannot decode offset value\n",
++ __FUNCTION__, state->unit);
++ return DECOMP_ERROR;
++ }
++ }
++ }
++ /* decode length of match */
++ val = getbyte(ibuf, i, l);
++ if ((val & 0x80) == 0x00) { /* len = 3 */
++ len = 3;
++ bits--;
++ getbits(ibuf, 1 , &i ,&l);
++ } else if ((val & 0xc0) == 0x80) { /* 4 <= len < 8 */
++ len = 0x04 | ((val>>4) & 0x03);
++ bits -= 4;
++ getbits(ibuf, 4 , &i ,&l);
++ } else if ((val & 0xe0) == 0xc0) { /* 8 <= len < 16 */
++ len = 0x08 | ((val>>2) & 0x07);
++ bits -= 6;
++ getbits(ibuf, 6 , &i ,&l);
++ } else if ((val & 0xf0) == 0xe0) { /* 16 <= len < 32 */
++ len = 0x10 | (val & 0x0f);
++ bits -= 8;
++ i++;
++ } else {
++ bits -= 8;
++ val = (val << 8) | getbyte(ibuf, ++i, l);
++ if ((val & 0xf800) == 0xf000) { /* 32 <= len < 64 */
++ len = 0x0020 | ((val >> 6) & 0x001f);
++ bits -= 2;
++ getbits(ibuf, 2 , &i ,&l);
++ } else if ((val & 0xfc00) == 0xf800) { /* 64 <= len < 128 */
++ len = 0x0040 | ((val >> 4) & 0x003f);
++ bits -= 4;
++ getbits(ibuf, 4 , &i ,&l);
++ } else if ((val & 0xfe00) == 0xfc00) { /* 128 <= len < 256 */
++ len = 0x0080 | ((val >> 2) & 0x007f);
++ bits -= 6;
++ getbits(ibuf, 6 , &i ,&l);
++ } else if ((val & 0xff00) == 0xfe00) { /* 256 <= len < 512 */
++ len = 0x0100 | (val & 0x00ff);
++ bits -= 8;
++ i++;
++ } else {
++ bits -= 8;
++ val = (val << 8) | getbyte(ibuf, ++i, l);
++ if ((val & 0xff8000) == 0xff0000) { /* 512 <= len < 1024 */
++ len = 0x000200 | ((val >> 6) & 0x0001ff);
++ bits -= 2;
++ getbits(ibuf, 2 , &i ,&l);
++ } else if ((val & 0xffc000) == 0xff8000) {/* 1024 <= len < 2048 */
++ len = 0x000400 | ((val >> 4) & 0x0003ff);
++ bits -= 4;
++ getbits(ibuf, 4 , &i ,&l);
++ } else if ((val & 0xffe000) == 0xffc000) {/* 2048 <= len < 4096 */
++ len = 0x000800 | ((val >> 2) & 0x0007ff);
++ bits -= 6;
++ getbits(ibuf, 6 , &i ,&l);
++ } else if ((val & 0xfff000) == 0xffe000) {/* 4096 <= len < 8192 */
++ len = 0x001000 | (val & 0x000fff);
++ bits -= 8;
++ i++;
++ } else { /* this shouldn't happen */
++ if (state->debug)
++ printk(KERN_DEBUG "%s%d: wrong length code: 0x%X\n",
++ __FUNCTION__, state->unit, val);
++ return DECOMP_ERROR;
++ }
++ }
++ }
++ s = state->hist + state->histptr;
++ state->histptr += len;
++ olen += len;
++ if (state->histptr < 2*MPPE_HIST_LEN) {
++ /* copy uncompressed bytes to the history */
++
++ /* In some cases len may be greater than off. It means that memory
++ * areas pointed by s and s-off overlap. I used to use memmove()
++ * here, because I thought that it acts as libc's version. But
++ * I was wrong. I got strange errors sometimes. Wilfried suggested
++ * using of byte by byte copying here and strange errors disappeared.
++ */
++ lamecopy(s, s-off, len);
++ } else {
++ /* buffer overflow; drop packet */
++ if (state->debug)
++ printk(KERN_ERR "%s%d: trying to write outside history "
++ "buffer\n", __FUNCTION__, state->unit);
++ return DECOMP_ERROR;
++ }
++ }
++
++ if (olen <= osize) {
++ /* copy uncompressed packet to the output buffer */
++ memcpy(obuf, history, olen);
++ } else {
++ /* buffer overflow; drop packet */
++ if (state->debug)
++ printk(KERN_ERR "%s%d: too big uncompressed packet: %d\n",
++ __FUNCTION__, state->unit, olen+(PPP_HDRLEN/2));
++ return DECOMP_ERROR;
++ }
++
++ return (int) olen;
++}
++
++int
++mppe_decompress(void *arg, unsigned char *ibuf, int isize,
++ unsigned char *obuf, int osize)
++{
++ struct ppp_mppe_state *state = (struct ppp_mppe_state *)arg;
++ int seq, bits, uncomplen;
++
++ if (isize <= PPP_HDRLEN + MPPE_OVHD) {
++ if (state->debug) {
++ printk(KERN_DEBUG "%s%d: short packet (len=%d)\n", __FUNCTION__,
++ state->unit, isize);
++ }
++ return DECOMP_ERROR;
++ }
++
++ /* Get coherency counter and control bits from input buffer */
++ seq = MPPE_CCOUNT(ibuf);
++ bits = MPPE_BITS(ibuf);
++
++ if (state->stateless) {
++ /* RFC 3078, sec 8.1. */
++ mppe_increase_ccount(state);
++ if ((seq != state->ccount) && state->debug)
++ printk(KERN_DEBUG "%s%d: bad sequence number: %d, expected: %d\n",
++ __FUNCTION__, state->unit, seq, state->ccount);
++ while (seq != state->ccount)
++ mppe_increase_ccount(state);
++ } else {
++ /* RFC 3078, sec 8.2. */
++ if (state->flushexpected) { /* discard state */
++ if ((bits & MPPE_BIT_FLUSHED)) { /* we received expected FLUSH bit */
++ while (seq != state->ccount)
++ mppe_increase_ccount(state);
++ state->flushexpected = 0;
++ } else /* drop packet*/
++ return DECOMP_ERROR;
++ } else { /* normal state */
++ mppe_increase_ccount(state);
++ if (seq != state->ccount) {
++ /* Packet loss detected, enter the discard state. */
++ if (state->debug)
++ printk(KERN_DEBUG "%s%d: bad sequence number: %d, expected: %d\n",
++ __FUNCTION__, state->unit, seq, state->ccount);
++ state->flushexpected = 1;
++ return DECOMP_ERROR;
++ }
++ }
++ if (state->mppe && (bits & MPPE_BIT_FLUSHED)) {
++ arcfour_setkey(&state->arcfour_context, state->session_key,
++ state->keylen);
++ }
++ }
++
++ if (state->mppc && (bits & (MPPE_BIT_FLUSHED | MPPE_BIT_RESET))) {
++ state->histptr = MPPE_HIST_LEN;
++ if ((bits & MPPE_BIT_FLUSHED)) {
++ memset(state->hist + MPPE_HIST_LEN, 0, MPPE_HIST_LEN*sizeof(u8));
++ } else
++ if ((bits & MPPE_BIT_RESET)) {
++ memcpy(state->hist, state->hist+MPPE_HIST_LEN, MPPE_HIST_LEN);
++ }
++ }
++
++ /* Fill in the first part of the PPP header. The protocol field
++ comes from the decompressed data. */
++ obuf[0] = PPP_ADDRESS(ibuf);
++ obuf[1] = PPP_CONTROL(ibuf);
++ obuf += PPP_HDRLEN / 2;
++
++ if (state->mppe) { /* process encrypted packet */
++ if ((bits & MPPE_BIT_ENCRYPTED)) {
++ /* OK, packet encrypted, so decrypt it */
++ if (state->mppc && (bits & MPPE_BIT_COMP)) {
++ /* Hack warning !!! RC4 implementation which we use does
++ decryption "in place" - it means that input and output
++ buffers can be *the same* memory area. Therefore we don't
++ need to use a temporary buffer. But be careful - other
++ implementations don't have to be so nice. */
++ arcfour_decrypt(&state->arcfour_context, ibuf+PPP_HDRLEN+MPPE_OVHD,
++ isize-PPP_HDRLEN-MPPE_OVHD, ibuf+PPP_HDRLEN+MPPE_OVHD);
++ uncomplen = mppc_decompress(state, ibuf+PPP_HDRLEN+MPPE_OVHD,
++ obuf, isize-PPP_HDRLEN-MPPE_OVHD,
++ osize-(PPP_HDRLEN/2));
++ if (uncomplen == DECOMP_ERROR) {
++ state->flushexpected = 1;
++ return DECOMP_ERROR;
++ }
++ uncomplen += PPP_HDRLEN / 2;
++ (state->stats).comp_bytes += isize;
++ (state->stats).comp_packets++;
++ } else {
++ arcfour_decrypt(&state->arcfour_context, ibuf+PPP_HDRLEN+MPPE_OVHD,
++ isize-PPP_HDRLEN-MPPE_OVHD, obuf);
++ uncomplen = isize - (PPP_HDRLEN / 2) - MPPE_OVHD;
++ (state->stats).inc_bytes += isize;
++ (state->stats).inc_packets++;
++ }
++ } else { /* this shouldn't happen */
++ if (state->debug)
++ printk(KERN_ERR "%s%d: encryption negotiated but not an "
++ "encrypted packet received\n", __FUNCTION__, state->unit);
++ mppe_change_key(state, 0);
++ state->flushexpected = 1;
++ return DECOMP_ERROR;
++ }
++ } else {
++ if (state->mppc) { /* no MPPE, only MPPC */
++ if ((bits & MPPE_BIT_COMP)) {
++ uncomplen = mppc_decompress(state, ibuf+PPP_HDRLEN+MPPE_OVHD,
++ obuf, isize-PPP_HDRLEN-MPPE_OVHD,
++ osize-(PPP_HDRLEN/2));
++ if (uncomplen == DECOMP_ERROR) {
++ state->flushexpected = 1;
++ return DECOMP_ERROR;
++ }
++ uncomplen += PPP_HDRLEN / 2;
++ (state->stats).comp_bytes += isize;
++ (state->stats).comp_packets++;
++ } else {
++ memcpy(obuf, ibuf+PPP_HDRLEN+MPPE_OVHD,
++ isize-PPP_HDRLEN-MPPE_OVHD);
++ uncomplen = isize - (PPP_HDRLEN / 2) - MPPE_OVHD;
++ (state->stats).inc_bytes += isize;
++ (state->stats).inc_packets++;
++ }
++ } else { /* this shouldn't happen */
++ if (state->debug)
++ printk(KERN_ERR "%s%d: error - no MPPC nor MPPE negotiated\n",
++ __FUNCTION__, state->unit);
++ state->flushexpected = 1;
++ return DECOMP_ERROR;
++ }
++ }
++
++ (state->stats).unc_bytes += uncomplen;
++ (state->stats).unc_packets++;
++
++ return uncomplen;
++}
++
++
++/************************************************************
++ * Module interface table
++ ************************************************************/
++
++/* These are in ppp_generic.c */
++extern int ppp_register_compressor (struct compressor *cp);
++extern void ppp_unregister_compressor (struct compressor *cp);
++
++/*
++ * Functions exported to ppp_generic.c.
++ */
++struct compressor ppp_mppe = {
++ CI_MPPE, /* compress_proto */
++ mppe_comp_alloc, /* comp_alloc */
++ mppe_comp_free, /* comp_free */
++ mppe_comp_init, /* comp_init */
++ mppe_comp_reset, /* comp_reset */
++ mppe_compress, /* compress */
++ mppe_stats, /* comp_stat */
++ mppe_decomp_alloc, /* decomp_alloc */
++ mppe_comp_free, /* decomp_free */
++ mppe_decomp_init, /* decomp_init */
++ mppe_decomp_reset, /* decomp_reset */
++ mppe_decompress, /* decompress */
++ NULL, /* incomp */
++ mppe_stats, /* decomp_stat */
++};
++
++/*
++ In case of MPPC/MPPE there is no need to process incompressible data
++ because such a data is sent in MPPC/MPPE frame. Therefore the (*incomp)
++ callback function isn't needed.
++*/
++
++/************************************************************
++ * Module support routines
++ ************************************************************/
++
++int __init mppe_module_init(void)
++{
++ int answer = ppp_register_compressor(&ppp_mppe);
++ if (answer == 0) {
++ printk(KERN_INFO "MPPE/MPPC encryption/compression module registered\n");
++ }
++ return answer;
++}
++
++void __exit mppe_module_cleanup(void)
++{
++ if (MOD_IN_USE) {
++ printk (KERN_INFO "MPPE/MPPC module busy, removing delayed\n");
++ } else {
++ ppp_unregister_compressor (&ppp_mppe);
++ printk(KERN_INFO "MPPE/MPPC encryption/compression module unregistered\n");
++ }
++}
++
++module_init(mppe_module_init);
++module_exit(mppe_module_cleanup);
++
++MODULE_AUTHOR("Jan Dubiec <jdx@slackware.pl>");
++MODULE_DESCRIPTION("MPPE/MPPC encryption/compression module for Linux");
++MODULE_LICENSE("Dual BSD/GPL");
+diff -ruN linux-2.4.21.orig/include/linux/ppp-comp.h linux-2.4.21/include/linux/ppp-comp.h
+--- linux-2.4.21.orig/include/linux/ppp-comp.h 1999-08-06 19:44:11.000000000 +0200
++++ linux-2.4.21/include/linux/ppp-comp.h 2003-07-15 01:45:22.000000000 +0200
+@@ -1,34 +1,42 @@
+ /*
+ * ppp-comp.h - Definitions for doing PPP packet compression.
+ *
+- * Copyright (c) 1994 The Australian National University.
+- * All rights reserved.
++ * Copyright (c) 1984 Paul Mackerras. All rights reserved.
+ *
+- * Permission to use, copy, modify, and distribute this software and its
+- * documentation is hereby granted, provided that the above copyright
+- * notice appears in all copies. This software is provided without any
+- * warranty, express or implied. The Australian National University
+- * makes no representations about the suitability of this software for
+- * any purpose.
+- *
+- * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
+- * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+- * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+- * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
+- * OF SUCH DAMAGE.
+- *
+- * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+- * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+- * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
+- * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
+- * OR MODIFICATIONS.
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
+ *
+- * $Id: ppp-comp.h,v 1.6 1997/11/27 06:04:44 paulus Exp $
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in
++ * the documentation and/or other materials provided with the
++ * distribution.
++ *
++ * 3. The name(s) of the authors of this software must not be used to
++ * endorse or promote products derived from this software without
++ * prior written permission.
++ *
++ * 4. Redistributions of any form whatsoever must retain the following
++ * acknowledgment:
++ * "This product includes software developed by Paul Mackerras
++ * <paulus@samba.org>".
++ *
++ * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
++ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
++ * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
++ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
++ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
++ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ * $Id: ppp-comp.h,v 1.10 2002/12/06 09:49:15 paulus Exp $
+ */
+
+ /*
+- * ==FILEVERSION 980319==
++ * ==FILEVERSION 20020715==
+ *
+ * NOTE TO MAINTAINERS:
+ * If you modify this file at all, please set the above date.
+@@ -78,7 +86,7 @@
+
+ /* Compress a packet */
+ int (*compress) (void *state, unsigned char *rptr,
+- unsigned char *obuf, int isize, int osize);
++ unsigned char *obuf, int isize, int osize);
+
+ /* Return compression statistics */
+ void (*comp_stat) (void *state, struct compstat *stats);
+@@ -99,7 +107,7 @@
+
+ /* Decompress a packet. */
+ int (*decompress) (void *state, unsigned char *ibuf, int isize,
+- unsigned char *obuf, int osize);
++ unsigned char *obuf, int osize);
+
+ /* Update state for an incompressible packet received */
+ void (*incomp) (void *state, unsigned char *ibuf, int icnt);
+@@ -187,6 +195,127 @@
+ #define DEFLATE_CHK_SEQUENCE 0
+
+ /*
++ * Definitions for MPPE.
++ */
++
++#define CI_MPPE 18 /* config option for MPPE */
++#define CILEN_MPPE 6 /* length of config option */
++
++#define MPPE_PAD 4 /* MPPE growth per frame */
++#define MPPE_MAX_KEY_LEN 16 /* largest key length (128-bit) */
++
++/* option bits for ccp_options.mppe */
++#define MPPE_OPT_40 0x01 /* 40 bit */
++#define MPPE_OPT_128 0x02 /* 128 bit */
++#define MPPE_OPT_STATEFUL 0x04 /* stateful mode */
++/* unsupported opts */
++#define MPPE_OPT_56 0x08 /* 56 bit */
++#define MPPE_OPT_MPPC 0x10 /* MPPC compression */
++#define MPPE_OPT_D 0x20 /* Unknown */
++#define MPPE_OPT_UNSUPPORTED (MPPE_OPT_56|MPPE_OPT_MPPC|MPPE_OPT_D)
++#define MPPE_OPT_UNKNOWN 0x40 /* Bits !defined in RFC 3078 were set */
++
++/*
++ * This is not nice ... the alternative is a bitfield struct though.
++ * And unfortunately, we cannot share the same bits for the option
++ * names above since C and H are the same bit. We could do a u_int32
++ * but then we have to do a htonl() all the time and/or we still need
++ * to know which octet is which.
++ */
++#define MPPE_C_BIT 0x01 /* MPPC */
++#define MPPE_D_BIT 0x10 /* Obsolete, usage unknown */
++#define MPPE_L_BIT 0x20 /* 40-bit */
++#define MPPE_S_BIT 0x40 /* 128-bit */
++#define MPPE_M_BIT 0x80 /* 56-bit, not supported */
++#define MPPE_H_BIT 0x01 /* Stateless (in a different byte) */
++
++/* Does not include H bit; used for least significant octet only. */
++#define MPPE_ALL_BITS (MPPE_D_BIT|MPPE_L_BIT|MPPE_S_BIT|MPPE_M_BIT|MPPE_H_BIT)
++
++/* Build a CI from mppe opts (see RFC 3078) */
++#define MPPE_OPTS_TO_CI(opts, ci) \
++ do { \
++ u_char *ptr = ci; /* u_char[4] */ \
++ \
++ /* H bit */ \
++ if (opts & MPPE_OPT_STATEFUL) \
++ *ptr++ = 0x0; \
++ else \
++ *ptr++ = MPPE_H_BIT; \
++ *ptr++ = 0; \
++ *ptr++ = 0; \
++ \
++ /* S,L bits */ \
++ *ptr = 0; \
++ if (opts & MPPE_OPT_128) \
++ *ptr |= MPPE_S_BIT; \
++ if (opts & MPPE_OPT_40) \
++ *ptr |= MPPE_L_BIT; \
++ /* M,D,C bits not supported */ \
++ } while (/* CONSTCOND */ 0)
++
++/* The reverse of the above */
++#define MPPE_CI_TO_OPTS(ci, opts) \
++ do { \
++ u_char *ptr = ci; /* u_char[4] */ \
++ \
++ opts = 0; \
++ \
++ /* H bit */ \
++ if (!(ptr[0] & MPPE_H_BIT)) \
++ opts |= MPPE_OPT_STATEFUL; \
++ \
++ /* S,L bits */ \
++ if (ptr[3] & MPPE_S_BIT) \
++ opts |= MPPE_OPT_128; \
++ if (ptr[3] & MPPE_L_BIT) \
++ opts |= MPPE_OPT_40; \
++ \
++ /* M,D,C bits */ \
++ if (ptr[3] & MPPE_M_BIT) \
++ opts |= MPPE_OPT_56; \
++ if (ptr[3] & MPPE_D_BIT) \
++ opts |= MPPE_OPT_D; \
++ if (ptr[3] & MPPE_C_BIT) \
++ opts |= MPPE_OPT_MPPC; \
++ \
++ /* Other bits */ \
++ if (ptr[0] & ~MPPE_H_BIT) \
++ opts |= MPPE_OPT_UNKNOWN; \
++ if (ptr[1] || ptr[2]) \
++ opts |= MPPE_OPT_UNKNOWN; \
++ if (ptr[3] & ~MPPE_ALL_BITS) \
++ opts |= MPPE_OPT_UNKNOWN; \
++ } while (/* CONSTCOND */ 0)
++
++/* MPPE/MPPC definitions by J.D.*/
++#define MPPE_STATELESS MPPE_H_BIT /* configuration bit H */
++#define MPPE_40BIT MPPE_L_BIT /* configuration bit L */
++#define MPPE_56BIT MPPE_M_BIT /* configuration bit M */
++#define MPPE_128BIT MPPE_S_BIT /* configuration bit S */
++#define MPPE_MPPC MPPE_C_BIT /* configuration bit C */
++
++/*
++ * Definitions for Stac LZS.
++ */
++
++#define CI_LZS 17 /* config option for Stac LZS */
++#define CILEN_LZS 5 /* length of config option */
++
++#define LZS_OVHD 4 /* max. LZS overhead */
++#define LZS_HIST_LEN 2048 /* LZS history size */
++#define LZS_MAX_CCOUNT 0x0FFF /* max. coherency counter value */
++
++#define LZS_MODE_NONE 0
++#define LZS_MODE_LCB 1
++#define LZS_MODE_CRC 2
++#define LZS_MODE_SEQ 3
++#define LZS_MODE_EXT 4
++
++#define LZS_EXT_BIT_FLUSHED 0x80 /* bit A */
++#define LZS_EXT_BIT_COMP 0x20 /* bit C */
++
++/*
+ * Definitions for other, as yet unsupported, compression methods.
+ */
+
--- /dev/null
+--- linux/Makefile 2004-08-16 21:31:21.850402752 -0400
++++ linux/Makefile 2004-08-16 21:48:22.372259848 -0400
+@@ -357,7 +357,7 @@
+ @rm -f .ver1
+
+ include/linux/version.h: ./Makefile
+- @expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \
++ @expr "$(KERNELRELEASE)" : '.*' \<= $(uts_len) > /dev/null || \
+ (echo KERNELRELEASE \"$(KERNELRELEASE)\" exceeds $(uts_len) characters >&2; false)
+ @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver
+ @echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver
+clean:
+ rm -f *.o *.so
+
-+libshared.so: shutils.o wl.o wl_linux.o defaults.o
++libshared.so: shutils.o wl.o wl_linux.o defaults.o linux_timer.o
+ $(LD) -shared -o $@ $^
+
+build_date.o: build_date.c
echo ${DOMAINNAME:=lan} > /proc/sys/kernel/domainname
vconfig set_name_type VLAN_PLUS_VID_NO_PAD
+
+syslogd -C 16
::sysinit:/etc/init.d/rcS
::shutdown:/sbin/halt
-::respawn:/bin/login
+ttyS0::respawn:/bin/login
#!/bin/ash
# $Id$
[ "${INTERFACE%%[0-9]*}" = "wds" ] && {
+ [ -x "/usr/sbin/nas" ] && /usr/sbin/nas lan $INTERFACE up
ifconfig $INTERFACE 0.0.0.0 up
/usr/sbin/brctl addif br0 $INTERFACE
}
time_t t;
struct tm *ptm;
- fprintf(stderr, "mjn3's addpattern replacement - v0.80\n");
+ fprintf(stderr, "mjn3's addpattern replacement - v0.81\n");
hdr = (struct code_header *) buf;
--- /dev/null
+/* http://www.muppetlabs.com/~breadbox/software/elfkickers.html */
+
+/* sstrip: Copyright (C) 1999-2001 by Brian Raiter, under the GNU
+ * General Public License. No warranty. See COPYING for details.
+ */
+
+#define __MIPSEL__ 1
+#define _MIPS_SZLONG 32
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <elf.h>
+#include <linux/bitops.h>
+
+typedef signed char s8;
+typedef unsigned char u8;
+
+typedef signed short s16;
+typedef unsigned short u16;
+
+typedef signed int s32;
+typedef unsigned int u32;
+
+typedef signed long long s64;
+typedef unsigned long long u64;
+
+#include <asm/elf.h>
+
+#ifndef TRUE
+#define TRUE 1
+#define FALSE 0
+#endif
+
+#if ELF_CLASS == ELFCLASS32
+#define Elf_Ehdr Elf32_Ehdr
+#define Elf_Phdr Elf32_Phdr
+#else
+#define Elf_Ehdr Elf64_Ehdr
+#define Elf_Phdr Elf64_Phdr
+#endif
+
+/* The name of the program.
+ */
+static char const *progname;
+
+/* The name of the current file.
+ */
+static char const *filename;
+
+
+/* A simple error-handling function. FALSE is always returned for the
+ * convenience of the caller.
+ */
+static int err(char const *errmsg)
+{
+ fprintf(stderr, "%s: %s: %s\n", progname, filename, errmsg);
+ return FALSE;
+}
+
+/* A macro for I/O errors: The given error message is used only when
+ * errno is not set.
+ */
+#define ferr(msg) (err(errno ? strerror(errno) : (msg)))
+
+/* readelfheader() reads the ELF header into our global variable, and
+ * checks to make sure that this is in fact a file that we should be
+ * munging.
+ */
+static int readelfheader(int fd, Elf_Ehdr *ehdr)
+{
+ errno = 0;
+ if (read(fd, ehdr, sizeof *ehdr) != sizeof *ehdr)
+ return ferr("missing or incomplete ELF header.");
+
+ /* Check the ELF signature.
+ */
+ if (!(ehdr->e_ident[EI_MAG0] == ELFMAG0 &&
+ ehdr->e_ident[EI_MAG1] == ELFMAG1 &&
+ ehdr->e_ident[EI_MAG2] == ELFMAG2 &&
+ ehdr->e_ident[EI_MAG3] == ELFMAG3))
+ return err("missing ELF signature.");
+
+ /* Compare the file's class and endianness with the program's.
+ */
+ if (ehdr->e_ident[EI_DATA] != ELF_DATA)
+ return err("ELF file has different endianness.");
+ if (ehdr->e_ident[EI_CLASS] != ELF_CLASS)
+ return err("ELF file has different word size.");
+
+ /* Check the target architecture.
+ */
+ if (ehdr->e_machine != ELF_ARCH)
+ return err("ELF file created for different architecture.");
+ /* Verify the sizes of the ELF header and the program segment
+ * header table entries.
+ */
+ if (ehdr->e_ehsize != sizeof(Elf_Ehdr))
+ return err("unrecognized ELF header size.");
+ if (ehdr->e_phentsize != sizeof(Elf_Phdr))
+ return err("unrecognized program segment header size.");
+
+ /* Finally, check the file type.
+ */
+ if (ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN)
+ return err("not an executable or shared-object library.");
+
+ return TRUE;
+}
+
+/* readphdrtable() loads the program segment header table into memory.
+ */
+static int readphdrtable(int fd, Elf_Ehdr const *ehdr, Elf_Phdr **phdrs)
+{
+ size_t size;
+
+ if (!ehdr->e_phoff || !ehdr->e_phnum)
+ return err("ELF file has no program header table.");
+
+ size = ehdr->e_phnum * sizeof **phdrs;
+ if (!(*phdrs = malloc(size)))
+ return err("Out of memory!");
+
+ errno = 0;
+ if (read(fd, *phdrs, size) != (ssize_t)size)
+ return ferr("missing or incomplete program segment header table.");
+
+ return TRUE;
+}
+
+/* getmemorysize() determines the offset of the last byte of the file
+ * that is referenced by an entry in the program segment header table.
+ * (Anything in the file after that point is not used when the program
+ * is executing, and thus can be safely discarded.)
+ */
+static int getmemorysize(Elf_Ehdr const *ehdr, Elf_Phdr const *phdrs,
+ unsigned long *newsize)
+{
+ Elf32_Phdr const *phdr;
+ unsigned long size, n;
+ int i;
+
+ /* Start by setting the size to include the ELF header and the
+ * complete program segment header table.
+ */
+ size = ehdr->e_phoff + ehdr->e_phnum * sizeof *phdrs;
+ if (size < sizeof *ehdr)
+ size = sizeof *ehdr;
+
+ /* Then keep extending the size to include whatever data the
+ * program segment header table references.
+ */
+ for (i = 0, phdr = phdrs ; i < ehdr->e_phnum ; ++i, ++phdr) {
+ if (phdr->p_type != PT_NULL) {
+ n = phdr->p_offset + phdr->p_filesz;
+ if (n > size)
+ size = n;
+ }
+ }
+
+ *newsize = size;
+ return TRUE;
+}
+
+/* truncatezeros() examines the bytes at the end of the file's
+ * size-to-be, and reduces the size to exclude any trailing zero
+ * bytes.
+ */
+static int truncatezeros(int fd, unsigned long *newsize)
+{
+ unsigned char contents[1024];
+ unsigned long size, n;
+
+ size = *newsize;
+ do {
+ n = sizeof contents;
+ if (n > size)
+ n = size;
+ if (lseek(fd, size - n, SEEK_SET) == (off_t)-1)
+ return ferr("cannot seek in file.");
+ if (read(fd, contents, n) != (ssize_t)n)
+ return ferr("cannot read file contents");
+ while (n && !contents[--n])
+ --size;
+ } while (size && !n);
+
+ /* Sanity check.
+ */
+ if (!size)
+ return err("ELF file is completely blank!");
+
+ *newsize = size;
+ return TRUE;
+}
+
+/* modifyheaders() removes references to the section header table if
+ * it was stripped, and reduces program header table entries that
+ * included truncated bytes at the end of the file.
+ */
+static int modifyheaders(Elf_Ehdr *ehdr, Elf_Phdr *phdrs,
+ unsigned long newsize)
+{
+ Elf32_Phdr *phdr;
+ int i;
+
+ /* If the section header table is gone, then remove all references
+ * to it in the ELF header.
+ */
+ if (ehdr->e_shoff >= newsize) {
+ ehdr->e_shoff = 0;
+ ehdr->e_shnum = 0;
+ ehdr->e_shentsize = 0;
+ ehdr->e_shstrndx = 0;
+ }
+
+ /* The program adjusts the file size of any segment that was
+ * truncated. The case of a segment being completely stripped out
+ * is handled separately.
+ */
+ for (i = 0, phdr = phdrs ; i < ehdr->e_phnum ; ++i, ++phdr) {
+ if (phdr->p_offset >= newsize) {
+ phdr->p_offset = newsize;
+ phdr->p_filesz = 0;
+ } else if (phdr->p_offset + phdr->p_filesz > newsize) {
+ phdr->p_filesz = newsize - phdr->p_offset;
+ }
+ }
+
+ return TRUE;
+}
+
+/* commitchanges() writes the new headers back to the original file
+ * and sets the file to its new size.
+ */
+static int commitchanges(int fd, Elf_Ehdr const *ehdr, Elf_Phdr *phdrs,
+ unsigned long newsize)
+{
+ size_t n;
+
+ /* Save the changes to the ELF header, if any.
+ */
+ if (lseek(fd, 0, SEEK_SET))
+ return ferr("could not rewind file");
+ errno = 0;
+ if (write(fd, ehdr, sizeof *ehdr) != sizeof *ehdr)
+ return err("could not modify file");
+
+ /* Save the changes to the program segment header table, if any.
+ */
+ if (lseek(fd, ehdr->e_phoff, SEEK_SET) == (off_t)-1) {
+ err("could not seek in file.");
+ goto warning;
+ }
+ n = ehdr->e_phnum * sizeof *phdrs;
+ if (write(fd, phdrs, n) != (ssize_t)n) {
+ err("could not write to file");
+ goto warning;
+ }
+
+ /* Eleventh-hour sanity check: don't truncate before the end of
+ * the program segment header table.
+ */
+ if (newsize < ehdr->e_phoff + n)
+ newsize = ehdr->e_phoff + n;
+
+ /* Chop off the end of the file.
+ */
+ if (ftruncate(fd, newsize)) {
+ err("could not resize file");
+ goto warning;
+ }
+
+ return TRUE;
+
+ warning:
+ return err("ELF file may have been corrupted!");
+}
+
+/* main() loops over the cmdline arguments, leaving all the real work
+ * to the other functions.
+ */
+int main(int argc, char *argv[])
+{
+ int fd;
+ Elf_Ehdr ehdr;
+ Elf_Phdr *phdrs;
+ unsigned long newsize;
+ char **arg;
+ int failures = 0;
+
+ if (argc < 2 || argv[1][0] == '-') {
+ printf("Usage: sstrip FILE...\n"
+ "sstrip discards all nonessential bytes from an executable.\n\n"
+ "Version 2.0 Copyright (C) 2000,2001 Brian Raiter.\n"
+ "This program is free software, licensed under the GNU\n"
+ "General Public License. There is absolutely no warranty.\n");
+ return EXIT_SUCCESS;
+ }
+
+ progname = argv[0];
+
+ for (arg = argv + 1 ; *arg != NULL ; ++arg) {
+ filename = *arg;
+
+ fd = open(*arg, O_RDWR);
+ if (fd < 0) {
+ ferr("can't open");
+ ++failures;
+ continue;
+ }
+
+ if (!(readelfheader(fd, &ehdr) &&
+ readphdrtable(fd, &ehdr, &phdrs) &&
+ getmemorysize(&ehdr, phdrs, &newsize) &&
+ truncatezeros(fd, &newsize) &&
+ modifyheaders(&ehdr, phdrs, newsize) &&
+ commitchanges(fd, &ehdr, phdrs, newsize)))
+ ++failures;
+
+ close(fd);
+ }
+
+ return failures ? EXIT_FAILURE : EXIT_SUCCESS;
+}
* .trx file using '-m'. It will be rounded up to be a multiple of 4K.
* NOTE: This space will be malloc()'d.
*
+ * August 16, 2004
+ *
+ * Sigh... Make it endian-neutral.
+ *
* TODO: Support '-b' option to specify offsets for each file.
*/
#include <string.h>
#include <errno.h>
#include <unistd.h>
+#include <endian.h>
+#include <byteswap.h>
+
+#if __BYTE_ORDER == __BIG_ENDIAN
+#define STORE32_LE(X) bswap_32(X)
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
+#define STORE32_LE(X) (X)
+#else
+#error unkown endianness!
+#endif
uint32_t crc32buf(char *buf, size_t len);
char *e;
int c, i;
size_t n;
+ uint32_t cur_len;
unsigned long maxlen = TRX_MAX_LEN;
struct trx_header *p;
- fprintf(stderr, "mjn3's trx replacement - v0.80\n");
+ fprintf(stderr, "mjn3's trx replacement - v0.81\n");
while ((c = getopt(argc, argv, "o:m:")) != -1) {
switch (c) {
p = (struct trx_header *) buf;
- p->magic = TRX_MAGIC;
- p->len = sizeof(struct trx_header);
- p->flag_version = (TRX_VERSION << 16);
+ p->magic = STORE32_LE(TRX_MAGIC);
+ cur_len = sizeof(struct trx_header);
+ p->flag_version = STORE32_LE((TRX_VERSION << 16));
i = 0;
while (optind < argc) {
- p->offsets[i++] = p->len;
+ p->offsets[i++] = STORE32_LE(cur_len);
if (!(in = fopen(argv[optind], "r"))) {
fprintf(stderr, "can not open \"%s\" for reading\n", argv[optind]);
usage();
}
- n = fread(buf + p->len, 1, maxlen - p->len, in);
+ n = fread(buf + cur_len, 1, maxlen - cur_len, in);
if (!feof(in)) {
fprintf(stderr, "fread failure or file \"%s\" too large\n",
argv[optind]);
#undef ROUND
#define ROUND 4
if (n & (ROUND-1)) {
- memset(buf + p->len + n, 0, ROUND - (n & (ROUND-1)));
+ memset(buf + cur_len + n, 0, ROUND - (n & (ROUND-1)));
n += ROUND - (n & (ROUND-1));
}
}
- p->len += n;
+ cur_len += n;
}
#undef ROUND
#define ROUND 0x1000
- n = p->len & (ROUND-1);
+ n = cur_len & (ROUND-1);
if (n) {
- memset(buf + p->len, 0, ROUND - n);
- p->len += ROUND - n;
+ memset(buf + cur_len, 0, ROUND - n);
+ cur_len += ROUND - n;
}
p->crc32 = crc32buf((char *) &p->flag_version,
- p->len - offsetof(struct trx_header, flag_version));
+ cur_len - offsetof(struct trx_header, flag_version));
+ p->crc32 = STORE32_LE(p->crc32);
+
+ p->len = STORE32_LE(cur_len);
- if (!fwrite(buf, p->len, 1, out) || fflush(out)) {
+ if (!fwrite(buf, cur_len, 1, out) || fflush(out)) {
fprintf(stderr, "fwrite failed\n");
return EXIT_FAILURE;
}