From d7b5134ef3d6d6074cd5c188a19c923c1faec0ba Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:36:51 -0500 Subject: [PATCH] Import 2.4.0-test5pre1 --- Documentation/Changes | 12 +- Documentation/networking/tulip.txt | 4 + Makefile | 2 +- README | 34 ++- arch/m68k/amiga/amisound.c | 2 +- arch/m68k/apollo/dn_ints.c | 3 +- arch/m68k/atari/atakeyb.c | 2 +- arch/m68k/mac/macboing.c | 2 +- drivers/block/acsi_slm.c | 2 +- drivers/block/ps2esdi.c | 12 +- drivers/cdrom/aztcd.c | 2 +- drivers/cdrom/sjcd.c | 2 +- drivers/char/amikeyb.c | 2 +- drivers/char/dn_keyb.c | 3 +- drivers/char/ip2main.c | 3 +- drivers/mtd/Makefile | 283 ++++++------------- drivers/mtd/pmc551.c | 11 +- drivers/net/atari_bionet.c | 2 +- drivers/net/atari_pamsnet.c | 2 +- drivers/net/pcmcia/xircom_tulip_cb.c | 3 +- drivers/net/sk_g16.c | 2 + drivers/net/tulip/tulip_core.c | 8 +- drivers/net/wan/cycx_main.c | 12 +- drivers/parport/share.c | 10 +- drivers/scsi/pluto.c | 5 +- include/linux/cyclomx.h | 5 +- include/linux/netfilter_ipv4/ip_nat_core.h | 8 +- include/linux/netfilter_ipv4/ip_tables.h | 2 +- include/linux/netfilter_ipv4/ipt_REJECT.h | 5 +- include/linux/netfilter_ipv6/ip6_tables.h | 2 +- mm/vmscan.c | 6 +- net/core/netfilter.c | 10 +- net/decnet/dn_route.c | 2 +- net/ipv4/netfilter/ip_conntrack_core.c | 19 +- net/ipv4/netfilter/ip_conntrack_standalone.c | 11 +- net/ipv4/netfilter/ip_fw_compat.c | 3 +- net/ipv4/netfilter/ip_fw_compat_masq.c | 2 +- net/ipv4/netfilter/ip_nat_core.c | 20 +- net/ipv4/netfilter/ip_nat_standalone.c | 5 +- net/ipv4/netfilter/ip_queue.c | 5 +- net/ipv4/netfilter/ip_tables.c | 2 +- net/ipv4/netfilter/ipt_REJECT.c | 131 ++++++++- net/ipv6/netfilter/ip6_tables.c | 2 +- scripts/Menuconfig | 2 +- 44 files changed, 372 insertions(+), 295 deletions(-) diff --git a/Documentation/Changes b/Documentation/Changes index 525932df1ecb..f8b055d21359 100644 --- a/Documentation/Changes +++ b/Documentation/Changes @@ -317,12 +317,12 @@ o ftp://ftp.isdn4linux.de/pub/isdn4linux/utils/testing/isdn4k- Netfilter --------- -o http://netfilter.filewatcher.org/iptables-1.1.0.tar.bz2 - -o http://www.samba.org/netfilter/iptables-1.1.0.tar.bz2 - -o http://netfilter.kernelnotes.org/iptables-1.1.0.tar.bz2 - +o http://netfilter.filewatcher.org/iptables-1.1.1.tar.bz2 + +o http://www.samba.org/netfilter/iptables-1.1.1.tar.bz2 + +o http://netfilter.kernelnotes.org/iptables-1.1.1.tar.bz2 + Ip-route2 --------- diff --git a/Documentation/networking/tulip.txt b/Documentation/networking/tulip.txt index 11494e1dc547..35d5dea652c0 100644 --- a/Documentation/networking/tulip.txt +++ b/Documentation/networking/tulip.txt @@ -142,6 +142,10 @@ tulip_core.c - Driver core (a.k.a. where "everything else" goes) Version history =============== +0.9.8 (July 13, 2000): +* Correct signed/unsigned comparison for dummy frame index +* Remove outdated references to struct enet_statistics + 0.9.7 (June 17, 2000): * Timer cleanups (Andrew Morton) * Alpha compile fix (somebody?) diff --git a/Makefile b/Makefile index 02f49975c441..22d79cbf9dcd 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 0 -EXTRAVERSION = -test4 +EXTRAVERSION = -test5 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) diff --git a/README b/README index e77f3a3e84fb..611354d426d8 100644 --- a/README +++ b/README @@ -169,14 +169,18 @@ COMPILING the kernel: Please note that you can still run a.out user programs with this kernel. - - Do a "make zImage" to create a compressed kernel image. If you want + - Do a "make bzImage" to create a compressed kernel image. If you want to make a boot disk (without root filesystem or LILO), insert a floppy - in your A: drive, and do a "make zdisk". It is also possible to do - "make zlilo" if you have lilo installed to suit the kernel makefiles, + in your A: drive, and do a "make bzdisk". It is also possible to do + "make bzlilo" if you have lilo installed to suit the kernel makefiles, but you may want to check your particular lilo setup first. - - If your kernel is too large for "make zImage", use "make bzImage" - instead. + - In the unlikely event that your system cannot boot bzImage kernels you + can still compile your kernel as zImage. However, since zImage support + will be removed at some point in the future in favor of bzImage we + encourage people having problems with booting bzImage kernels to report + these, with detailed hardware configuration information, to the + linux-kernel mailing list and to H. Peter Anvin . - If you configured any of the parts of the kernel as `modules', you will have to do "make modules" followed by "make modules_install". @@ -192,11 +196,11 @@ COMPILING the kernel: do a "make modules_install". - In order to boot your new kernel, you'll need to copy the kernel - image (found in /usr/src/linux/arch/i386/boot/zImage after compilation) + image (found in /usr/src/linux/arch/i386/boot/bzImage after compilation) to the place where your regular bootable kernel is found. For some, this is on a floppy disk, in which case you can "cp - /usr/src/linux/arch/i386/boot/zImage /dev/fd0" to make a bootable + /usr/src/linux/arch/i386/boot/bzImage /dev/fd0" to make a bootable floppy. Please note that you can not boot a kernel by directly dumping it to a 720k double-density 3.5" floppy. In this case, it is highly recommended that you install LILO on your @@ -204,11 +208,11 @@ COMPILING the kernel: If you boot Linux from the hard drive, chances are you use LILO which uses the kernel image as specified in the file /etc/lilo.conf. The - kernel image file is usually /vmlinuz, or /zImage, or /etc/zImage. - To use the new kernel, save a copy of the old image and copy the new - image over the old one. Then, you MUST RERUN LILO to update the - loading map!! If you don't, you won't be able to boot the new kernel - image. + kernel image file is usually /vmlinuz, /boot/vmlinuz, /bzImage or + /boot/bzImage. To use the new kernel, save a copy of the old image + and copy the new image over the old one. Then, you MUST RERUN LILO + to update the loading map!! If you don't, you won't be able to boot + the new kernel image. Reinstalling LILO is usually a matter of running /sbin/lilo. You may wish to edit /etc/lilo.conf to specify an entry for your @@ -260,9 +264,9 @@ IF SOMETHING GOES WRONG: the above example it's due to a bad kernel pointer). More information on making sense of the dump is in Documentation/oops-tracing.txt - - You can use the "ksymoops" program to make sense of the dump. Find - the C++ sources under the scripts/ directory to avoid having to do - the dump lookup by hand: + - You can use the "ksymoops" program to make sense of the dump. This + utility can be downloaded from ftp://ftp.ocs.com.au/pub/ksymoops . + Alternately you can do the dump lookup by hand: - In debugging dumps like the above, it helps enormously if you can look up what the EIP value means. The hex value as such doesn't help diff --git a/arch/m68k/amiga/amisound.c b/arch/m68k/amiga/amisound.c index faba5841b4f0..2210d05d6603 100644 --- a/arch/m68k/amiga/amisound.c +++ b/arch/m68k/amiga/amisound.c @@ -54,7 +54,7 @@ void __init amiga_init_sound(void) } static void nosound( unsigned long ignored ); -static struct timer_list sound_timer = { NULL, NULL, 0, 0, nosound }; +static struct timer_list sound_timer = { function: nosound }; void amiga_mksound( unsigned int hz, unsigned int ticks ) { diff --git a/arch/m68k/apollo/dn_ints.c b/arch/m68k/apollo/dn_ints.c index e3a6281070a2..d46ba08529eb 100644 --- a/arch/m68k/apollo/dn_ints.c +++ b/arch/m68k/apollo/dn_ints.c @@ -128,8 +128,7 @@ static void dn_nosound (unsigned long ignored) { void dn_mksound( unsigned int count, unsigned int ticks ) { - static struct timer_list sound_timer = { NULL, NULL, 0, 0, - dn_nosound }; + static struct timer_list sound_timer = { function: dn_nosound }; del_timer( &sound_timer ); if(count) { diff --git a/arch/m68k/atari/atakeyb.c b/arch/m68k/atari/atakeyb.c index ebef991e9818..d7a64faea53e 100644 --- a/arch/m68k/atari/atakeyb.c +++ b/arch/m68k/atari/atakeyb.c @@ -272,7 +272,7 @@ static unsigned int key_repeat_delay = DEFAULT_KEYB_REP_DELAY; static unsigned int key_repeat_rate = DEFAULT_KEYB_REP_RATE; static unsigned char rep_scancode; -static struct timer_list atakeyb_rep_timer = { NULL, NULL, 0, 0, atakeyb_rep }; +static struct timer_list atakeyb_rep_timer = { function: atakeyb_rep }; static void atakeyb_rep( unsigned long ignore ) diff --git a/arch/m68k/mac/macboing.c b/arch/m68k/mac/macboing.c index 557bcba2752f..2a05a013f611 100644 --- a/arch/m68k/mac/macboing.c +++ b/arch/m68k/mac/macboing.c @@ -56,7 +56,7 @@ static void ( *mac_special_bell )( unsigned int, unsigned int, unsigned int ) = /* * our timer to start/continue/stop the bell */ -static struct timer_list mac_sound_timer = { NULL, NULL, 0, 0, mac_nosound }; +static struct timer_list mac_sound_timer = { function: mac_nosound }; /* * Sort of initialize the sound chip (called from mac_mksound on the first diff --git a/drivers/block/acsi_slm.c b/drivers/block/acsi_slm.c index 11a0a947f1ff..b8f1c693e17b 100644 --- a/drivers/block/acsi_slm.c +++ b/drivers/block/acsi_slm.c @@ -270,7 +270,7 @@ static int slm_get_pagesize( int device, int *w, int *h ); /************************* End of Prototypes **************************/ -static struct timer_list slm_timer = { NULL, NULL, 0, 0, slm_test_ready }; +static struct timer_list slm_timer = { function: slm_test_ready }; static struct file_operations slm_fops = { owner: THIS_MODULE, diff --git a/drivers/block/ps2esdi.c b/drivers/block/ps2esdi.c index 61cb27ec7aa0..8ff56a70aac8 100644 --- a/drivers/block/ps2esdi.c +++ b/drivers/block/ps2esdi.c @@ -114,14 +114,14 @@ static DECLARE_WAIT_QUEUE_HEAD(ps2esdi_int); static DECLARE_WAIT_QUEUE_HEAD(ps2esdi_wait_open); int no_int_yet; -static int access_count[MAX_HD] = {0,}; -static char ps2esdi_valid[MAX_HD] = {0,}; -static int ps2esdi_sizes[MAX_HD << 6] = {0,}; -static int ps2esdi_blocksizes[MAX_HD << 6] = {0,}; -static int ps2esdi_drives = 0; +static int access_count[MAX_HD]; +static char ps2esdi_valid[MAX_HD]; +static int ps2esdi_sizes[MAX_HD << 6]; +static int ps2esdi_blocksizes[MAX_HD << 6]; +static int ps2esdi_drives; static struct hd_struct ps2esdi[MAX_HD << 6]; static u_short io_base; -static struct timer_list esdi_timer = {{NULL, NULL}, 0, 0L, ps2esdi_reset_timer}; +static struct timer_list esdi_timer = { function: ps2esdi_reset_timer }; static int reset_status; static int ps2esdi_slot = -1; int tp720esdi = 0; /* Is it Integrated ESDI of ThinkPad-720? */ diff --git a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c index 8b551a99daa4..b71f023aa699 100644 --- a/drivers/cdrom/aztcd.c +++ b/drivers/cdrom/aztcd.c @@ -310,7 +310,7 @@ static char azt_auto_eject = AZT_AUTO_EJECT; static int AztTimeout, AztTries; static DECLARE_WAIT_QUEUE_HEAD(azt_waitq); -static struct timer_list delay_timer = { {NULL, NULL}, 0, 0, NULL }; +static struct timer_list delay_timer; static struct azt_DiskInfo DiskInfo; static struct azt_Toc Toc[MAX_TRACKS]; diff --git a/drivers/cdrom/sjcd.c b/drivers/cdrom/sjcd.c index b793bac4bf21..eb102a4a7fca 100644 --- a/drivers/cdrom/sjcd.c +++ b/drivers/cdrom/sjcd.c @@ -150,7 +150,7 @@ static struct sjcd_stat statistic; /* * Timer. */ -static struct timer_list sjcd_delay_timer = { function: NULL }; +static struct timer_list sjcd_delay_timer; #define SJCD_SET_TIMER( func, tmout ) \ ( sjcd_delay_timer.expires = jiffies+tmout, \ diff --git a/drivers/char/amikeyb.c b/drivers/char/amikeyb.c index 15e21be68ccf..73b8fecd21de 100644 --- a/drivers/char/amikeyb.c +++ b/drivers/char/amikeyb.c @@ -176,7 +176,7 @@ static unsigned int key_repeat_rate = DEFAULT_KEYB_REP_RATE; static unsigned char rep_scancode; static void amikeyb_rep(unsigned long ignore); -static struct timer_list amikeyb_rep_timer = {NULL, NULL, 0, 0, amikeyb_rep}; +static struct timer_list amikeyb_rep_timer = {function: amikeyb_rep}; static void amikeyb_rep(unsigned long ignore) { diff --git a/drivers/char/dn_keyb.c b/drivers/char/dn_keyb.c index 8d8766b85a7f..980ee13baaa1 100644 --- a/drivers/char/dn_keyb.c +++ b/drivers/char/dn_keyb.c @@ -51,8 +51,7 @@ static u_char *shadow_buf=&debug_buf2[0]; static short debug_buf_count=0; static int debug_buf_overrun=0,debug_timer_running=0; static unsigned long debug_buffer_updated=0; -static struct timer_list debug_keyb_timer = { NULL, NULL, 0, 0, - debug_keyb_timer_handler }; +static struct timer_list debug_keyb_timer = { function: debug_keyb_timer_handler }; #endif static u_short dnplain_map[NR_KEYS] __initdata = { diff --git a/drivers/char/ip2main.c b/drivers/char/ip2main.c index 449bd2f76a2a..6fbfe22dfa64 100644 --- a/drivers/char/ip2main.c +++ b/drivers/char/ip2main.c @@ -329,8 +329,7 @@ static long bh_counter = 0; * selected, the board is serviced periodically to see if anything needs doing. */ #define POLL_TIMEOUT (jiffies + 1) -static struct timer_list PollTimer = { {NULL, NULL}, 0, 0, ip2_poll }; -// next, prev, expires,data, func() +static struct timer_list PollTimer = { function: ip2_poll }; static char TimerOn = 0; #ifdef IP2DEBUG_TRACE diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile index b175eb893544..6030b63b38bb 100644 --- a/drivers/mtd/Makefile +++ b/drivers/mtd/Makefile @@ -1,205 +1,110 @@ -# $Id: Makefile,v 1.21 2000/07/13 10:42:55 dwmw2 Exp $ - -# Uncomment this to enable the DBG macro (see mtd.h) -#CFLAGS+= -DZDBG +# +# Makefile for the memory technology device drivers. +# +# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file). +# +# Note 2! The CFLAGS definitions are now inherited from the +# parent makes.. +# +# $Id: Makefile,v 1.22 2000/07/14 08:10:52 dwmw2 Exp $ ifndef CONFIG_MTD + # We're being invoked outside a normal kernel build. Fake it EXTRA_CFLAGS= -I$(shell pwd)/../include -HWDRIVERS = slram.o docprobe.o doc1000.o nora.o physmap.o rpxlite.o vmax301.o octagon-5066.o pmc551.o mtdram.o -USERDRIVERS = ftl.o nftl.o mtdblock.o mtdchar.o -MIX_OBJS = mtdcore.o mapped.o doc2000.o doc2001.o cfi_probe.o cfi_cmdset_0001.o -MI_OBJS = $(HWDRIVERS) $(USERDRIVERS) -CFLAGS_nftl.o := -DCONFIG_NFTL_RW -else - -O_TARGET := mtdlink.o -SUB_DIRS := -ALL_SUB_DIRS := -MOD_LIST_NAME := MTD_MODULES - - -ifeq ($(CONFIG_MTD),y) - OX_OBJS += mtdcore.o mapped.o -else - ifeq ($(CONFIG_MTD),m) - MX_OBJS += mtdcore.o mapped.o - endif -endif - -ifeq ($(CONFIG_MTD_NORA),y) - O_OBJS += nora.o -else - ifeq ($(CONFIG_MTD_NORA),m) - M_OBJS += nora.o - endif -endif - -ifeq ($(CONFIG_MTD_RPXLITE),y) - O_OBJS += rpxlite.o -else - ifeq ($(CONFIG_MTD_RPXLITE),m) - M_OBJS += rpxlite.o - endif -endif - -ifeq ($(CONFIG_MTD_PHYSMAP),y) - O_OBJS += physmap.o -else - ifeq ($(CONFIG_MTD_PHYSMAP),m) - M_OBJS += physmap.o - endif -endif - -ifeq ($(CONFIG_MTD_CFI),y) - OX_OBJS += cfi_probe.o -else - ifeq ($(CONFIG_MTD_CFI),m) - MX_OBJS += cfi_probe.o - endif -endif - -ifeq ($(CONFIG_MTD_CFI_INTELEXT),y) - OX_OBJS += cfi_cmdset_0001.o -else - ifeq ($(CONFIG_MTD_CFI_INTELEXT),m) - MX_OBJS += cfi_cmdset_0001.o - endif -endif - -ifeq ($(CONFIG_MTD_CFI_AMDSTD),y) - OX_OBJS += cfi_cmdset_0002.o -else - ifeq ($(CONFIG_MTD_CFI_AMDSTD),m) - MX_OBJS += cfi_cmdset_0002.o - endif -endif - -ifeq ($(CONFIG_MTD_DOC1000),y) - O_OBJS += doc1000.o -else - ifeq ($(CONFIG_MTD_DOC1000),m) - M_OBJS += doc1000.o - endif -endif - -ifeq ($(CONFIG_MTD_DOC2000),y) - OX_OBJS += doc2000.o -else - ifeq ($(CONFIG_MTD_DOC2000),m) - MX_OBJS += doc2000.o - endif -endif +MIX_OBJS = mtdcore.o doc2000.o doc2001.o cfi_probe.o cfi_cmdset_0001.o \ + map_ram.o map_rom.o cfi_cmdset_0002.o +MI_OBJS = doc1000.o docprobe.o slram.o pmc551.o mtdram.o physmap.o \ + nora.o octagon-5066.o pnc2000.o rpxlite.o vmax301.o mtdchar.o \ + mtdblock.o ftl.o nftl.o -ifeq ($(CONFIG_MTD_DOC2001),y) - OX_OBJS += doc2001.o -else - ifeq ($(CONFIG_MTD_DOC2001),m) - MX_OBJS += doc2001.o - endif -endif - -ifeq ($(CONFIG_MTD_DOCPROBE),y) - O_OBJS += docprobe.o -else - ifeq ($(CONFIG_MTD_DOCPROBE),m) - M_OBJS += docprobe.o - endif -endif - -ifeq ($(CONFIG_MTD_SLRAM),y) - O_OBJS += slram.o -else - ifeq ($(CONFIG_MTD_SLRAM),m) - M_OBJS += slram.o - endif -endif - -ifeq ($(CONFIG_MTD_OCTAGON),y) - O_OBJS += octagon-5066.o -else - ifeq ($(CONFIG_MTD_OCTAGON),m) - M_OBJS += octagon-5066.o - endif -endif - -ifeq ($(CONFIG_MTD_PMC551),y) - O_OBJS += pmc551.o -else - ifeq ($(CONFIG_MTD_PMC551),m) - M_OBJS += pmc551.o - endif -endif - -ifeq ($(CONFIG_MTD_PMC551_BUGFIX),y) - CFLAGS_pmc551.o += -DPMC551_DRAM_BUG -endif - -ifeq ($(CONFIG_MTD_VMAX),y) - O_OBJS += vmax301.o -else - ifeq ($(CONFIG_MTD_VMAX),m) - M_OBJS += vmax301.o - endif -endif +CFLAGS_nftl.o := -DCONFIG_NFTL_RW +CFLAGS_mtdram.o := -DCONFIG_MTDRAM_TOTAL_SIZE=4096 -DCONFIG_MTDRAM_ERASE_SIZE=128 +CFLAGS_physmap.o := -DCONFIG_MTD_PHYSMAP_START=0x8000000 -DCONFIG_MTD_PHYSMAP_LEN=0x4000000 -ifeq ($(CONFIG_MTD_MIXMEM),y) - O_OBJS += mixmem.o -else - ifeq ($(CONFIG_MTD_MIXMEM),m) - M_OBJS += mixmem.o - endif -endif +else -ifeq ($(CONFIG_MTD_MTDRAM),y) - O_OBJS += mtdram.o -else - ifeq ($(CONFIG_MTD_MTDRAM),m) - M_OBJS += mtdram.o - endif -endif +O_OBJS := +OX_OBJS := +M_OBJS := +MX_OBJS := -ifeq ($(CONFIG_MTD_PNC2000),y) - O_OBJS += pnc2000.o -else - ifeq ($(CONFIG_MTD_PNC2000),m) - M_OBJS += pnc2000.o - endif -endif +# Object file lists. -ifeq ($(CONFIG_FTL),y) - O_OBJS += ftl.o -else - ifeq ($(CONFIG_FTL),m) - M_OBJS += ftl.o - endif -endif - -ifeq ($(CONFIG_NFTL),y) - O_OBJS += nftl.o -else - ifeq ($(CONFIG_NFTL),m) - M_OBJS += nftl.o - endif -endif +obj-y := +obj-m := +obj-n := +obj- := -ifeq ($(CONFIG_MTD_BLOCK),y) - O_OBJS += mtdblock.o -else - ifeq ($(CONFIG_MTD_BLOCK),m) - M_OBJS += mtdblock.o - endif -endif +O_TARGET := mtdlink.o +SUB_DIRS := +ALL_SUB_DIRS := +MOD_SUB_DIRS := +MOD_LIST_NAME := MTD_MODULES +export-objs := mtdcore.o doc2000.o doc2001.o cfi_probe.o cfi_cmdset_0001.o cfi_cmdset_0002.o +list-multi := + +# MTD devices +obj-$(CONFIG_MTD) += mtdcore.o +obj-$(CONFIG_MTD_DOC1000) += doc1000.o +obj-$(CONFIG_MTD_DOC2000) += doc2000.o +obj-$(CONFIG_MTD_DOC2001) += doc2001.o +obj-$(CONFIG_MTD_DOCPROBE) += docprobe.o +obj-$(CONFIG_MTD_SLRAM) += slram.o +obj-$(CONFIG_MTD_PMC551) += pmc551.o +obj-$(CONFIG_MTD_MTDRAM) += mtdram.o + +# Chip drivers +obj-$(CONFIG_MTD_JEDEC) += jedec.o +obj-$(CONFIG_MTD_RAM) += map_ram.o +obj-$(CONFIG_MTD_ROM) += map_rom.o +obj-$(CONFIG_MTD_CFI) += cfi_probe.o +obj-$(CONFIG_MTD_CFI_INTELEXT) += cfi_cmdset_0001.o +obj-$(CONFIG_MTD_CFI_AMDSTD) += cfi_cmdset_0002.o + +# Chip mappings +obj-$(CONFIG_MTD_PHYSMAP) += physmap.o +obj-$(CONFIG_MTD_MIXMEM) += mixmem.o +obj-$(CONFIG_MTD_NORA) += nora.o +obj-$(CONFIG_MTD_OCTAGON) += octagon-5066.o +obj-$(CONFIG_MTD_PNC2000) += pnc2000.o +obj-$(CONFIG_MTD_RPXLITE) += rpxlite.o +obj-$(CONFIG_MTD_VMAX) += vmax301.o + +# Users +obj-$(CONFIG_MTD_CHAR) += mtdchar.o +obj-$(CONFIG_MTD_BLOCK) += mtdblock.o +obj-$(CONFIG_FTL) += ftl.o +obj-$(CONFIG_NFTL) += nftl.o + +# Extract lists of the multi-part drivers. +# The 'int-*' lists are the intermediate files used to build the multi's. + +multi-y := $(filter $(list-multi), $(obj-y)) +multi-m := $(filter $(list-multi), $(obj-m)) +int-y := $(sort $(foreach m, $(multi-y), $($(basename $(m))-objs))) +int-m := $(sort $(foreach m, $(multi-m), $($(basename $(m))-objs))) + +# Files that are both resident and modular: remove from modular. + +obj-m := $(filter-out $(obj-y), $(obj-m)) +int-m := $(filter-out $(int-y), $(int-m)) + +# Take multi-part drivers out of obj-y and put components in. + +obj-y := $(filter-out $(list-multi), $(obj-y)) $(int-y) + +# Translate to Rules.make lists. + +O_OBJS := $(filter-out $(export-objs), $(obj-y)) +OX_OBJS := $(filter $(export-objs), $(obj-y)) +M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) +MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) -ifeq ($(CONFIG_MTD_CHAR),y) - O_OBJS += mtdchar.o -else - ifeq ($(CONFIG_MTD_CHAR),m) - M_OBJS += mtdchar.o - endif -endif endif diff --git a/drivers/mtd/pmc551.c b/drivers/mtd/pmc551.c index 98d5c306929c..fdc80cbcfd20 100644 --- a/drivers/mtd/pmc551.c +++ b/drivers/mtd/pmc551.c @@ -1,5 +1,5 @@ /* - * $Id: pmc551.c,v 1.7 2000/07/03 10:01:38 dwmw2 Exp $ + * $Id: pmc551.c,v 1.8 2000/07/14 07:53:31 dwmw2 Exp $ * * PMC551 PCI Mezzanine Ram Device * @@ -53,6 +53,7 @@ * hang w/ a reboot beeing the only chance at recover. */ +#include #include #include #include @@ -343,7 +344,7 @@ out: */ static u32 fixup_pmc551 (struct pci_dev *dev) { -#ifdef PMC551_DRAM_BUG +#ifdef CONFIG_MTD_PMC551_BUGFIX u32 dram_data; #endif u32 size, dcmd; @@ -362,7 +363,7 @@ static u32 fixup_pmc551 (struct pci_dev *dev) * row mux values. We fix them here, but this will break other * memory configurations. */ -#ifdef PMC551_DRAM_BUG +#ifdef CONFIG_MTD_PMC551_BUGFIX pci_read_config_dword(dev, PMC551_DRAM_BLK0, &dram_data); size = PMC551_DRAM_BLK_GET_SIZE(dram_data); dram_data = PMC551_DRAM_BLK_SET_COL_MUX(dram_data, 0x5); @@ -386,7 +387,7 @@ static u32 fixup_pmc551 (struct pci_dev *dev) dram_data = PMC551_DRAM_BLK_SET_COL_MUX(dram_data, 0x5); dram_data = PMC551_DRAM_BLK_SET_ROW_MUX(dram_data, 0x9); pci_write_config_dword(dev, PMC551_DRAM_BLK3, dram_data); -#endif /* PMC551_DRAM_BUG */ +#endif /* CONFIG_MTD_PMC551_BUGFIX */ /* * Oops .. something went wrong @@ -550,7 +551,7 @@ int __init init_pmc551(void) printk(KERN_NOTICE "Ramix PMC551 PCI Mezzanine Ram Driver. (C) 1999,2000 Nortel Networks.\n"); - printk(KERN_INFO "$Id: pmc551.c,v 1.7 2000/07/03 10:01:38 dwmw2 Exp $\n"); + printk(KERN_INFO "$Id: pmc551.c,v 1.8 2000/07/14 07:53:31 dwmw2 Exp $\n"); if(!pci_present()) { printk(KERN_NOTICE "pmc551: PCI not enabled.\n"); diff --git a/drivers/net/atari_bionet.c b/drivers/net/atari_bionet.c index b0d8e73d46e0..275ef3296bf6 100644 --- a/drivers/net/atari_bionet.c +++ b/drivers/net/atari_bionet.c @@ -158,7 +158,7 @@ static int bionet_close(struct net_device *dev); static struct net_device_stats *net_get_stats(struct net_device *dev); static void bionet_tick(unsigned long); -static struct timer_list bionet_timer = { NULL, NULL, 0, 0, bionet_tick }; +static struct timer_list bionet_timer = { function: bionet_tick }; #define STRAM_ADDR(a) (((a) & 0xff000000) == 0) diff --git a/drivers/net/atari_pamsnet.c b/drivers/net/atari_pamsnet.c index f9b1eef79691..6aeb737d5d86 100644 --- a/drivers/net/atari_pamsnet.c +++ b/drivers/net/atari_pamsnet.c @@ -168,7 +168,7 @@ static void pamsnet_tick(unsigned long); static void pamsnet_intr(int irq, void *data, struct pt_regs *fp); -static struct timer_list pamsnet_timer = { NULL, NULL, 0, 0, pamsnet_tick }; +static struct timer_list pamsnet_timer = { function: amsnet_tick }; #define STRAM_ADDR(a) (((a) & 0xff000000) == 0) diff --git a/drivers/net/pcmcia/xircom_tulip_cb.c b/drivers/net/pcmcia/xircom_tulip_cb.c index f8075373e5b7..46f37e946a60 100644 --- a/drivers/net/pcmcia/xircom_tulip_cb.c +++ b/drivers/net/pcmcia/xircom_tulip_cb.c @@ -3010,7 +3010,8 @@ static void set_rx_mode(struct net_device *dev) /* Same setup recently queued, we need not add it. */ } else { unsigned long flags; - unsigned int entry, dummy = -1; + unsigned int entry; + int dummy = -1; save_flags(flags); cli(); entry = tp->cur_tx++ % TX_RING_SIZE; diff --git a/drivers/net/sk_g16.c b/drivers/net/sk_g16.c index 1a6da6e790f0..8ecc46db2dd1 100644 --- a/drivers/net/sk_g16.c +++ b/drivers/net/sk_g16.c @@ -632,6 +632,8 @@ static int __init SK_init_module (void) if (!SK_dev) return -ENOMEM; + SK_dev->base_addr = io; + rc = SK_init (SK_dev); if (rc) { unregister_netdev (SK_dev); diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index 9079f8113f9c..4f6252383d04 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c @@ -19,8 +19,6 @@ */ -static const char version[] = "Linux Tulip driver version 0.9.7 (June 17, 2000)\n"; - #include #include "tulip.h" #include @@ -29,6 +27,9 @@ static const char version[] = "Linux Tulip driver version 0.9.7 (June 17, 2000)\ #include #include +static char version[] __devinitdata = + "Linux Tulip driver version 0.9.8 (July 13, 2000)\n"; + /* A few user-configurable values. */ @@ -948,7 +949,8 @@ static void set_rx_mode(struct net_device *dev) if (tp->cur_tx - tp->dirty_tx > TX_RING_SIZE - 2) { /* Same setup recently queued, we need not add it. */ } else { - unsigned int entry, dummy = -1; + unsigned int entry; + int dummy = -1; /* Now add this frame to the Tx list. */ diff --git a/drivers/net/wan/cycx_main.c b/drivers/net/wan/cycx_main.c index eff2559d0f50..207c9e21c4bb 100644 --- a/drivers/net/wan/cycx_main.c +++ b/drivers/net/wan/cycx_main.c @@ -13,6 +13,8 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ============================================================================ +* 2000/07/13 acme remove useless #ifdef MODULE and crap +* #if KERNEL_VERSION > blah * 2000/07/06 acme __exit at cyclomx_cleanup * 2000/04/02 acme dprintk and cycx_debug * module_init/module_exit @@ -50,22 +52,18 @@ unsigned int cycx_debug = 0; -#ifdef MODULE MODULE_AUTHOR("Arnaldo Carvalho de Melo"); MODULE_DESCRIPTION("Cyclom 2X Sync Card Driver."); MODULE_PARM(debug, "i"); MODULE_PARM_DESC(debug, "cyclomx debug level"); -#endif /* Defines & Macros */ #define DRV_VERSION 0 /* version number */ -#define DRV_RELEASE 8 /* release (minor version) number */ +#define DRV_RELEASE 9 /* release (minor version) number */ #define MAX_CARDS 1 /* max number of adapters */ -#ifndef CONFIG_CYCLOMX_CARDS /* configurable option */ #define CONFIG_CYCLOMX_CARDS 1 -#endif /* Function Prototypes */ @@ -225,11 +223,7 @@ static int setup (wan_device_t *wandev, wandev_conf_t *conf) card->hw.dpmsize = CYCX_WINDOWSIZE; card->hw.fwid = CFID_X25_2X; card->lock = SPIN_LOCK_UNLOCKED; -#if LINUX_VERSION_CODE >= 0x020300 init_waitqueue_head(&card->wait_stats); -#else - card->wait_stats = NULL; -#endif err = cycx_setup(&card->hw, conf->data, conf->data_size); if (err) { diff --git a/drivers/parport/share.c b/drivers/parport/share.c index 50eb808429c8..92618e7b4680 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c @@ -122,7 +122,7 @@ static void attach_driver_chain(struct parport *port) spin_lock (&driverlist_lock); for (i = 0, drv = driver_chain; drv && i < count; drv = drv->next) - attach[i] = drv->attach; + attach[i++] = drv->attach; spin_unlock (&driverlist_lock); for (count = 0; count < i; count++) @@ -181,6 +181,9 @@ int parport_register_driver (struct parport_driver *drv) struct parport **ports; int count = 0, i; + if (!portlist) + get_lowlevel_driver (); + /* We have to take the portlist lock for this to be sure * that port is valid for the duration of the callback. */ @@ -201,7 +204,7 @@ int parport_register_driver (struct parport_driver *drv) spin_lock (&parportlist_lock); for (i = 0, port = portlist; port && i < count; port = port->next) - ports[i] = port; + ports[i++] = port; spin_unlock (&parportlist_lock); for (count = 0; count < i; count++) @@ -210,9 +213,6 @@ int parport_register_driver (struct parport_driver *drv) kfree (ports); } - if (!portlist) - get_lowlevel_driver (); - spin_lock (&driverlist_lock); drv->next = driver_chain; driver_chain = drv; diff --git a/drivers/scsi/pluto.c b/drivers/scsi/pluto.c index 518f1e26edb5..b4ebd88f38e0 100644 --- a/drivers/scsi/pluto.c +++ b/drivers/scsi/pluto.c @@ -48,7 +48,6 @@ static struct ctrl_inquiry { } *fcs __initdata = { 0 }; static int fcscount __initdata = 0; static atomic_t fcss __initdata = ATOMIC_INIT(0); -static struct timer_list fc_timer __initdata = { function: NULL }; DECLARE_MUTEX_LOCKED(fc_sem); static int pluto_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmnd *fcmd); @@ -92,6 +91,7 @@ int __init pluto_detect(Scsi_Host_Template *tpnt) int i, retry, nplutos; fc_channel *fc; Scsi_Device dev; + struct timer_list fc_timer = { function: pluto_detect_timeout }; tpnt->proc_name = "pluto"; fcscount = 0; @@ -121,7 +121,6 @@ int __init pluto_detect(Scsi_Host_Template *tpnt) memset (fcs, 0, sizeof (struct ctrl_inquiry) * fcscount); memset (&dev, 0, sizeof(dev)); atomic_set (&fcss, fcscount); - fc_timer.function = pluto_detect_timeout; i = 0; for_each_online_fc_channel(fc) { @@ -192,7 +191,7 @@ int __init pluto_detect(Scsi_Host_Template *tpnt) if (!atomic_read(&fcss)) break; /* All fc channels have answered us */ } - del_timer(&fc_timer); + del_timer_sync(&fc_timer); PLND(("Finished search\n")) for (i = 0, nplutos = 0; i < fcscount; i++) { diff --git a/include/linux/cyclomx.h b/include/linux/cyclomx.h index 983295c18357..555d38fbeed6 100644 --- a/include/linux/cyclomx.h +++ b/include/linux/cyclomx.h @@ -13,6 +13,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ============================================================================ +* 2000/07/13 acme remove crap #if KERNEL_VERSION > blah * 2000/01/21 acme rename cyclomx_open to cyclomx_mod_inc_use_count * and cyclomx_close to cyclomx_mod_dec_use_count * 1999/05/19 acme wait_queue_head_t wait_stats(support for 2.3.*) @@ -58,11 +59,7 @@ typedef struct cycx { spinlock_t lock; char in_isr; /* interrupt-in-service flag */ char buff_int_mode_unbusy; /* flag for carrying out dev_tint */ -#if (LINUX_VERSION_CODE >= 0x20300) wait_queue_head_t wait_stats; /* to wait for the STATS indication */ -#else - struct wait_queue* wait_stats; /* to wait for the STATS indication */ -#endif u32 mbox; /* -> mailbox */ void (*isr)(struct cycx* card); /* interrupt service routine */ int (*exec)(struct cycx* card, void* u_cmd, void* u_data); diff --git a/include/linux/netfilter_ipv4/ip_nat_core.h b/include/linux/netfilter_ipv4/ip_nat_core.h index 28735e0c1d0e..e34e08331052 100644 --- a/include/linux/netfilter_ipv4/ip_nat_core.h +++ b/include/linux/netfilter_ipv4/ip_nat_core.h @@ -16,10 +16,10 @@ extern unsigned int do_bindings(struct ip_conntrack *ct, extern struct list_head protos; -extern void icmp_reply_translation(struct sk_buff *skb, - struct ip_conntrack *conntrack, - unsigned int hooknum, - int dir); +extern unsigned int icmp_reply_translation(struct sk_buff *skb, + struct ip_conntrack *conntrack, + unsigned int hooknum, + int dir); extern void replace_in_hashes(struct ip_conntrack *conntrack, struct ip_nat_info *info); diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index c1d6ff312855..362f07bee40f 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h @@ -280,7 +280,7 @@ struct ipt_get_entries unsigned int size; /* The entries. */ - unsigned char entries[0]; + struct ipt_entry entrytable[0]; }; /* Standard return verdict, or do jump. */ diff --git a/include/linux/netfilter_ipv4/ipt_REJECT.h b/include/linux/netfilter_ipv4/ipt_REJECT.h index eeafdf46896f..ad195e435ba9 100644 --- a/include/linux/netfilter_ipv4/ipt_REJECT.h +++ b/include/linux/netfilter_ipv4/ipt_REJECT.h @@ -6,7 +6,10 @@ enum ipt_reject_with { IPT_ICMP_HOST_UNREACHABLE, IPT_ICMP_PROT_UNREACHABLE, IPT_ICMP_PORT_UNREACHABLE, - IPT_ICMP_ECHOREPLY + IPT_ICMP_ECHOREPLY, + IPT_ICMP_NET_PROHIBITED, + IPT_ICMP_HOST_PROHIBITED, + IPT_TCP_RESET }; struct ipt_reject_info { diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index f3617397cbe9..0716ae947661 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h @@ -286,7 +286,7 @@ struct ip6t_get_entries unsigned int size; /* The entries. */ - unsigned char entries[0]; + struct ip6t_entry entrytable[0]; }; /* Standard return verdict, or do jump. */ diff --git a/mm/vmscan.c b/mm/vmscan.c index f19721ee5920..c43456da621a 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -548,9 +548,9 @@ static int do_try_to_free_pages(unsigned int gfp_mask) if (!--count) goto done; } - /* We return 1 if we are freed some page, or - * there are no memory pressure remaining */ - return (count != FREE_COUNT || !memory_pressure()); + /* Return 1 if any page is freed, or + * there are no more memory pressure */ + return (count < FREE_COUNT || !memory_pressure()); done: return 1; diff --git a/net/core/netfilter.c b/net/core/netfilter.c index b1f8a9fe8083..c372ab029f5a 100644 --- a/net/core/netfilter.c +++ b/net/core/netfilter.c @@ -261,11 +261,11 @@ void nf_debug_ip_finish_output2(struct sk_buff *skb) if (skb->nf_debug != ((1 << NF_IP_PRE_ROUTING) | (1 << NF_IP_FORWARD) | (1 << NF_IP_POST_ROUTING))) { - /* Fragments will have no owners, but still - may be local */ - if (!(skb->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) - || skb->nf_debug != ((1 << NF_IP_LOCAL_OUT) - | (1 << NF_IP_POST_ROUTING))){ + /* Fragments, entunnelled packets, TCP RSTs + generated by ipt_REJECT will have no + owners, but still may be local */ + if (skb->nf_debug != ((1 << NF_IP_LOCAL_OUT) + | (1 << NF_IP_POST_ROUTING))){ printk("ip_finish_output:" " bad unowned skb = %p: ",skb); debug_print_hooks_ip(skb->nf_debug); diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index d97558a24a70..a2bc393987a7 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c @@ -104,7 +104,7 @@ static void dn_run_flush(unsigned long dummy); static struct dn_rt_hash_bucket *dn_rt_hash_table; static unsigned dn_rt_hash_mask; -static struct timer_list dn_route_timer = { function: NULL }; +static struct timer_list dn_route_timer; static struct timer_list dn_rt_flush_timer = { function: dn_run_flush }; int decnet_dst_gc_interval = 2; diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c index 47e7fb01bdf2..14ebb46e1183 100644 --- a/net/ipv4/netfilter/ip_conntrack_core.c +++ b/net/ipv4/netfilter/ip_conntrack_core.c @@ -551,6 +551,7 @@ static inline struct ip_conntrack * resolve_normal_ct(struct sk_buff *skb, struct ip_conntrack_protocol *proto, int *set_reply, + unsigned int hooknum, enum ip_conntrack_info *ctinfo) { struct ip_conntrack_tuple tuple; @@ -573,6 +574,21 @@ resolve_normal_ct(struct sk_buff *skb, if (DIRECTION(h) == IP_CT_DIR_REPLY) { /* Reply on unconfirmed connection => unclassifiable */ if (!(h->ctrack->status & IPS_CONFIRMED)) { + /* Exception: local TCP RSTs (generated by + REJECT target). */ + if (hooknum == NF_IP_LOCAL_OUT + && h->tuple.dst.protonum == IPPROTO_TCP) { + const struct tcphdr *tcph + = (const struct tcphdr *) + ((u_int32_t *)skb->nh.iph + + skb->nh.iph->ihl); + if (tcph->rst) { + *ctinfo = IP_CT_ESTABLISHED + + IP_CT_IS_REPLY; + *set_reply = 0; + goto set_skb; + } + } DEBUGP("Reply on unconfirmed connection\n"); ip_conntrack_put(h->ctrack); return NULL; @@ -598,6 +614,7 @@ resolve_normal_ct(struct sk_buff *skb, } *set_reply = 0; } + set_skb: skb->nfct = &h->ctrack->infos[*ctinfo]; return h->ctrack; } @@ -669,7 +686,7 @@ unsigned int ip_conntrack_in(unsigned int hooknum, && icmp_error_track(*pskb, &ctinfo, hooknum)) return NF_ACCEPT; - if (!(ct = resolve_normal_ct(*pskb, proto, &set_reply, &ctinfo))) + if (!(ct = resolve_normal_ct(*pskb, proto,&set_reply,hooknum,&ctinfo))) /* Not valid part of a connection */ return NF_ACCEPT; diff --git a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c index 77db6572fd6e..486683bec662 100644 --- a/net/ipv4/netfilter/ip_conntrack_standalone.c +++ b/net/ipv4/netfilter/ip_conntrack_standalone.c @@ -169,11 +169,15 @@ static unsigned int ip_confirm(unsigned int hooknum, const struct net_device *out, int (*okfn)(struct sk_buff *)) { - /* We've seen it coming out the other side: confirm */ + /* We've seen it coming out the other side: confirm (only if + new packet: REJECT can generate TCP RESET response, or ICMP + errors) */ if ((*pskb)->nfct) { struct ip_conntrack *ct = (struct ip_conntrack *)(*pskb)->nfct->master; - if (!(ct->status & IPS_CONFIRMED)) + /* ctinfo is the index of the nfct inside the conntrack */ + if ((*pskb)->nfct - ct->infos == IP_CT_NEW + && !(ct->status & IPS_CONFIRMED)) ip_conntrack_confirm(ct); } return NF_ACCEPT; @@ -191,7 +195,8 @@ static unsigned int ip_refrag(unsigned int hooknum, if ((*pskb)->nfct) { struct ip_conntrack *ct = (struct ip_conntrack *)(*pskb)->nfct->master; - if (!(ct->status & IPS_CONFIRMED)) + if ((*pskb)->nfct - ct->infos == IP_CT_NEW + && !(ct->status & IPS_CONFIRMED)) ip_conntrack_confirm(ct); } diff --git a/net/ipv4/netfilter/ip_fw_compat.c b/net/ipv4/netfilter/ip_fw_compat.c index 6f0503e058f7..3c8c2e8518e3 100644 --- a/net/ipv4/netfilter/ip_fw_compat.c +++ b/net/ipv4/netfilter/ip_fw_compat.c @@ -71,7 +71,8 @@ confirm_connection(struct sk_buff *skb) struct ip_conntrack *ct = (struct ip_conntrack *)skb->nfct->master; - if (!(ct->status & IPS_CONFIRMED)) + if (skb->nfct - ct->infos == IP_CT_NEW + && !(ct->status & IPS_CONFIRMED)) ip_conntrack_confirm(ct); } } diff --git a/net/ipv4/netfilter/ip_fw_compat_masq.c b/net/ipv4/netfilter/ip_fw_compat_masq.c index 1e67211744f8..ce3180d392ec 100644 --- a/net/ipv4/netfilter/ip_fw_compat_masq.c +++ b/net/ipv4/netfilter/ip_fw_compat_masq.c @@ -105,7 +105,7 @@ check_for_masq_error(struct sk_buff *skb) /* Wouldn't be here if not tracked already => masq'ed ICMP ping or error related to masq'd connection */ IP_NF_ASSERT(ct); - if (CTINFO2DIR(ctinfo) == IP_CT_DIR_ORIGINAL) { + if (ctinfo == IP_CT_RELATED) { icmp_reply_translation(skb, ct, NF_IP_PRE_ROUTING, CTINFO2DIR(ctinfo)); icmp_reply_translation(skb, ct, NF_IP_POST_ROUTING, diff --git a/net/ipv4/netfilter/ip_nat_core.c b/net/ipv4/netfilter/ip_nat_core.c index a07749ecb774..c8bf259b9469 100644 --- a/net/ipv4/netfilter/ip_nat_core.c +++ b/net/ipv4/netfilter/ip_nat_core.c @@ -735,7 +735,7 @@ do_bindings(struct ip_conntrack *ct, } else return NF_ACCEPT; } -void +unsigned int icmp_reply_translation(struct sk_buff *skb, struct ip_conntrack *conntrack, unsigned int hooknum, @@ -749,6 +749,22 @@ icmp_reply_translation(struct sk_buff *skb, struct ip_nat_info *info = &conntrack->nat.info; IP_NF_ASSERT(skb->len >= iph->ihl*4 + sizeof(struct icmphdr)); + /* Must be RELATED */ + IP_NF_ASSERT(skb->nfct - (struct ip_conntrack *)skb->nfct->master + == IP_CT_RELATED + || skb->nfct - (struct ip_conntrack *)skb->nfct->master + == IP_CT_RELATED+IP_CT_IS_REPLY); + + /* Redirects on non-null nats must be dropped, else they'll + start talking to each other without our translation, and be + confused... --RR */ + if (hdr->type == ICMP_REDIRECT) { + /* Don't care about races here. */ + if (info->initialized + != ((1 << IP_NAT_MANIP_SRC) | (1 << IP_NAT_MANIP_DST)) + || info->num_manips != 0) + return NF_DROP; + } DEBUGP("icmp_reply_translation: translating error %p hook %u dir %s\n", skb, hooknum, dir == IP_CT_DIR_ORIGINAL ? "ORIG" : "REPLY"); @@ -810,6 +826,8 @@ icmp_reply_translation(struct sk_buff *skb, hdr->checksum = 0; hdr->checksum = ip_compute_csum((unsigned char *)hdr, sizeof(*hdr) + datalen); + + return NF_ACCEPT; } int ip_nat_helper_register(struct ip_nat_helper *me) diff --git a/net/ipv4/netfilter/ip_nat_standalone.c b/net/ipv4/netfilter/ip_nat_standalone.c index 11e16e25e391..3334a64c28da 100644 --- a/net/ipv4/netfilter/ip_nat_standalone.c +++ b/net/ipv4/netfilter/ip_nat_standalone.c @@ -84,9 +84,8 @@ ip_nat_fn(unsigned int hooknum, case IP_CT_RELATED: case IP_CT_RELATED+IP_CT_IS_REPLY: if ((*pskb)->nh.iph->protocol == IPPROTO_ICMP) { - icmp_reply_translation(*pskb, ct, hooknum, - CTINFO2DIR(ctinfo)); - return NF_ACCEPT; + return icmp_reply_translation(*pskb, ct, hooknum, + CTINFO2DIR(ctinfo)); } /* Fall thru... (Only ICMPs can be IP_CT_IS_REPLY) */ case IP_CT_NEW: diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c index 792ae1552297..39574b7d477a 100644 --- a/net/ipv4/netfilter/ip_queue.c +++ b/net/ipv4/netfilter/ip_queue.c @@ -244,7 +244,7 @@ static int ipq_set_verdict(ipq_queue_t *q, { ipq_queue_element_t *e; - if (v->value < 0 || v->value > NF_MAX_VERDICT) + if (v->value > NF_MAX_VERDICT) return -EINVAL; e = ipq_dequeue(q, id_cmp, v->id); if (e == NULL) @@ -309,10 +309,9 @@ static inline int dev_cmp(ipq_queue_element_t *e, unsigned long ifindex) if (e->info->indev->ifindex == ifindex) return 1; if (e->info->outdev) - if (e->info->outdev->ifindex == ifindex); + if (e->info->outdev->ifindex == ifindex) return 1; return 0; - } /* Drop any queued packets associated with device ifindex */ diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 3105f5a18a37..40b19760bc54 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c @@ -1029,7 +1029,7 @@ get_entries(const struct ipt_get_entries *entries, t->private->number); if (entries->size == t->private->size) ret = copy_entries_to_user(t->private->size, - t, uptr->entries); + t, uptr->entrytable); else { duprintf("get_entries: I've got %u not %u!\n", t->private->size, diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c index 220cdb568d35..c63e95fe84cf 100644 --- a/net/ipv4/netfilter/ipt_REJECT.c +++ b/net/ipv4/netfilter/ipt_REJECT.c @@ -7,6 +7,7 @@ #include #include #include +#include struct in_device; #include #include @@ -18,6 +19,113 @@ struct in_device; #define DEBUGP(format, args...) #endif +/* Send RST reply */ +static void send_reset(struct sk_buff *oldskb) +{ + struct sk_buff *nskb; + struct tcphdr *tcph; + struct rtable *rt; + unsigned int tcplen; + int needs_ack; + + /* Clone skb (skb is about to be dropped, so we don't care) */ + nskb = skb_clone(oldskb, GFP_ATOMIC); + if (!nskb) + return; + + /* This packet will not be the same as the other: clear nf fields */ + nf_conntrack_put(nskb->nfct); + nskb->nfct = NULL; + nskb->nfcache = 0; +#ifdef CONFIG_NETFILTER_DEBUG + nskb->nf_debug = 0; +#endif + + /* IP header checks: fragment, too short. */ + if (nskb->nh.iph->frag_off & htons(IP_OFFSET) + || nskb->len < (nskb->nh.iph->ihl<<2) + sizeof(struct tcphdr)) + goto free_nskb; + + tcph = (struct tcphdr *)((u_int32_t*)nskb->nh.iph + nskb->nh.iph->ihl); + tcplen = nskb->len - nskb->nh.iph->ihl*4; + + /* Check checksum. */ + if (tcp_v4_check(tcph, tcplen, nskb->nh.iph->saddr, + nskb->nh.iph->daddr, + csum_partial((char *)tcph, tcplen, 0)) != 0) + goto free_nskb; + + /* No RST for RST. */ + if (tcph->rst) + goto free_nskb; + + nskb->nh.iph->daddr = xchg(&nskb->nh.iph->saddr, nskb->nh.iph->daddr); + tcph->source = xchg(&tcph->dest, tcph->source); + + /* Truncate to length (no data) */ + tcph->doff = sizeof(struct tcphdr)/4; + skb_trim(nskb, nskb->nh.iph->ihl*4 + sizeof(struct tcphdr)); + + if (tcph->ack) { + needs_ack = 0; + tcph->seq = tcph->ack_seq; + tcph->ack_seq = 0; + } else { + needs_ack = 1; + tcph->seq = 0; + tcph->ack_seq = htonl(ntohl(tcph->seq) + tcph->syn + tcph->fin + + tcplen - (tcph->doff<<2)); + } + + /* Reset flags */ + ((u_int8_t *)tcph)[13] = 0; + tcph->rst = 1; + if (needs_ack) + tcph->ack = 1; + + tcph->window = 0; + tcph->urg_ptr = 0; + + /* Adjust TCP checksum */ + tcph->check = 0; + tcph->check = tcp_v4_check(tcph, sizeof(struct tcphdr), + nskb->nh.iph->saddr, + nskb->nh.iph->daddr, + csum_partial((char *)tcph, + sizeof(struct tcphdr), 0)); + + /* Adjust IP TTL, DF */ + nskb->nh.iph->ttl = MAXTTL; + /* Set DF, id = 0 */ + nskb->nh.iph->frag_off = htons(IP_DF); + nskb->nh.iph->id = 0; + + /* Adjust IP checksum */ + nskb->nh.iph->check = 0; + nskb->nh.iph->check = ip_fast_csum((unsigned char *)nskb->nh.iph, + nskb->nh.iph->ihl); + + /* Routing */ + if (ip_route_output(&rt, nskb->nh.iph->daddr, nskb->nh.iph->saddr, + RT_TOS(nskb->nh.iph->tos) | RTO_CONN, + 0) != 0) + goto free_nskb; + + dst_release(nskb->dst); + nskb->dst = &rt->u.dst; + + /* "Never happens" */ + if (nskb->len > nskb->dst->pmtu) + goto free_nskb; + + NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, nskb, NULL, nskb->dst->dev, + ip_finish_output); + return; + + free_nskb: + kfree_skb(nskb); +} + static unsigned int reject(struct sk_buff **pskb, unsigned int hooknum, const struct net_device *in, @@ -43,6 +151,12 @@ static unsigned int reject(struct sk_buff **pskb, case IPT_ICMP_PORT_UNREACHABLE: icmp_send(*pskb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0); break; + case IPT_ICMP_NET_PROHIBITED: + icmp_send(*pskb, ICMP_DEST_UNREACH, ICMP_NET_ANO, 0); + break; + case IPT_ICMP_HOST_PROHIBITED: + icmp_send(*pskb, ICMP_DEST_UNREACH, ICMP_HOST_ANO, 0); + break; case IPT_ICMP_ECHOREPLY: { struct icmphdr *icmph = (struct icmphdr *) ((u_int32_t *)(*pskb)->nh.iph + (*pskb)->nh.iph->ihl); @@ -64,6 +178,9 @@ static unsigned int reject(struct sk_buff **pskb, } } break; + case IPT_TCP_RESET: + send_reset(*pskb); + break; } return NF_DROP; @@ -96,7 +213,7 @@ static int check(const char *tablename, /* Only allow these for packet filtering. */ if (strcmp(tablename, "filter") != 0) { - DEBUGP("REJECT: bad table `%s'.\n", table); + DEBUGP("REJECT: bad table `%s'.\n", tablename); return 0; } if ((hook_mask & ~((1 << NF_IP_LOCAL_IN) @@ -118,6 +235,18 @@ static int check(const char *tablename, DEBUGP("REJECT: ECHOREPLY illegal for non-ping\n"); return 0; } + } else if (rejinfo->with == IPT_TCP_RESET) { + /* Must specify that it's a TCP packet */ + if (e->ip.proto != IPPROTO_TCP + || (e->ip.invflags & IPT_INV_PROTO)) { + DEBUGP("REJECT: TCP_RESET illegal for non-tcp\n"); + return 0; + } + /* Only for local input. Rest is too dangerous. */ + if ((hook_mask & ~(1 << NF_IP_LOCAL_IN)) != 0) { + DEBUGP("REJECT: TCP_RESET only from INPUT\n"); + return 0; + } } return 1; diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index dea475febb76..b3ba4383d59b 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c @@ -1075,7 +1075,7 @@ get_entries(const struct ip6t_get_entries *entries, t->private->number); if (entries->size == t->private->size) ret = copy_entries_to_user(t->private->size, - t, uptr->entries); + t, uptr->entrytable); else { duprintf("get_entries: I've got %u not %u!\n", t->private->size, diff --git a/scripts/Menuconfig b/scripts/Menuconfig index c59053f1ffbd..77d919b51890 100644 --- a/scripts/Menuconfig +++ b/scripts/Menuconfig @@ -1441,7 +1441,7 @@ then if [ ! -f .hdepend -o "$CONFIG_MODVERSIONS" = "y" ] ; then echo "*** Next, you must run 'make dep'." else - echo "*** Next, you may run 'make zImage', 'make zdisk', or 'make zlilo.'" + echo "*** Next, you may run 'make bzImage', 'make bzdisk', or 'make install'." fi echo else -- 2.39.5