Commit a0f3dc93 authored by Linus Torvalds's avatar Linus Torvalds

Import pre2.0.11

parent 77b785ce
...@@ -735,7 +735,7 @@ D: Author of the dialog utility, foundation ...@@ -735,7 +735,7 @@ D: Author of the dialog utility, foundation
D: for Menuconfig's lxdialog. D: for Menuconfig's lxdialog.
N: Volker Lendecke N: Volker Lendecke
E: lendecke@namu01.gwdg.de E: lendecke@namu01.Num.Math.Uni-Goettingen.de
D: Kernel smbfs (to mount WfW, NT and OS/2 network drives.) D: Kernel smbfs (to mount WfW, NT and OS/2 network drives.)
D: NCP filesystem support (to mount NetWare volumes) D: NCP filesystem support (to mount NetWare volumes)
S: Innersteweg 11 S: Innersteweg 11
......
...@@ -32,7 +32,7 @@ All audio mode commands have the one of the following form: ...@@ -32,7 +32,7 @@ All audio mode commands have the one of the following form:
where xx is a two-character code and v are alphanumerical parameters. where xx is a two-character code and v are alphanumerical parameters.
The following commands are supported: The following commands are supported:
AT+VNH=x Auto hangup settting. NO EFFECT, supported AT+VNH=x Auto hangup setting. NO EFFECT, supported
for compatibility only. for compatibility only.
AT+VNH? Always reporting "1" AT+VNH? Always reporting "1"
AT+VNH=? Always reporting "1" AT+VNH=? Always reporting "1"
...@@ -100,7 +100,7 @@ General behavior and description of data formats/protocol. ...@@ -100,7 +100,7 @@ General behavior and description of data formats/protocol.
<DLE>c FAX calling tone received. <DLE>c FAX calling tone received.
<DLE>b busy tone received. <DLE>b busy tone received.
<DLE>q quiet. Silence detected after non-silence. <DLE>q quiet. Silence detected after non-silence.
<DLE>s silence. Silence dectected from the <DLE>s silence. Silence detected from the
start of recording. start of recording.
Any character sent by the application, except XON (0x11) or XOFF (0x13) Any character sent by the application, except XON (0x11) or XOFF (0x13)
...@@ -109,7 +109,7 @@ General behavior and description of data formats/protocol. ...@@ -109,7 +109,7 @@ General behavior and description of data formats/protocol.
Audio playback. Audio playback.
When sending audio data, upon AT+VTX command, emulator responds with When sending audio data, upon AT+VTX command, emulator responds with
CONNECT, and starts transfering data from application to the phone line. CONNECT, and starts transferring data from application to the phone line.
The same DLE sequences apply to this mode. The same DLE sequences apply to this mode.
...@@ -217,7 +217,7 @@ S: Maintained ...@@ -217,7 +217,7 @@ S: Maintained
NCP FILESYSTEM: NCP FILESYSTEM:
P: Volker Lendecke P: Volker Lendecke
M: lendecke@namu01.gwdg.de M: lendecke@namu01.Num.Math.Uni-Goettingen.de
L: linware@sh.cvut.cz L: linware@sh.cvut.cz
S: Maintained S: Maintained
...@@ -253,7 +253,7 @@ S: Maintained ...@@ -253,7 +253,7 @@ S: Maintained
SMB FILESYSTEM: SMB FILESYSTEM:
P: Volker Lendecke P: Volker Lendecke
M: lendecke@namu01.gwdg.de M: lendecke@namu01.Num.Math.Uni-Goettingen.de
L: samba@listproc.anu.edu.au L: samba@listproc.anu.edu.au
S: Odd Fixes S: Odd Fixes
......
VERSION = 1 VERSION = 1
PATCHLEVEL = 99 PATCHLEVEL = 99
SUBLEVEL = 10 SUBLEVEL = 11
ARCH = i386 ARCH = i386
......
...@@ -142,6 +142,7 @@ CONFIG_NFS_FS=y ...@@ -142,6 +142,7 @@ CONFIG_NFS_FS=y
CONFIG_ISO9660_FS=y CONFIG_ISO9660_FS=y
# CONFIG_HPFS_FS is not set # CONFIG_HPFS_FS is not set
# CONFIG_SYSV_FS is not set # CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set
# #
# Character devices # Character devices
......
...@@ -122,7 +122,7 @@ static unsigned long do_fast_gettimeoffset(void) ...@@ -122,7 +122,7 @@ static unsigned long do_fast_gettimeoffset(void)
/* /*
* Due to rounding errors (and jiffies inconsistencies), * Due to rounding errors (and jiffies inconsistencies),
* we need to check the result so that we'll get a timer * we need to check the result so that we'll get a timer
* that is monotonous. * that is monotonic.
*/ */
if (edx >= 997670/HZ) if (edx >= 997670/HZ)
edx = 997670/HZ-1; edx = 997670/HZ-1;
......
This diff is collapsed.
...@@ -98,6 +98,8 @@ ...@@ -98,6 +98,8 @@
* from Gerhard Zuber <zuber@berlin.snafu.de>. * from Gerhard Zuber <zuber@berlin.snafu.de>.
* Let open succeed even if there's no loaded disc. * Let open succeed even if there's no loaded disc.
* 3.13 May 19, 1996 -- Fixes for changer code. * 3.13 May 19, 1996 -- Fixes for changer code.
* 3.14 May 29, 1996 -- Add work-around for Vertos 600.
* (From Hennus Bergman <hennus@sky.ow.nl>.)
* *
* NOTE: Direct audio reads will only work on some types of drive. * NOTE: Direct audio reads will only work on some types of drive.
* So far, i've received reports of success for Sony and Toshiba drives. * So far, i've received reports of success for Sony and Toshiba drives.
...@@ -2597,6 +2599,13 @@ void ide_cdrom_setup (ide_drive_t *drive) ...@@ -2597,6 +2599,13 @@ void ide_cdrom_setup (ide_drive_t *drive)
CDROM_CONFIG_FLAGS (drive)->subchan_as_bcd = 1; CDROM_CONFIG_FLAGS (drive)->subchan_as_bcd = 1;
} }
else if (strcmp (drive->id->model, "V006E0DS") == 0 &&
drive->id->fw_rev[4] == '1' &&
drive->id->fw_rev[6] <= '2') {
/* Vertos 600 ESD. */
CDROM_CONFIG_FLAGS (drive)->toctracks_as_bcd = 1;
}
else if (strcmp (drive->id->model, else if (strcmp (drive->id->model,
"NEC CD-ROM DRIVE:260") == 0 && "NEC CD-ROM DRIVE:260") == 0 &&
strcmp (drive->id->fw_rev, "1.01") == 0) { strcmp (drive->id->fw_rev, "1.01") == 0) {
...@@ -2624,14 +2633,15 @@ void ide_cdrom_setup (ide_drive_t *drive) ...@@ -2624,14 +2633,15 @@ void ide_cdrom_setup (ide_drive_t *drive)
/* /*
* TODO: * TODO (for 2.1?):
* CDROMRESET * Avoid printing error messages for expected errors from the drive.
* Lock the door when a read request completes successfully and the * Integrate with generic cdrom driver.
* door is not already locked. Also try to reorganize to reduce * Query the drive to find what features are available
* duplicated functionality between read and ioctl paths? * before trying to use them.
* Establish interfaces for an IDE port driver, and break out the cdrom * Integrate spindown time adjustment patch.
* code into a loadable module. * Modularize.
* Support changers better. * CDROMRESET ioctl.
* Better support for changers.
*/ */
......
...@@ -1103,7 +1103,7 @@ static int isdn_tty_ioctl(struct tty_struct *tty, struct file *file, ...@@ -1103,7 +1103,7 @@ static int isdn_tty_ioctl(struct tty_struct *tty, struct file *file,
return isdn_tty_set_modem_info(info, cmd, (uint *) arg); return isdn_tty_set_modem_info(info, cmd, (uint *) arg);
case TIOCSERGETLSR: /* Get line status register */ case TIOCSERGETLSR: /* Get line status register */
#ifdef ISDN_DEBUG_MODEM_IOCTL #ifdef ISDN_DEBUG_MODEM_IOCTL
printk(KERN_DEBUG "ttyI%d ioctl TIOSERGETLSR\n", info->line); printk(KERN_DEBUG "ttyI%d ioctl TIOCSERGETLSR\n", info->line);
#endif #endif
error = verify_area(VERIFY_WRITE, (void *) arg, sizeof(uint)); error = verify_area(VERIFY_WRITE, (void *) arg, sizeof(uint));
if (error) if (error)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* $Log: isdnl3.c,v $ * $Log: isdnl3.c,v $
* Revision 1.6 1996/05/21 11:33:50 keil * Revision 1.6 1996/05/21 11:33:50 keil
* Adding SETUP_ACKNOWLEGDE as answer of a SETUP message. * Adding SETUP_ACKNOWLEDGE as answer of a SETUP message.
* *
* Revision 1.5 1996/05/18 01:37:16 fritz * Revision 1.5 1996/05/18 01:37:16 fritz
* Added spelling corrections and some minor changes * Added spelling corrections and some minor changes
......
...@@ -263,8 +263,16 @@ static struct device atp_dev = { ...@@ -263,8 +263,16 @@ static struct device atp_dev = {
which means "don't probe". These entries exist to only to provide empty which means "don't probe". These entries exist to only to provide empty
slots which may be enabled at boot-time. */ slots which may be enabled at boot-time. */
static struct device eth7_dev = {
"eth7", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, NEXT_DEV, ethif_probe };
static struct device eth6_dev = {
"eth6", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, &eth7_dev, ethif_probe };
static struct device eth5_dev = {
"eth5", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, &eth6_dev, ethif_probe };
static struct device eth4_dev = {
"eth4", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, &eth5_dev, ethif_probe };
static struct device eth3_dev = { static struct device eth3_dev = {
"eth3", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, NEXT_DEV, ethif_probe }; "eth3", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, &eth4_dev, ethif_probe };
static struct device eth2_dev = { static struct device eth2_dev = {
"eth2", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, &eth3_dev, ethif_probe }; "eth2", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, &eth3_dev, ethif_probe };
static struct device eth1_dev = { static struct device eth1_dev = {
......
...@@ -261,6 +261,7 @@ printk("Required room: %d, Tunnel hlen: %d\n", max_headroom, TUNL_HLEN); ...@@ -261,6 +261,7 @@ printk("Required room: %d, Tunnel hlen: %d\n", max_headroom, TUNL_HLEN);
* and new_skb->ip_hdr is the IP header of the old packet. * and new_skb->ip_hdr is the IP header of the old packet.
*/ */
new_skb->ip_hdr = (struct iphdr *) skb_put(new_skb, skb->len); new_skb->ip_hdr = (struct iphdr *) skb_put(new_skb, skb->len);
new_skb->dev = skb->dev;
memcpy(new_skb->ip_hdr, skb->data, skb->len); memcpy(new_skb->ip_hdr, skb->data, skb->len);
memset(new_skb->proto_priv, 0, sizeof(skb->proto_priv)); memset(new_skb->proto_priv, 0, sizeof(skb->proto_priv));
......
...@@ -14,16 +14,21 @@ bool 'Verbose SCSI error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS ...@@ -14,16 +14,21 @@ bool 'Verbose SCSI error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS
mainmenu_option next_comment mainmenu_option next_comment
comment 'SCSI low-level drivers' comment 'SCSI low-level drivers'
dep_tristate 'AdvanSys SCSI support' CONFIG_SCSI_ADVANSYS $CONFIG_SCSI dep_tristate '7000FASST SCSI support' CONFIG_SCSI_7000FASST $CONFIG_SCSI
dep_tristate 'Adaptec AHA152X support' CONFIG_SCSI_AHA152X $CONFIG_SCSI dep_tristate 'Adaptec AHA152X support' CONFIG_SCSI_AHA152X $CONFIG_SCSI
dep_tristate 'Adaptec AHA1542 support' CONFIG_SCSI_AHA1542 $CONFIG_SCSI dep_tristate 'Adaptec AHA1542 support' CONFIG_SCSI_AHA1542 $CONFIG_SCSI
dep_tristate 'Adaptec AHA1740 support' CONFIG_SCSI_AHA1740 $CONFIG_SCSI dep_tristate 'Adaptec AHA1740 support' CONFIG_SCSI_AHA1740 $CONFIG_SCSI
dep_tristate 'Adaptec AHA274X/284X/294X support' CONFIG_SCSI_AIC7XXX $CONFIG_SCSI dep_tristate 'Adaptec AHA274X/284X/294X support' CONFIG_SCSI_AIC7XXX $CONFIG_SCSI
dep_tristate 'AdvanSys SCSI support' CONFIG_SCSI_ADVANSYS $CONFIG_SCSI
dep_tristate 'Always IN2000 SCSI support' CONFIG_SCSI_IN2000 $CONFIG_SCSI
if [ "$CONFIG_PCI" = "y" ]; then
bool 'AM53/79C974 PCI SCSI support' CONFIG_SCSI_AM53C974
fi
dep_tristate 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC $CONFIG_SCSI dep_tristate 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC $CONFIG_SCSI
dep_tristate 'DTC3180/3280 SCSI support' CONFIG_SCSI_DTC3280 $CONFIG_SCSI dep_tristate 'DTC3180/3280 SCSI support' CONFIG_SCSI_DTC3280 $CONFIG_SCSI
dep_tristate 'EATA ISA/EISA (DPT PM2011/021/012/022/122/322) support' CONFIG_SCSI_EATA $CONFIG_SCSI
dep_tristate 'EATA-DMA (DPT, NEC, AT&T, SNI, AST, Olivetti, Alphatronix) support' CONFIG_SCSI_EATA_DMA $CONFIG_SCSI dep_tristate 'EATA-DMA (DPT, NEC, AT&T, SNI, AST, Olivetti, Alphatronix) support' CONFIG_SCSI_EATA_DMA $CONFIG_SCSI
dep_tristate 'EATA-PIO (old DPT PM2001, PM2012A) support' CONFIG_SCSI_EATA_PIO $CONFIG_SCSI dep_tristate 'EATA-PIO (old DPT PM2001, PM2012A) support' CONFIG_SCSI_EATA_PIO $CONFIG_SCSI
dep_tristate 'UltraStor 14F/34F support' CONFIG_SCSI_U14_34F $CONFIG_SCSI
dep_tristate 'Future Domain 16xx SCSI support' CONFIG_SCSI_FUTURE_DOMAIN $CONFIG_SCSI dep_tristate 'Future Domain 16xx SCSI support' CONFIG_SCSI_FUTURE_DOMAIN $CONFIG_SCSI
dep_tristate 'Generic NCR5380/53c400 SCSI support' CONFIG_SCSI_GENERIC_NCR5380 $CONFIG_SCSI dep_tristate 'Generic NCR5380/53c400 SCSI support' CONFIG_SCSI_GENERIC_NCR5380 $CONFIG_SCSI
if [ "$CONFIG_SCSI_GENERIC_NCR5380" != "n" ]; then if [ "$CONFIG_SCSI_GENERIC_NCR5380" != "n" ]; then
...@@ -32,6 +37,7 @@ if [ "$CONFIG_SCSI_GENERIC_NCR5380" != "n" ]; then ...@@ -32,6 +37,7 @@ if [ "$CONFIG_SCSI_GENERIC_NCR5380" != "n" ]; then
"Port CONFIG_SCSI_G_NCR5380_PORT \ "Port CONFIG_SCSI_G_NCR5380_PORT \
Memory CONFIG_SCSI_G_NCR5380_MEM" Port Memory CONFIG_SCSI_G_NCR5380_MEM" Port
fi fi
dep_tristate 'NCR53c406a SCSI support' CONFIG_SCSI_NCR53C406A $CONFIG_SCSI
if [ "$CONFIG_PCI" = "y" ]; then if [ "$CONFIG_PCI" = "y" ]; then
dep_tristate 'NCR53c7,8xx SCSI support' CONFIG_SCSI_NCR53C7xx $CONFIG_SCSI dep_tristate 'NCR53c7,8xx SCSI support' CONFIG_SCSI_NCR53C7xx $CONFIG_SCSI
if [ "$CONFIG_SCSI_NCR53C7xx" != "n" ]; then if [ "$CONFIG_SCSI_NCR53C7xx" != "n" ]; then
...@@ -40,7 +46,7 @@ if [ "$CONFIG_PCI" = "y" ]; then ...@@ -40,7 +46,7 @@ if [ "$CONFIG_PCI" = "y" ]; then
bool ' allow DISCONNECT' CONFIG_SCSI_NCR53C7xx_DISCONNECT bool ' allow DISCONNECT' CONFIG_SCSI_NCR53C7xx_DISCONNECT
fi fi
fi fi
dep_tristate 'Always IN2000 SCSI support' CONFIG_SCSI_IN2000 $CONFIG_SCSI dep_tristate 'IOMEGA Parallel Port ZIP drive SCSI support' CONFIG_SCSI_PPA $CONFIG_SCSI
dep_tristate 'PAS16 SCSI support' CONFIG_SCSI_PAS16 $CONFIG_SCSI dep_tristate 'PAS16 SCSI support' CONFIG_SCSI_PAS16 $CONFIG_SCSI
dep_tristate 'Qlogic FAS SCSI support' CONFIG_SCSI_QLOGIC_FAS $CONFIG_SCSI dep_tristate 'Qlogic FAS SCSI support' CONFIG_SCSI_QLOGIC_FAS $CONFIG_SCSI
if [ "$CONFIG_PCI" = "y" ]; then if [ "$CONFIG_PCI" = "y" ]; then
...@@ -50,11 +56,7 @@ if [ "$CONFIG_PCI" = "y" ]; then ...@@ -50,11 +56,7 @@ if [ "$CONFIG_PCI" = "y" ]; then
fi fi
dep_tristate 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE $CONFIG_SCSI dep_tristate 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE $CONFIG_SCSI
dep_tristate 'Trantor T128/T128F/T228 SCSI support' CONFIG_SCSI_T128 $CONFIG_SCSI dep_tristate 'Trantor T128/T128F/T228 SCSI support' CONFIG_SCSI_T128 $CONFIG_SCSI
dep_tristate 'UltraStor 14F/34F support' CONFIG_SCSI_U14_34F $CONFIG_SCSI
dep_tristate 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR $CONFIG_SCSI dep_tristate 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR $CONFIG_SCSI
dep_tristate '7000FASST SCSI support' CONFIG_SCSI_7000FASST $CONFIG_SCSI
dep_tristate 'EATA ISA/EISA (DPT PM2011/021/012/022/122/322) support' CONFIG_SCSI_EATA $CONFIG_SCSI
dep_tristate 'NCR53c406a SCSI support' CONFIG_SCSI_NCR53C406A $CONFIG_SCSI
dep_tristate 'IOMEGA Parallel Port ZIP drive SCSI support' CONFIG_SCSI_PPA $CONFIG_SCSI
bool 'AM53/79C974 PCI SCSI support' CONFIG_SCSI_AM53C974
#dep_tristate 'SCSI debugging host adapter' CONFIG_SCSI_DEBUG $CONFIG_SCSI #dep_tristate 'SCSI debugging host adapter' CONFIG_SCSI_DEBUG $CONFIG_SCSI
endmenu endmenu
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/blk.h> #include <linux/blk.h>
#include <linux/interrupt.h>
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
#include <asm/atarihw.h> #include <asm/atarihw.h>
......
...@@ -38,18 +38,20 @@ ...@@ -38,18 +38,20 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <asm/system.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/malloc.h> #include <linux/malloc.h>
#include <asm/irq.h>
#include <asm/dma.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include<linux/stat.h> #include <linux/stat.h>
#include <linux/blk.h> #include <linux/blk.h>
#include <linux/interrupt.h>
#include <asm/system.h>
#include <asm/irq.h>
#include <asm/dma.h>
#include "scsi.h" #include "scsi.h"
#include "hosts.h" #include "hosts.h"
#include "constants.h" #include "constants.h"
......
...@@ -171,7 +171,7 @@ static int ioctl_command(Scsi_Device *dev, void *buffer) ...@@ -171,7 +171,7 @@ static int ioctl_command(Scsi_Device *dev, void *buffer)
unsigned char opcode; unsigned char opcode;
int inlen, outlen, cmdlen; int inlen, outlen, cmdlen;
int needed, buf_needed; int needed, buf_needed;
int result; int timeout, retries, result;
if (!buffer) if (!buffer)
return -EINVAL; return -EINVAL;
...@@ -239,6 +239,22 @@ static int ioctl_command(Scsi_Device *dev, void *buffer) ...@@ -239,6 +239,22 @@ static int ioctl_command(Scsi_Device *dev, void *buffer)
*/ */
cmd[1] = ( cmd[1] & 0x1f ) | (dev->lun << 5); cmd[1] = ( cmd[1] & 0x1f ) | (dev->lun << 5);
switch (opcode)
{
case FORMAT_UNIT:
timeout = 2 * 60 * 60 * HZ; /* 2 Hours */
retries = 1;
break;
case START_STOP:
timeout = 60 * HZ; /* 60 seconds */
retries = 1;
break;
default:
timeout = MAX_TIMEOUT;
retries = MAX_RETRIES;
break;
}
#ifndef DEBUG_NO_CMD #ifndef DEBUG_NO_CMD
SCpnt = allocate_device(NULL, dev, 1); SCpnt = allocate_device(NULL, dev, 1);
...@@ -246,8 +262,8 @@ static int ioctl_command(Scsi_Device *dev, void *buffer) ...@@ -246,8 +262,8 @@ static int ioctl_command(Scsi_Device *dev, void *buffer)
{ {
struct semaphore sem = MUTEX_LOCKED; struct semaphore sem = MUTEX_LOCKED;
SCpnt->request.sem = &sem; SCpnt->request.sem = &sem;
scsi_do_cmd(SCpnt, cmd, buf, needed, scsi_ioctl_done, MAX_TIMEOUT, scsi_do_cmd(SCpnt, cmd, buf, needed, scsi_ioctl_done,
MAX_RETRIES); timeout, retries);
down(&sem); down(&sem);
} }
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/interrupt.h>
#include <asm/system.h> #include <asm/system.h>
#define MAJOR_NR SCSI_DISK_MAJOR #define MAJOR_NR SCSI_DISK_MAJOR
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/cdrom.h> #include <linux/cdrom.h>
#include <linux/interrupt.h>
#include <asm/system.h> #include <asm/system.h>
#define MAJOR_NR SCSI_CDROM_MAJOR #define MAJOR_NR SCSI_CDROM_MAJOR
......
# bool 'ProAudioSpectrum 16 support' CONFIG_PAS
# Sound driver configuration bool 'SoundBlaster (SB, SBPro, SB16, clones) support' CONFIG_SB
# bool 'Generic OPL2/OPL3 FM synthesizer support' CONFIG_ADLIB
#-------- bool 'Gravis Ultrasound support' CONFIG_GUS
# There is another config script which is compatible with rest of bool 'MPU-401 support (NOT for SB16)' CONFIG_MPU401
# the kernel. It can be activated by running 'make mkscript' in this bool '6850 UART Midi support' CONFIG_UART6850
# directory. Please note that this is an _experimental_ feature which bool 'PSS (ECHO-ADI2111) support' CONFIG_PSS
# doesn't work with all cards (PSS, SM Wave, AudioTriX Pro). bool '16 bit sampling option of GUS (_NOT_ GUS MAX)' CONFIG_GUS16
#-------- bool 'GUS MAX support' CONFIG_GUSMAX
# bool 'Microsoft Sound System support' CONFIG_MSS
$MAKE -C drivers/sound config || exit 1 bool 'Ensoniq Soundscape support' CONFIG_SSCAPE
bool 'MediaTriX AudioTriX Pro support' CONFIG_TRIX
bool 'Support for MAD16 and/or Mozart based cards' CONFIG_MAD16
bool 'Support for Crystal CS4232 based (PnP) cards' CONFIG_CS4232
bool 'Support for Turtle Beach Wave Front (Maui, Tropez) synthesizers' CONFIG_MAUI
bool '/dev/dsp and /dev/audio support' CONFIG_AUDIO
bool 'MIDI interface support' CONFIG_MIDI
bool 'FM synthesizer (YM3812/OPL-3) support' CONFIG_YM3812
bool 'Support for SM Wave' CONFIG_SMWAVE
if [ "$CONFIG_AEDSP16" = "y" ]; then
hex 'I/O base for Audio Excel DSP 16 220 or 240' AEDSP16_BASE 220
fi
if [ "$CONFIG_SB" = "y" ]; then
hex 'I/O base for SB Check from manual of the card' SBC_BASE 220
fi
if [ "$CONFIG_SB" = "y" ]; then
int 'SoundBlaster IRQ Check from manual of the card' SBC_IRQ 7
fi
if [ "$CONFIG_SB" = "y" ]; then
int 'SoundBlaster DMA 0, 1 or 3' SBC_DMA 1
fi
if [ "$CONFIG_SB" = "y" ]; then
int 'SoundBlaster 16 bit DMA (_REQUIRED_for SB16, Jazz16, SMW) 5, 6 or 7' SB_DMA2 5
fi
if [ "$CONFIG_SB" = "y" ]; then
hex 'MPU401 I/O base of SB16, Jazz16 and ES1688 Check from manual of the card' SB_MPU_BASE 0
fi
if [ "$CONFIG_SB" = "y" ]; then
int 'SB MPU401 IRQ (Jazz16, SM Wave and ES1688) Check from manual of the card' SB_MPU_IRQ -1
fi
if [ "$CONFIG_PAS" = "y" ]; then
int 'PAS16 IRQ 3, 4, 5, 7, 9, 10, 11, 12, 14 or 15' PAS_IRQ 10
fi
if [ "$CONFIG_PAS" = "y" ]; then
int 'PAS16 DMA 0, 1, 3, 5, 6 or 7' PAS_DMA 3
fi
if [ "$CONFIG_GUS" = "y" ]; then
hex 'I/O base for GUS 210, 220, 230, 240, 250 or 260' GUS_BASE 220
fi
if [ "$CONFIG_GUS" = "y" ]; then
int 'GUS IRQ 3, 5, 7, 9, 11, 12 or 15' GUS_IRQ 15
fi
if [ "$CONFIG_GUS" = "y" ]; then
int 'GUS DMA 1, 3, 5, 6 or 7' GUS_DMA 6
fi
if [ "$CONFIG_GUS" = "y" ]; then
int 'Second DMA channel for GUS 1, 3, 5, 6 or 7' GUS_DMA2 -1
fi
if [ "$CONFIG_GUS16" = "y" ]; then
hex 'I/O base for the 16 bit daughtercard of GUS 530, 604, E80 or F40' GUS16_BASE 530
fi
if [ "$CONFIG_GUS16" = "y" ]; then
int 'GUS 16 bit daughtercard IRQ 3, 4, 5, 7, or 9' GUS16_IRQ 7
fi
if [ "$CONFIG_GUS16" = "y" ]; then
int 'GUS DMA 0, 1 or 3' GUS16_DMA 3
fi
if [ "$CONFIG_MPU401" = "y" ]; then
hex 'I/O base for MPU401 Check from manual of the card' MPU_BASE 330
fi
if [ "$CONFIG_MPU401" = "y" ]; then
int 'MPU401 IRQ Check from manual of the card' MPU_IRQ 9
fi
if [ "$CONFIG_MAUI" = "y" ]; then
hex 'I/O base for Maui 210, 230, 260, 290, 300, 320, 338 or 330' MAUI_BASE 330
fi
if [ "$CONFIG_MAUI" = "y" ]; then
int 'Maui IRQ 5, 9, 12 or 15' MAUI_IRQ 9
fi
if [ "$CONFIG_UART6850" = "y" ]; then
hex 'I/O base for UART 6850 MIDI port (Unknown)' U6850_BASE 0
fi
if [ "$CONFIG_UART6850" = "y" ]; then
int 'UART6850 IRQ (Unknown)' U6850_IRQ -1
fi
if [ "$CONFIG_PSS" = "y" ]; then
hex 'PSS I/O base 220 or 240' PSS_BASE 220
fi
if [ "$CONFIG_PSS" = "y" ]; then
hex 'PSS audio I/O base 530, 604, E80 or F40' PSS_MSS_BASE 530
fi
if [ "$CONFIG_PSS" = "y" ]; then
int 'PSS audio IRQ 7, 9, 10 or 11' PSS_MSS_IRQ 11
fi
if [ "$CONFIG_PSS" = "y" ]; then
int 'PSS audio DMA 0, 1 or 3' PSS_MSS_DMA 3
fi
if [ "$CONFIG_PSS" = "y" ]; then
hex 'PSS MIDI I/O base ' PSS_MPU_BASE 330
fi
if [ "$CONFIG_PSS" = "y" ]; then
int 'PSS MIDI IRQ 3, 4, 5, 7 or 9' PSS_MPU_IRQ 9
fi
if [ "$CONFIG_MSS" = "y" ]; then
hex 'MSS/WSS I/O base 530, 604, E80 or F40' MSS_BASE 530
fi
if [ "$CONFIG_MSS" = "y" ]; then
int 'MSS/WSS IRQ 7, 9, 10 or 11' MSS_IRQ 11
fi
if [ "$CONFIG_MSS" = "y" ]; then
int 'MSS/WSS DMA 0, 1 or 3' MSS_DMA 3
fi
if [ "$CONFIG_SSCAPE" = "y" ]; then
hex 'Soundscape MIDI I/O base ' SSCAPE_BASE 330
fi
if [ "$CONFIG_SSCAPE" = "y" ]; then
int 'Soundscape MIDI IRQ ' SSCAPE_IRQ 9
fi
if [ "$CONFIG_SSCAPE" = "y" ]; then
int 'Soundscape initialization DMA 0, 1 or 3' SSCAPE_DMA 3
fi
if [ "$CONFIG_SSCAPE" = "y" ]; then
hex 'Soundscape audio I/O base 534, 608, E84 or F44' SSCAPE_MSS_BASE 534
fi
if [ "$CONFIG_SSCAPE" = "y" ]; then
int 'Soundscape audio IRQ 7, 9, 10 or 11' SSCAPE_MSS_IRQ 11
fi
if [ "$CONFIG_SSCAPE" = "y" ]; then
int 'Soundscape audio DMA 0, 1 or 3' SSCAPE_MSS_DMA 0
fi
if [ "$CONFIG_TRIX" = "y" ]; then
hex 'AudioTriX audio I/O base 530, 604, E80 or F40' TRIX_BASE 530
fi
if [ "$CONFIG_TRIX" = "y" ]; then
int 'AudioTriX audio IRQ 7, 9, 10 or 11' TRIX_IRQ 11
fi
if [ "$CONFIG_TRIX" = "y" ]; then
int 'AudioTriX audio DMA 0, 1 or 3' TRIX_DMA 0
fi
if [ "$CONFIG_TRIX" = "y" ]; then
int 'AudioTriX second (duplex) DMA 0, 1 or 3' TRIX_DMA2 3
fi
if [ "$CONFIG_TRIX" = "y" ]; then
hex 'AudioTriX MIDI I/O base 330, 370, 3B0 or 3F0' TRIX_MPU_BASE 330
fi
if [ "$CONFIG_TRIX" = "y" ]; then
int 'AudioTriX MIDI IRQ 3, 4, 5, 7 or 9' TRIX_MPU_IRQ 9
fi
if [ "$CONFIG_TRIX" = "y" ]; then
hex 'AudioTriX SB I/O base 220, 210, 230, 240, 250, 260 or 270' TRIX_SB_BASE 220
fi
if [ "$CONFIG_TRIX" = "y" ]; then
int 'AudioTriX SB IRQ 3, 4, 5 or 7' TRIX_SB_IRQ 7
fi
if [ "$CONFIG_TRIX" = "y" ]; then
int 'AudioTriX SB DMA 1 or 3' TRIX_SB_DMA 1
fi
if [ "$CONFIG_CS4232" = "y" ]; then
hex 'CS4232 audio I/O base 530, 604, E80 or F40' CS4232_BASE 530
fi
if [ "$CONFIG_CS4232" = "y" ]; then
int 'CS4232 audio IRQ 5, 7, 9, 11, 12 or 15' CS4232_IRQ 11
fi
if [ "$CONFIG_CS4232" = "y" ]; then
int 'CS4232 audio DMA 0, 1 or 3' CS4232_DMA 0
fi
if [ "$CONFIG_CS4232" = "y" ]; then
int 'CS4232 second (duplex) DMA 0, 1 or 3' CS4232_DMA2 3
fi
if [ "$CONFIG_CS4232" = "y" ]; then
hex 'CS4232 MIDI I/O base 330, 370, 3B0 or 3F0' CS4232_MPU_BASE 330
fi
if [ "$CONFIG_CS4232" = "y" ]; then
int 'CS4232 MIDI IRQ 5, 7, 9, 11, 12 or 15' CS4232_MPU_IRQ 9
fi
if [ "$CONFIG_MAD16" = "y" ]; then
hex 'MAD16 audio I/O base 530, 604, E80 or F40' MAD16_BASE 530
fi
if [ "$CONFIG_MAD16" = "y" ]; then
int 'MAD16 audio IRQ 7, 9, 10 or 11' MAD16_IRQ 11
fi
if [ "$CONFIG_MAD16" = "y" ]; then
int 'MAD16 audio DMA 0, 1 or 3' MAD16_DMA 3
fi
if [ "$CONFIG_MAD16" = "y" ]; then
int 'MAD16 second (duplex) DMA 0, 1 or 3' MAD16_DMA2 0
fi
if [ "$CONFIG_MAD16" = "y" ]; then
hex 'MAD16 MIDI I/O base 300, 310, 320 or 330 (0 disables)' MAD16_MPU_BASE 330
fi
if [ "$CONFIG_MAD16" = "y" ]; then
int 'MAD16 MIDI IRQ 5, 7, 9 or 10' MAD16_MPU_IRQ 9
fi
if [ "$CONFIG_AUDIO" = "y" ]; then
int 'Audio DMA buffer size 4096, 16384, 32768 or 65536' DSP_BUFFSIZE 65536
fi
#
$MAKE -C drivers/sound kernelconfig || exit 1
...@@ -926,6 +926,9 @@ play_event (unsigned char *q) ...@@ -926,6 +926,9 @@ play_event (unsigned char *q)
dev = q[2]; dev = q[2];
if (dev < 0 || dev >= num_midis)
break;
if (!midi_devs[dev]->putc (dev, q[1])) if (!midi_devs[dev]->putc (dev, q[1]))
{ {
/* /*
......
...@@ -35,7 +35,7 @@ fi ...@@ -35,7 +35,7 @@ fi
tristate 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS tristate 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS
tristate 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS tristate 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS
tristate 'System V and Coherent filesystem support' CONFIG_SYSV_FS tristate 'System V and Coherent filesystem support' CONFIG_SYSV_FS
if [ "$CONFIG_EXPERIMENTAL = "y" ]; then if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
tristate 'Amiga FFS filesystem support (EXPERIMENTAL)' CONFIG_AFFS_FS tristate 'Amiga FFS filesystem support (EXPERIMENTAL)' CONFIG_AFFS_FS
if [ "$CONFIG_AFFS_FS" != "n" ]; then if [ "$CONFIG_AFFS_FS" != "n" ]; then
define_bool CONFIG_AMIGA_PARTITION y define_bool CONFIG_AMIGA_PARTITION y
...@@ -43,7 +43,7 @@ if [ "$CONFIG_EXPERIMENTAL = "y" ]; then ...@@ -43,7 +43,7 @@ if [ "$CONFIG_EXPERIMENTAL = "y" ]; then
fi fi
tristate 'UFS filesystem support (read only)' CONFIG_UFS_FS tristate 'UFS filesystem support (read only)' CONFIG_UFS_FS
if [ "$CONFIG_UFS_FS" != "n" ]; then if [ "$CONFIG_UFS_FS" != "n" ]; then
bool "BSD disklabel (FreeBSD partition tables) support" CONFIG_BSD_DISKLABEL bool 'BSD disklabel (FreeBSD partition tables) support' CONFIG_BSD_DISKLABEL
bool "SMD disklabel (Sun partition tables) support" CONFIG_SMD_DISKLABEL bool 'SMD disklabel (Sun partition tables) support' CONFIG_SMD_DISKLABEL
fi fi
endmenu endmenu
...@@ -1099,7 +1099,7 @@ static struct buffer_head * create_buffers(unsigned long page, unsigned long siz ...@@ -1099,7 +1099,7 @@ static struct buffer_head * create_buffers(unsigned long page, unsigned long siz
static inline void after_unlock_page (struct page * page) static inline void after_unlock_page (struct page * page)
{ {
if (clear_bit(PG_decr_after, &page->flags)) if (clear_bit(PG_decr_after, &page->flags))
nr_async_pages--; atomic_dec(&nr_async_pages);
if (clear_bit(PG_free_after, &page->flags)) if (clear_bit(PG_free_after, &page->flags))
free_page(page_address(page)); free_page(page_address(page));
if (clear_bit(PG_swap_unlock_after, &page->flags)) if (clear_bit(PG_swap_unlock_after, &page->flags))
...@@ -1250,11 +1250,12 @@ void unlock_buffer(struct buffer_head * bh) ...@@ -1250,11 +1250,12 @@ void unlock_buffer(struct buffer_head * bh)
struct buffer_head *tmp; struct buffer_head *tmp;
struct page *page; struct page *page;
clear_bit(BH_Lock, &bh->b_state); if (!test_bit(BH_FreeOnIO, &bh->b_state)) {
wake_up(&bh->b_wait); /* This is a normal buffer. */
clear_bit(BH_Lock, &bh->b_state);
if (!test_bit(BH_FreeOnIO, &bh->b_state)) wake_up(&bh->b_wait);
return; return;
}
/* This is a temporary buffer used for page I/O. */ /* This is a temporary buffer used for page I/O. */
page = mem_map + MAP_NR(bh->b_data); page = mem_map + MAP_NR(bh->b_data);
if (!PageLocked(page)) { if (!PageLocked(page)) {
...@@ -1268,17 +1269,18 @@ void unlock_buffer(struct buffer_head * bh) ...@@ -1268,17 +1269,18 @@ void unlock_buffer(struct buffer_head * bh)
} }
/* Async buffer_heads are here only as labels for IO, and get /* Async buffer_heads are here only as labels for IO, and get
thrown away once the IO for this page is complete. IO is thrown away once the IO for this page is complete. IO is
deemed complete once all buffers have been visited deemed complete once all buffers have been unlocked. */
(b_count==0) and are now unlocked. */
bh->b_count--;
if (!test_bit(BH_Uptodate, &bh->b_state)) if (!test_bit(BH_Uptodate, &bh->b_state))
set_bit(PG_error, &page->flags); set_bit(PG_error, &page->flags);
clear_bit(BH_Lock, &bh->b_state);
wake_up(&bh->b_wait);
for (tmp = bh; tmp=tmp->b_this_page, tmp!=bh; ) { for (tmp = bh; tmp=tmp->b_this_page, tmp!=bh; ) {
if (test_bit(BH_Lock, &tmp->b_state) || tmp->b_count) if (test_bit(BH_Lock, &tmp->b_state))
return; return;
} }
/* OK, the async IO on this page is complete. */ /* OK, the async IO on this page is complete. */
clear_bit(PG_locked, &page->flags); if (!clear_bit(PG_locked, &page->flags))
return;
wake_up(&page->wait); wake_up(&page->wait);
free_async_buffers(bh); free_async_buffers(bh);
after_unlock_page(page); after_unlock_page(page);
......
...@@ -37,11 +37,12 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, ...@@ -37,11 +37,12 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
return err; return err;
flags = get_user((int *) arg); flags = get_user((int *) arg);
/* /*
* The IMMUTABLE flag can only be changed by the super user * The IMMUTABLE and APPEND_ONLY flags can only be changed by
* when the security level is zero. * the super user when the security level is zero.
*/ */
if ((flags & EXT2_IMMUTABLE_FL) ^ if ((flags & (EXT2_APPEND_FL | EXT2_IMMUTABLE_FL)) ^
(inode->u.ext2_i.i_flags & EXT2_IMMUTABLE_FL)) { (inode->u.ext2_i.i_flags &
(EXT2_APPEND_FL | EXT2_IMMUTABLE_FL))) {
/* This test looks nicer. Thanks to Pauline Middelink */ /* This test looks nicer. Thanks to Pauline Middelink */
if (!fsuser() || securelevel > 0) if (!fsuser() || securelevel > 0)
return -EPERM; return -EPERM;
......
...@@ -82,6 +82,9 @@ ...@@ -82,6 +82,9 @@
* be compiled with different options than the kernel itself. * be compiled with different options than the kernel itself.
* Andy Walker (andy@lysaker.kvaerner.no), May 15, 1996. * Andy Walker (andy@lysaker.kvaerner.no), May 15, 1996.
* *
* Added a couple of missing wake_up() calls.
* Andy Walker (andy@lysaker.kvaerner.no), May 15, 1996.
*
* TODO: Do not honour mandatory locks on remote file systems. This matches * TODO: Do not honour mandatory locks on remote file systems. This matches
* the SVR4 semantics and neatly sidesteps a pile of awkward issues that * the SVR4 semantics and neatly sidesteps a pile of awkward issues that
* would otherwise have to be addressed. * would otherwise have to be addressed.
...@@ -882,9 +885,12 @@ static int posix_lock_file(struct file *filp, struct file_lock *caller, ...@@ -882,9 +885,12 @@ static int posix_lock_file(struct file *filp, struct file_lock *caller,
locks_insert_lock(before, left); locks_insert_lock(before, left);
} }
right->fl_start = caller->fl_end + 1; right->fl_start = caller->fl_end + 1;
wake_up(&right->fl_wait);
} }
if (left) if (left) {
left->fl_end = caller->fl_start - 1; left->fl_end = caller->fl_start - 1;
wake_up(&left->fl_wait);
}
return (0); return (0);
} }
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/ncp_fs.h> #include <linux/ncp_fs.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/locks.h>
#include "ncplib_kernel.h" #include "ncplib_kernel.h"
struct ncp_dirent { struct ncp_dirent {
...@@ -807,6 +808,7 @@ ncp_lookup(struct inode *dir, const char *__name, int len, ...@@ -807,6 +808,7 @@ ncp_lookup(struct inode *dir, const char *__name, int len,
memcpy(name, __name, len); memcpy(name, __name, len);
name[len] = 0; name[len] = 0;
lock_super(dir->i_sb);
result_info = ncp_find_dir_inode(dir, name); result_info = ncp_find_dir_inode(dir, name);
if (result_info != 0) if (result_info != 0)
...@@ -820,6 +822,7 @@ ncp_lookup(struct inode *dir, const char *__name, int len, ...@@ -820,6 +822,7 @@ ncp_lookup(struct inode *dir, const char *__name, int len,
inode number */ inode number */
*result = iget(dir->i_sb, ncp_info_ino(server, result_info)); *result = iget(dir->i_sb, ncp_info_ino(server, result_info));
unlock_super(dir->i_sb);
iput(dir); iput(dir);
if (*result == NULL) if (*result == NULL)
...@@ -881,6 +884,7 @@ ncp_lookup(struct inode *dir, const char *__name, int len, ...@@ -881,6 +884,7 @@ ncp_lookup(struct inode *dir, const char *__name, int len,
} }
if (res != 0) if (res != 0)
{ {
unlock_super(dir->i_sb);
iput(dir); iput(dir);
return -ENOENT; return -ENOENT;
} }
...@@ -891,10 +895,12 @@ ncp_lookup(struct inode *dir, const char *__name, int len, ...@@ -891,10 +895,12 @@ ncp_lookup(struct inode *dir, const char *__name, int len,
if (!(*result = ncp_iget(dir, &finfo))) if (!(*result = ncp_iget(dir, &finfo)))
{ {
unlock_super(dir->i_sb);
iput(dir); iput(dir);
return -EACCES; return -EACCES;
} }
unlock_super(dir->i_sb);
iput(dir); iput(dir);
return 0; return 0;
} }
...@@ -924,6 +930,7 @@ ncp_create(struct inode *dir, const char *name, int len, int mode, ...@@ -924,6 +930,7 @@ ncp_create(struct inode *dir, const char *name, int len, int mode,
_name[len] = '\0'; _name[len] = '\0';
str_upper(_name); str_upper(_name);
lock_super(dir->i_sb);
if (ncp_open_create_file_or_subdir(NCP_SERVER(dir), if (ncp_open_create_file_or_subdir(NCP_SERVER(dir),
NCP_ISTRUCT(dir), _name, NCP_ISTRUCT(dir), _name,
OC_MODE_CREATE|OC_MODE_OPEN| OC_MODE_CREATE|OC_MODE_OPEN|
...@@ -931,6 +938,7 @@ ncp_create(struct inode *dir, const char *name, int len, int mode, ...@@ -931,6 +938,7 @@ ncp_create(struct inode *dir, const char *name, int len, int mode,
0, AR_READ|AR_WRITE, 0, AR_READ|AR_WRITE,
&finfo) != 0) &finfo) != 0)
{ {
unlock_super(dir->i_sb);
iput(dir); iput(dir);
return -EACCES; return -EACCES;
} }
...@@ -943,10 +951,12 @@ ncp_create(struct inode *dir, const char *name, int len, int mode, ...@@ -943,10 +951,12 @@ ncp_create(struct inode *dir, const char *name, int len, int mode,
if (!(*result = ncp_iget(dir, &finfo)) < 0) if (!(*result = ncp_iget(dir, &finfo)) < 0)
{ {
ncp_close_file(NCP_SERVER(dir), finfo.file_handle); ncp_close_file(NCP_SERVER(dir), finfo.file_handle);
unlock_super(dir->i_sb);
iput(dir); iput(dir);
return -EINVAL; return -EINVAL;
} }
unlock_super(dir->i_sb);
iput(dir); iput(dir);
return 0; return 0;
} }
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/stat.h> #include <linux/stat.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/ncp_fs.h> #include <linux/ncp_fs.h>
#include <linux/locks.h>
#include "ncplib_kernel.h" #include "ncplib_kernel.h"
#include <linux/malloc.h> #include <linux/malloc.h>
...@@ -44,8 +45,10 @@ ncp_make_open(struct inode *i, int right) ...@@ -44,8 +45,10 @@ ncp_make_open(struct inode *i, int right)
DPRINTK("ncp_make_open: dirent->opened = %d\n", finfo->opened); DPRINTK("ncp_make_open: dirent->opened = %d\n", finfo->opened);
lock_super(i->i_sb);
if (finfo->opened == 0) if (finfo->opened == 0)
{ {
finfo->access = -1;
/* tries max. rights */ /* tries max. rights */
if (ncp_open_create_file_or_subdir(NCP_SERVER(i), if (ncp_open_create_file_or_subdir(NCP_SERVER(i),
NULL, NULL, NULL, NULL,
...@@ -63,12 +66,10 @@ ncp_make_open(struct inode *i, int right) ...@@ -63,12 +66,10 @@ ncp_make_open(struct inode *i, int right)
{ {
finfo->access = O_RDONLY; finfo->access = O_RDONLY;
} }
else
{
return -EACCES;
}
} }
unlock_super(i->i_sb);
if ( ((right == O_RDONLY) && ( (finfo->access == O_RDONLY) if ( ((right == O_RDONLY) && ( (finfo->access == O_RDONLY)
|| (finfo->access == O_RDWR))) || (finfo->access == O_RDWR)))
|| ((right == O_WRONLY) && ( (finfo->access == O_WRONLY) || ((right == O_WRONLY) && ( (finfo->access == O_WRONLY)
......
...@@ -129,7 +129,9 @@ static void ...@@ -129,7 +129,9 @@ static void
ncp_put_inode(struct inode *inode) ncp_put_inode(struct inode *inode)
{ {
struct nw_file_info *finfo = NCP_FINFO(inode); struct nw_file_info *finfo = NCP_FINFO(inode);
struct super_block *sb = inode->i_sb;
lock_super(sb);
if (finfo->opened != 0) if (finfo->opened != 0)
{ {
if (ncp_close_file(NCP_SERVER(inode), finfo->file_handle)!=0) if (ncp_close_file(NCP_SERVER(inode), finfo->file_handle)!=0)
...@@ -152,6 +154,7 @@ ncp_put_inode(struct inode *inode) ...@@ -152,6 +154,7 @@ ncp_put_inode(struct inode *inode)
} }
clear_inode(inode); clear_inode(inode);
unlock_super(sb);
} }
struct super_block * struct super_block *
......
...@@ -27,6 +27,10 @@ typedef char * __kernel_caddr_t; ...@@ -27,6 +27,10 @@ typedef char * __kernel_caddr_t;
typedef long long __kernel_loff_t; typedef long long __kernel_loff_t;
#endif #endif
typedef struct {
int val[2];
} __kernel_fsid_t;
#undef __FD_SET #undef __FD_SET
#define __FD_SET(fd,fdsetp) \ #define __FD_SET(fd,fdsetp) \
__asm__ __volatile__("btsl %1,%0": \ __asm__ __volatile__("btsl %1,%0": \
......
#ifndef _I386_STATFS_H #ifndef _I386_STATFS_H
#define _I386_STATFS_H #define _I386_STATFS_H
typedef struct { #ifndef __KERNEL_STRICT_NAMES
long val[2];
} fsid_t; #include <linux/types.h>
typedef __kernel_fsid_t fsid_t;
#endif
struct statfs { struct statfs {
long f_type; long f_type;
...@@ -13,7 +17,7 @@ struct statfs { ...@@ -13,7 +17,7 @@ struct statfs {
long f_bavail; long f_bavail;
long f_files; long f_files;
long f_ffree; long f_ffree;
fsid_t f_fsid; __kernel_fsid_t f_fsid;
long f_namelen; long f_namelen;
long f_spare[6]; long f_spare[6];
}; };
......
...@@ -27,6 +27,10 @@ typedef char * __kernel_caddr_t; ...@@ -27,6 +27,10 @@ typedef char * __kernel_caddr_t;
typedef long long __kernel_loff_t; typedef long long __kernel_loff_t;
#endif #endif
typedef struct {
int val[2];
} __kernel_fsid_t;
#undef __FD_SET #undef __FD_SET
#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
......
#ifndef _M68K_STATFS_H #ifndef _M68K_STATFS_H
#define _M68K_STATFS_H #define _M68K_STATFS_H
typedef struct { #ifndef __KERNEL_STRICT_NAMES
long val[2];
} fsid_t; #include <linux/types.h>
typedef __kernel_fsid_t fsid_t;
#endif
struct statfs { struct statfs {
long f_type; long f_type;
...@@ -13,7 +17,7 @@ struct statfs { ...@@ -13,7 +17,7 @@ struct statfs {
long f_bavail; long f_bavail;
long f_files; long f_files;
long f_ffree; long f_ffree;
fsid_t f_fsid; __kernel_fsid_t f_fsid;
long f_namelen; long f_namelen;
long f_spare[6]; long f_spare[6];
}; };
......
#ifndef _PPC_STATFS_H #ifndef _PPC_STATFS_H
#define _PPC_STATFS_H #define _PPC_STATFS_H
typedef struct { #ifndef __KERNEL_STRICT_NAMES
long val[2];
} fsid_t; #include <linux/types.h>
typedef __kernel_fsid_t fsid_t;
#endif
struct statfs { struct statfs {
long f_type; long f_type;
...@@ -13,7 +17,7 @@ struct statfs { ...@@ -13,7 +17,7 @@ struct statfs {
long f_bavail; long f_bavail;
long f_files; long f_files;
long f_ffree; long f_ffree;
fsid_t f_fsid; __kernel_fsid_t f_fsid;
long f_namelen; long f_namelen;
long f_spare[6]; long f_spare[6];
}; };
......
...@@ -34,6 +34,10 @@ typedef char * __kernel_caddr_t; ...@@ -34,6 +34,10 @@ typedef char * __kernel_caddr_t;
typedef long long __kernel_loff_t; typedef long long __kernel_loff_t;
#endif #endif
typedef struct {
int val[2];
} __kernel_fsid_t;
#undef __FD_SET #undef __FD_SET
static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
{ {
......
...@@ -2,9 +2,13 @@ ...@@ -2,9 +2,13 @@
#ifndef _SPARC_STATFS_H #ifndef _SPARC_STATFS_H
#define _SPARC_STATFS_H #define _SPARC_STATFS_H
typedef struct { #ifndef __KERNEL_STRICT_NAMES
long val[2];
} fsid_t; #include <linux/types.h>
typedef __kernel_fsid_t fsid_t;
#endif
struct statfs { struct statfs {
long f_type; long f_type;
...@@ -14,7 +18,7 @@ struct statfs { ...@@ -14,7 +18,7 @@ struct statfs {
long f_bavail; long f_bavail;
long f_files; long f_files;
long f_ffree; long f_ffree;
fsid_t f_fsid; __kernel_fsid_t f_fsid;
long f_namelen; /* SunOS ignores this field. */ long f_namelen; /* SunOS ignores this field. */
long f_spare[6]; long f_spare[6];
}; };
......
...@@ -14,6 +14,7 @@ struct irqaction { ...@@ -14,6 +14,7 @@ struct irqaction {
struct irqaction *next; struct irqaction *next;
}; };
extern unsigned long intr_count;
extern int bh_mask_count[32]; extern int bh_mask_count[32];
extern unsigned long bh_active; extern unsigned long bh_active;
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include <asm/param.h> /* for HZ */ #include <asm/param.h> /* for HZ */
extern unsigned long intr_count;
extern unsigned long event; extern unsigned long event;
#include <linux/binfmts.h> #include <linux/binfmts.h>
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <asm/atomic.h>
#define SWP_USED 1 #define SWP_USED 1
#define SWP_WRITEOK 3 #define SWP_WRITEOK 3
...@@ -32,7 +34,7 @@ struct swap_info_struct { ...@@ -32,7 +34,7 @@ struct swap_info_struct {
extern int nr_swap_pages; extern int nr_swap_pages;
extern int nr_free_pages; extern int nr_free_pages;
extern int nr_async_pages; extern atomic_t nr_async_pages;
extern int min_free_pages; extern int min_free_pages;
extern int free_pages_low; extern int free_pages_low;
extern int free_pages_high; extern int free_pages_high;
......
...@@ -70,33 +70,41 @@ struct __sysctl_args { ...@@ -70,33 +70,41 @@ struct __sysctl_args {
#define VM_MAXID 5 #define VM_MAXID 5
/* CTL_NET names: */ /* CTL_NET names: */
#define NET_CORE 1
#define NET_ETHER 2
#define NET_802 3
#define NET_UNIX 4
#define NET_IPV4 5
#define NET_IPX 6
#define NET_ATALK 7
#define NET_NETROM 8
#define NET_AX25 9
#define NET_BRIDGE 10
/* /proc/sys/net/core */ /* /proc/sys/net/core */
#define NET_CORE 0x01000000
/* /proc/sys/net/ethernet */ /* /proc/sys/net/ethernet */
#define NET_ETHER 0x02000000
/* /proc/sys/net/802 */ /* /proc/sys/net/802 */
#define NET_802 0x03000000
/* /proc/sys/net/unix */ /* /proc/sys/net/unix */
#define NET_UNIX 0x04000000
/* /proc/sys/net/ipv4 */ /* /proc/sys/net/ipv4 */
#define NET_IPV4 0x05000000 #define NET_IPV4_ARP_RES_TIME 1
#define NET_IPV4_ARP_DEAD_RES_TIME 2
#define NET_IPV4_ARP_MAX_TRIES 3
#define NET_IPV4_ARP_TIMEOUT 4
#define NET_IPV4_ARP_CHECK_INTERVAL 5
#define NET_IPV4_ARP_CONFIRM_INTERVAL 6
#define NET_IPV4_ARP_CONFIRM_TIMEOUT 7
/* /proc/sys/net/ipx */ /* /proc/sys/net/ipx */
#define NET_IPX 0x06000000
/* /proc/sys/net/appletalk */ /* /proc/sys/net/appletalk */
#define NET_ATALK 0x07000000
/* /proc/sys/net/netrom */ /* /proc/sys/net/netrom */
#define NET_NETROM 0x08000000
/* /proc/sys/net/ax25 */ /* /proc/sys/net/ax25 */
#define NET_AX25 0x09000000
/* CTL_PROC names: */ /* CTL_PROC names: */
......
...@@ -85,6 +85,7 @@ extern int ip_masq_init(void); ...@@ -85,6 +85,7 @@ extern int ip_masq_init(void);
* functions called from ip layer * functions called from ip layer
*/ */
extern int ip_fw_masquerade(struct sk_buff **, struct device *); extern int ip_fw_masquerade(struct sk_buff **, struct device *);
extern int ip_fw_masq_icmp(struct sk_buff **, struct device *);
extern int ip_fw_demasquerade(struct sk_buff **, struct device *); extern int ip_fw_demasquerade(struct sk_buff **, struct device *);
/* /*
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/stat.h> #include <linux/stat.h>
#include <linux/malloc.h> #include <linux/malloc.h>
#include <linux/kerneld.h> #include <linux/kerneld.h>
#include <linux/interrupt.h>
#include <asm/segment.h> #include <asm/segment.h>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/malloc.h> #include <linux/malloc.h>
#include <linux/interrupt.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/dma.h> #include <asm/dma.h>
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/swap.h> #include <linux/swap.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/swapctl.h> #include <linux/swapctl.h>
#include <linux/interrupt.h>
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/system.h> /* for cli()/sti() */ #include <asm/system.h> /* for cli()/sti() */
......
...@@ -84,7 +84,7 @@ void rw_swap_page(int rw, unsigned long entry, char * buf, int wait) ...@@ -84,7 +84,7 @@ void rw_swap_page(int rw, unsigned long entry, char * buf, int wait)
set_bit(PG_decr_after, &page->flags); set_bit(PG_decr_after, &page->flags);
set_bit(PG_swap_unlock_after, &page->flags); set_bit(PG_swap_unlock_after, &page->flags);
page->swap_unlock_entry = entry; page->swap_unlock_entry = entry;
nr_async_pages++; atomic_inc(&nr_async_pages);
} }
ll_rw_page(rw,p->swap_device,offset,buf); ll_rw_page(rw,p->swap_device,offset,buf);
/* /*
......
...@@ -44,7 +44,7 @@ int free_pages_high = 40; ...@@ -44,7 +44,7 @@ int free_pages_high = 40;
/* We track the number of pages currently being asynchronously swapped /* We track the number of pages currently being asynchronously swapped
out, so that we don't try to swap TOO many pages out at once */ out, so that we don't try to swap TOO many pages out at once */
int nr_async_pages = 0; atomic_t nr_async_pages = 0;
/* /*
* Constants for the page aging mechanism: the maximum age (actually, * Constants for the page aging mechanism: the maximum age (actually,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# Note 2! The CFLAGS definition is now in the main makefile... # Note 2! The CFLAGS definition is now in the main makefile...
O_TARGET := bridge.o O_TARGET := bridge.o
O_OBJS := br.o br_tree.o O_OBJS := br.o br_tree.o sysctl_net_bridge.o
M_OBJS := $(O_TARGET) M_OBJS := $(O_TARGET)
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
......
/* -*- linux-c -*-
* sysctl_net_bridge.c: sysctl interface to net bridge subsystem.
*
* Begun June 1, 1996, Mike Shaver.
* Added /proc/sys/net/bridge directory entry (empty =) ). [MS]
*/
#include <linux/mm.h>
#include <linux/sysctl.h>
ctl_table bridge_table[] = {
{0}
};
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
* Darryl Miles : Fixed non-blocking SOCK_SEQPACKET. * Darryl Miles : Fixed non-blocking SOCK_SEQPACKET.
* Linus Torvalds : BSD semantic fixes. * Linus Torvalds : BSD semantic fixes.
* Alan Cox : Datagram iovec handling * Alan Cox : Datagram iovec handling
* Darryl Miles : Fixed non-blocking SOCK_STREAM.
* *
*/ */
...@@ -47,6 +48,7 @@ ...@@ -47,6 +48,7 @@
* Interrupts off so that no packet arrives before we begin sleeping. * Interrupts off so that no packet arrives before we begin sleeping.
* Otherwise we might miss our wake up * Otherwise we might miss our wake up
*/ */
static inline void wait_for_packet(struct sock * sk) static inline void wait_for_packet(struct sock * sk)
{ {
unsigned long flags; unsigned long flags;
...@@ -60,6 +62,16 @@ static inline void wait_for_packet(struct sock * sk) ...@@ -60,6 +62,16 @@ static inline void wait_for_packet(struct sock * sk)
lock_sock(sk); lock_sock(sk);
} }
/*
* Is a socket 'connection oriented' ?
*/
static inline int connection_based(struct sock *sk)
{
if(sk->type==SOCK_SEQPACKET || sk->type==SOCK_STREAM)
return 1;
return 0;
}
/* /*
* Get a datagram skbuff, understands the peeking, nonblocking wakeups and possible * Get a datagram skbuff, understands the peeking, nonblocking wakeups and possible
...@@ -92,7 +104,7 @@ struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock, ...@@ -92,7 +104,7 @@ struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock,
/* Sequenced packets can come disconnected. If so we report the problem */ /* Sequenced packets can come disconnected. If so we report the problem */
error = -ENOTCONN; error = -ENOTCONN;
if(sk->type==SOCK_SEQPACKET && sk->state!=TCP_ESTABLISHED) if(connection_based(sk) && sk->state!=TCP_ESTABLISHED)
goto no_packet; goto no_packet;
/* User doesn't want to wait */ /* User doesn't want to wait */
...@@ -186,7 +198,7 @@ int datagram_select(struct sock *sk, int sel_type, select_table *wait) ...@@ -186,7 +198,7 @@ int datagram_select(struct sock *sk, int sel_type, select_table *wait)
return 1; return 1;
if (sk->shutdown & RCV_SHUTDOWN) if (sk->shutdown & RCV_SHUTDOWN)
return 1; return 1;
if (sk->type==SOCK_SEQPACKET && sk->state==TCP_CLOSE) if (connection_based(sk) && sk->state==TCP_CLOSE)
{ {
/* Connection closed: Wake up */ /* Connection closed: Wake up */
return(1); return(1);
...@@ -203,7 +215,7 @@ int datagram_select(struct sock *sk, int sel_type, select_table *wait) ...@@ -203,7 +215,7 @@ int datagram_select(struct sock *sk, int sel_type, select_table *wait)
return 1; return 1;
if (sk->shutdown & SEND_SHUTDOWN) if (sk->shutdown & SEND_SHUTDOWN)
return 1; return 1;
if (sk->type==SOCK_SEQPACKET && sk->state==TCP_SYN_SENT) if (connection_based(sk) && sk->state==TCP_SYN_SENT)
{ {
/* Connection still in progress */ /* Connection still in progress */
break; break;
......
...@@ -4,14 +4,15 @@ ...@@ -4,14 +4,15 @@
* *
* This module implements the Address Resolution Protocol ARP (RFC 826), * This module implements the Address Resolution Protocol ARP (RFC 826),
* which is used to convert IP addresses (or in the future maybe other * which is used to convert IP addresses (or in the future maybe other
* high-level addresses into a low-level hardware address (like an Ethernet * high-level addresses) into a low-level hardware address (like an Ethernet
* address). * address).
* *
* FIXME: * FIXME:
* Experiment with better retransmit timers * Experiment with better retransmit timers
* Clean up the timer deletions * Clean up the timer deletions
* If you create a proxy entry set your interface address to the address * If you create a proxy entry, set your interface address to the address
* and then delete it, proxies may get out of sync with reality - check this * and then delete it, proxies may get out of sync with reality -
* check this.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -19,11 +20,12 @@ ...@@ -19,11 +20,12 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
* *
* Fixes: * Fixes:
* Alan Cox : Removed the ethernet assumptions in Florian's code * Alan Cox : Removed the ethernet assumptions in
* Alan Cox : Fixed some small errors in the ARP logic * Florian's code
* Alan Cox : Fixed some small errors in the ARP
* logic
* Alan Cox : Allow >4K in /proc * Alan Cox : Allow >4K in /proc
* Alan Cox : Make ARP add its own protocol entry * Alan Cox : Make ARP add its own protocol entry
*
* Ross Martin : Rewrote arp_rcv() and arp_get_info() * Ross Martin : Rewrote arp_rcv() and arp_get_info()
* Stephen Henson : Add AX25 support to arp_get_info() * Stephen Henson : Add AX25 support to arp_get_info()
* Alan Cox : Drop data when a device is downed. * Alan Cox : Drop data when a device is downed.
...@@ -46,7 +48,8 @@ ...@@ -46,7 +48,8 @@
* during arp_rcv. * during arp_rcv.
* Russ Nelson : Tidied up a few bits. * Russ Nelson : Tidied up a few bits.
* Alexey Kuznetsov: Major changes to caching and behaviour, * Alexey Kuznetsov: Major changes to caching and behaviour,
* eg intelligent arp probing and generation * eg intelligent arp probing and
* generation
* of host down events. * of host down events.
* Alan Cox : Missing unlock in device events. * Alan Cox : Missing unlock in device events.
* Eckes : ARP ioctl control errors. * Eckes : ARP ioctl control errors.
...@@ -54,12 +57,13 @@ ...@@ -54,12 +57,13 @@
* Manuel Rodriguez: Gratuitous ARP. * Manuel Rodriguez: Gratuitous ARP.
* Jonathan Layes : Added arpd support through kerneld * Jonathan Layes : Added arpd support through kerneld
* message queue (960314) * message queue (960314)
* Mike Shaver : /proc/sys/net/ipv4/arp_* support
*/ */
/* RFC1122 Status: /* RFC1122 Status:
2.3.2.1 (ARP Cache Validation): 2.3.2.1 (ARP Cache Validation):
MUST provide mechanism to flush stale cache entries (OK) MUST provide mechanism to flush stale cache entries (OK)
SHOULD be able to configure cache timeout (NOT YET) SHOULD be able to configure cache timeout (OK)
MUST throttle ARP retransmits (OK) MUST throttle ARP retransmits (OK)
2.3.2.2 (ARP Packet Queue): 2.3.2.2 (ARP Packet Queue):
SHOULD save at least one packet from each "conversation" with an SHOULD save at least one packet from each "conversation" with an
...@@ -121,12 +125,9 @@ ...@@ -121,12 +125,9 @@
* and dynamic routing. * and dynamic routing.
*/ */
#ifndef CONFIG_ARPD
#define ARP_TIMEOUT (600*HZ)
#else
#define ARP_TIMEOUT (60*HZ) #define ARP_TIMEOUT (60*HZ)
#define ARPD_TIMEOUT (600*HZ)
#endif int sysctl_arp_timeout = ARP_TIMEOUT;
/* /*
* How often is ARP cache checked for expire. * How often is ARP cache checked for expire.
...@@ -135,11 +136,13 @@ ...@@ -135,11 +136,13 @@
#define ARP_CHECK_INTERVAL (60*HZ) #define ARP_CHECK_INTERVAL (60*HZ)
int sysctl_arp_check_interval = ARP_CHECK_INTERVAL;
/* /*
* Soft limit on ARP cache size. * Soft limit on ARP cache size.
* Note that this number should be greater, than * Note that this number should be greater than
* number of simultaneously opened sockets, else * number of simultaneously opened sockets, or else
* hardware header cache will be not efficient. * hardware header cache will not be efficient.
*/ */
#if RT_CACHE_DEBUG >= 2 #if RT_CACHE_DEBUG >= 2
...@@ -162,6 +165,8 @@ ...@@ -162,6 +165,8 @@
#define ARP_RES_TIME (5*HZ) #define ARP_RES_TIME (5*HZ)
int sysctl_arp_res_time = ARP_RES_TIME;
/* /*
* The number of times an broadcast arp request is send, until * The number of times an broadcast arp request is send, until
* the host is considered temporarily unreachable. * the host is considered temporarily unreachable.
...@@ -169,6 +174,8 @@ ...@@ -169,6 +174,8 @@
#define ARP_MAX_TRIES 3 #define ARP_MAX_TRIES 3
int sysctl_arp_max_tries = ARP_MAX_TRIES;
/* /*
* The entry is reconfirmed by sending point-to-point ARP * The entry is reconfirmed by sending point-to-point ARP
* request after ARP_CONFIRM_INTERVAL. * request after ARP_CONFIRM_INTERVAL.
...@@ -183,12 +190,16 @@ ...@@ -183,12 +190,16 @@
#define ARP_CONFIRM_INTERVAL (300*HZ) #define ARP_CONFIRM_INTERVAL (300*HZ)
int sysctl_arp_confirm_interval = ARP_CONFIRM_INTERVAL;
/* /*
* We wait for answer to unicast request for ARP_CONFIRM_TIMEOUT. * We wait for answer to unicast request for ARP_CONFIRM_TIMEOUT.
*/ */
#define ARP_CONFIRM_TIMEOUT ARP_RES_TIME #define ARP_CONFIRM_TIMEOUT ARP_RES_TIME
int sysctl_arp_confirm_timeout = ARP_CONFIRM_TIMEOUT;
/* /*
* The number of times an unicast arp request is retried, until * The number of times an unicast arp request is retried, until
* the cache entry is considered suspicious. * the cache entry is considered suspicious.
...@@ -198,6 +209,8 @@ ...@@ -198,6 +209,8 @@
#define ARP_MAX_PINGS 1 #define ARP_MAX_PINGS 1
int sysctl_arp_max_pings = ARP_MAX_PINGS;
/* /*
* When a host is dead, but someone tries to connect it, * When a host is dead, but someone tries to connect it,
* we do not remove corresponding cache entry (it would * we do not remove corresponding cache entry (it would
...@@ -211,6 +224,8 @@ ...@@ -211,6 +224,8 @@
#define ARP_DEAD_RES_TIME (60*HZ) #define ARP_DEAD_RES_TIME (60*HZ)
int sysctl_arp_dead_res_time = ARP_DEAD_RES_TIME;
/* /*
* This structure defines the ARP mapping cache. * This structure defines the ARP mapping cache.
*/ */
...@@ -741,7 +756,7 @@ static int arp_force_expire(void) ...@@ -741,7 +756,7 @@ static int arp_force_expire(void)
cli(); cli();
users = arp_count_hhs(entry); users = arp_count_hhs(entry);
if (!users && now - entry->last_used > ARP_TIMEOUT) if (!users && now - entry->last_used > sysctl_arp_timeout)
{ {
*pentry = entry->next; *pentry = entry->next;
restore_flags(flags); restore_flags(flags);
...@@ -820,7 +835,7 @@ static void arp_check_expire(unsigned long dummy) ...@@ -820,7 +835,7 @@ static void arp_check_expire(unsigned long dummy)
} }
cli(); cli();
if (now - entry->last_used > ARP_TIMEOUT if (now - entry->last_used > sysctl_arp_timeout
&& !arp_count_hhs(entry)) && !arp_count_hhs(entry))
{ {
*pentry = entry->next; *pentry = entry->next;
...@@ -833,11 +848,11 @@ static void arp_check_expire(unsigned long dummy) ...@@ -833,11 +848,11 @@ static void arp_check_expire(unsigned long dummy)
} }
sti(); sti();
if (entry->last_updated if (entry->last_updated
&& now - entry->last_updated > ARP_CONFIRM_INTERVAL && now - entry->last_updated > sysctl_arp_confirm_interval
&& !(entry->flags & ATF_PERM)) && !(entry->flags & ATF_PERM))
{ {
struct device * dev = entry->dev; struct device * dev = entry->dev;
entry->retries = ARP_MAX_TRIES+ARP_MAX_PINGS; entry->retries = sysctl_arp_max_tries+sysctl_arp_max_pings;
del_timer(&entry->timer); del_timer(&entry->timer);
entry->timer.expires = jiffies + ARP_CONFIRM_TIMEOUT; entry->timer.expires = jiffies + ARP_CONFIRM_TIMEOUT;
add_timer(&entry->timer); add_timer(&entry->timer);
...@@ -859,7 +874,7 @@ static void arp_check_expire(unsigned long dummy) ...@@ -859,7 +874,7 @@ static void arp_check_expire(unsigned long dummy)
* Set the timer again. * Set the timer again.
*/ */
arp_timer.expires = jiffies + ARP_CHECK_INTERVAL; arp_timer.expires = jiffies + sysctl_arp_check_interval;
add_timer(&arp_timer); add_timer(&arp_timer);
} }
...@@ -909,7 +924,7 @@ static void arp_expire_request (unsigned long arg) ...@@ -909,7 +924,7 @@ static void arp_expire_request (unsigned long arg)
*/ */
if ((entry->flags & ATF_COM) && entry->last_updated if ((entry->flags & ATF_COM) && entry->last_updated
&& jiffies - entry->last_updated <= ARP_CONFIRM_INTERVAL) && jiffies - entry->last_updated <= sysctl_arp_confirm_interval)
{ {
restore_flags(flags); restore_flags(flags);
arp_unlock(); arp_unlock();
...@@ -926,10 +941,10 @@ static void arp_expire_request (unsigned long arg) ...@@ -926,10 +941,10 @@ static void arp_expire_request (unsigned long arg)
printk("arp_expire_request: %08x timed out\n", entry->ip); printk("arp_expire_request: %08x timed out\n", entry->ip);
#endif #endif
/* Set new timer. */ /* Set new timer. */
entry->timer.expires = jiffies + ARP_RES_TIME; entry->timer.expires = jiffies + sysctl_arp_res_time;
add_timer(&entry->timer); add_timer(&entry->timer);
arp_send(ARPOP_REQUEST, ETH_P_ARP, entry->ip, dev, dev->pa_addr, arp_send(ARPOP_REQUEST, ETH_P_ARP, entry->ip, dev, dev->pa_addr,
entry->retries > ARP_MAX_TRIES ? entry->ha : NULL, entry->retries > sysctl_arp_max_tries ? entry->ha : NULL,
dev->dev_addr, NULL); dev->dev_addr, NULL);
arp_unlock(); arp_unlock();
return; return;
...@@ -956,7 +971,7 @@ static void arp_expire_request (unsigned long arg) ...@@ -956,7 +971,7 @@ static void arp_expire_request (unsigned long arg)
#if RT_CACHE_DEBUG >= 2 #if RT_CACHE_DEBUG >= 2
printk("arp_expire_request: %08x is dead\n", entry->ip); printk("arp_expire_request: %08x is dead\n", entry->ip);
#endif #endif
entry->retries = ARP_MAX_TRIES; entry->retries = sysctl_arp_max_tries;
entry->flags &= ~ATF_COM; entry->flags &= ~ATF_COM;
arp_invalidate_hhs(entry); arp_invalidate_hhs(entry);
restore_flags(flags); restore_flags(flags);
...@@ -967,7 +982,7 @@ static void arp_expire_request (unsigned long arg) ...@@ -967,7 +982,7 @@ static void arp_expire_request (unsigned long arg)
entry->last_updated = 0; entry->last_updated = 0;
arpd_update(entry); arpd_update(entry);
entry->timer.expires = jiffies + ARP_DEAD_RES_TIME; entry->timer.expires = jiffies + sysctl_arp_dead_res_time;
add_timer(&entry->timer); add_timer(&entry->timer);
arp_send(ARPOP_REQUEST, ETH_P_ARP, entry->ip, dev, dev->pa_addr, arp_send(ARPOP_REQUEST, ETH_P_ARP, entry->ip, dev, dev->pa_addr,
NULL, dev->dev_addr, NULL); NULL, dev->dev_addr, NULL);
...@@ -1317,7 +1332,7 @@ struct arp_table * arp_new_entry(u32 paddr, struct device *dev, struct hh_cache ...@@ -1317,7 +1332,7 @@ struct arp_table * arp_new_entry(u32 paddr, struct device *dev, struct hh_cache
atomic_inc(&hh->hh_refcnt); atomic_inc(&hh->hh_refcnt);
hh->hh_arp = (void*)entry; hh->hh_arp = (void*)entry;
} }
entry->timer.expires = jiffies + ARP_RES_TIME; entry->timer.expires = jiffies + sysctl_arp_res_time;
if (skb != NULL) if (skb != NULL)
{ {
...@@ -1331,7 +1346,7 @@ struct arp_table * arp_new_entry(u32 paddr, struct device *dev, struct hh_cache ...@@ -1331,7 +1346,7 @@ struct arp_table * arp_new_entry(u32 paddr, struct device *dev, struct hh_cache
entry->next = arp_tables[hash]; entry->next = arp_tables[hash];
arp_tables[hash] = entry; arp_tables[hash] = entry;
add_timer(&entry->timer); add_timer(&entry->timer);
entry->retries = ARP_MAX_TRIES; entry->retries = sysctl_arp_max_tries;
#ifdef CONFIG_ARPD #ifdef CONFIG_ARPD
if (!arpd_not_running) if (!arpd_not_running)
arpd_lookup(paddr, dev); arpd_lookup(paddr, dev);
...@@ -1573,8 +1588,8 @@ static void arp_run_bh() ...@@ -1573,8 +1588,8 @@ static void arp_run_bh()
entry->next = arp_tables[hash]; entry->next = arp_tables[hash];
arp_tables[hash] = entry; arp_tables[hash] = entry;
restore_flags(flags); restore_flags(flags);
entry->timer.expires = jiffies + ARP_RES_TIME; entry->timer.expires = jiffies + sysctl_arp_res_time;
entry->retries = ARP_MAX_TRIES; entry->retries = sysctl_arp_max_tries;
entry->last_used = jiffies; entry->last_used = jiffies;
if (!(entry->flags & ATF_COM)) if (!(entry->flags & ATF_COM))
{ {
......
...@@ -16,18 +16,26 @@ ...@@ -16,18 +16,26 @@
* Fixes: * Fixes:
* Mike Shaver : RFC1122 checks. * Mike Shaver : RFC1122 checks.
* Alan Cox : Multicast ping reply as self. * Alan Cox : Multicast ping reply as self.
* Alan Cox : Fix atomicity lockup in ip_build_xmit call * Alan Cox : Fix atomicity lockup in ip_build_xmit
* Alan Cox : Added 216,128 byte paths to the MTU code. * call.
* Alan Cox : Added 216,128 byte paths to the MTU
* code.
* Martin Mares : RFC1812 checks. * Martin Mares : RFC1812 checks.
* Martin Mares : Can be configured to follow redirects if acting * Martin Mares : Can be configured to follow redirects
* as a router _without_ a routing protocol (RFC 1812). * if acting as a router _without_ a
* Martin Mares : Echo requests may be configured to be ignored (RFC 1812). * routing protocol (RFC 1812).
* Martin Mares : Limitation of ICMP error message transmit rate (RFC 1812). * Martin Mares : Echo requests may be configured to
* Martin Mares : TOS and Precedence set correctly (RFC 1812). * be ignored (RFC 1812).
* Martin Mares : Now copying as much data from the original packet * Martin Mares : Limitation of ICMP error message
* as we can without exceeding 576 bytes (RFC 1812). * transmit rate (RFC 1812).
* Martin Mares : TOS and Precedence set correctly
* (RFC 1812).
* Martin Mares : Now copying as much data from the
* original packet as we can without
* exceeding 576 bytes (RFC 1812).
* Willy Konynenberg : Transparent proxying support. * Willy Konynenberg : Transparent proxying support.
* * Keith Owens : RFC1191 correction for 4.2BSD based
* path MTU bug.
* *
* *
* RFC1122 (Host Requirements -- Comm. Layer) Status: * RFC1122 (Host Requirements -- Comm. Layer) Status:
...@@ -81,7 +89,8 @@ ...@@ -81,7 +89,8 @@
* MAY discard broadcast REQUESTs. (OK, but see source for inconsistency) * MAY discard broadcast REQUESTs. (OK, but see source for inconsistency)
* MUST reply using same source address as the request was sent to. (OK) * MUST reply using same source address as the request was sent to. (OK)
* MUST reverse source route, as per ECHO (NOT YET) * MUST reverse source route, as per ECHO (NOT YET)
* MUST pass REPLYs to transport/user layer (requires RAW, just like ECHO) (OK) * MUST pass REPLYs to transport/user layer (requires RAW, just like
* ECHO) (OK)
* MUST update clock for timestamp at least 15 times/sec (OK) * MUST update clock for timestamp at least 15 times/sec (OK)
* MUST be "correct within a few minutes" (OK) * MUST be "correct within a few minutes" (OK)
* 3.2.2.9 (Address Mask Request/Reply) * 3.2.2.9 (Address Mask Request/Reply)
...@@ -108,10 +117,11 @@ ...@@ -108,10 +117,11 @@
* MUST use one of addresses for the interface the orig. packet arrived as * MUST use one of addresses for the interface the orig. packet arrived as
* source address (OK) * source address (OK)
* 4.3.2.5 (TOS and Precedence) * 4.3.2.5 (TOS and Precedence)
* SHOULD leave TOS set to the same value unless the packet would be discarded * SHOULD leave TOS set to the same value unless the packet would be
* for that reason (OK) * discarded for that reason (OK)
* MUST use TOS=0 if not possible to leave original value (OK) * MUST use TOS=0 if not possible to leave original value (OK)
* MUST leave IP Precedence for Source Quench messages (OK -- not sent at all) * MUST leave IP Precedence for Source Quench messages (OK -- not sent
* at all)
* SHOULD use IP Precedence = 6 (Internetwork Control) or 7 (Network Control) * SHOULD use IP Precedence = 6 (Internetwork Control) or 7 (Network Control)
* for all other error messages (OK, we use 6) * for all other error messages (OK, we use 6)
* MAY allow configuration of IP Precedence (OK -- not done) * MAY allow configuration of IP Precedence (OK -- not done)
...@@ -137,7 +147,8 @@ ...@@ -137,7 +147,8 @@
* is enabled on the interface (OK -- ignores) * is enabled on the interface (OK -- ignores)
* 4.3.3.3 (Source Quench) * 4.3.3.3 (Source Quench)
* SHOULD NOT originate SQ messages (OK) * SHOULD NOT originate SQ messages (OK)
* MUST be able to limit SQ rate if originates them (OK as we don't send them) * MUST be able to limit SQ rate if originates them (OK as we don't
* send them)
* MAY ignore SQ messages it receives (OK -- we don't) * MAY ignore SQ messages it receives (OK -- we don't)
* 4.3.3.4 (Time Exceeded) * 4.3.3.4 (Time Exceeded)
* Requirements dealt with at IP (generating TIME_EXCEEDED). * Requirements dealt with at IP (generating TIME_EXCEEDED).
...@@ -166,16 +177,19 @@ ...@@ -166,16 +177,19 @@
* MUST reply using same source address as the request was sent to. (OK) * MUST reply using same source address as the request was sent to. (OK)
* MUST use reversed Source Route if possible (NOT YET) * MUST use reversed Source Route if possible (NOT YET)
* SHOULD update Record Route / Timestamp options (??) * SHOULD update Record Route / Timestamp options (??)
* MUST pass REPLYs to transport/user layer (requires RAW, just like ECHO) (OK) * MUST pass REPLYs to transport/user layer (requires RAW, just like
* ECHO) (OK)
* MUST update clock for timestamp at least 16 times/sec (OK) * MUST update clock for timestamp at least 16 times/sec (OK)
* MUST be "correct within a few minutes" (OK) * MUST be "correct within a few minutes" (OK)
* 4.3.3.9 (Address Mask Request/Reply) * 4.3.3.9 (Address Mask Request/Reply)
* MUST have support for receiving AMRq and responding with AMRe (OK, but only as a * MUST have support for receiving AMRq and responding with AMRe (OK,
* compile-time option) * but only as a compile-time option)
* SHOULD have option for each interface for AMRe's, MUST default to NO (NOT YET) * SHOULD have option for each interface for AMRe's, MUST default to
* NO (NOT YET)
* MUST NOT reply to AMRq before knows the correct AM (OK) * MUST NOT reply to AMRq before knows the correct AM (OK)
* MUST NOT respond to AMRq with source address 0.0.0.0 on physical interfaces * MUST NOT respond to AMRq with source address 0.0.0.0 on physical
* having multiple logical i-faces with different masks (NOT YET) * interfaces having multiple logical i-faces with different masks
* (NOT YET)
* SHOULD examine all AMRe's it receives and check them (NOT YET) * SHOULD examine all AMRe's it receives and check them (NOT YET)
* SHOULD log invalid AMRe's (AM+sender) (NOT YET) * SHOULD log invalid AMRe's (AM+sender) (NOT YET)
* MUST NOT use contents of AMRe to determine correct AM (OK) * MUST NOT use contents of AMRe to determine correct AM (OK)
...@@ -192,8 +206,8 @@ ...@@ -192,8 +206,8 @@
* SHOULD NOT generate Host Isolated codes (OK) * SHOULD NOT generate Host Isolated codes (OK)
* SHOULD use Communication Administratively Prohibited when administratively * SHOULD use Communication Administratively Prohibited when administratively
* filtering packets (NOT YET -- bug-to-bug compatibility) * filtering packets (NOT YET -- bug-to-bug compatibility)
* MAY include config option for not generating the above and silently discard * MAY include config option for not generating the above and silently
* the packets instead (OK) * discard the packets instead (OK)
* MAY include config option for not generating Precedence Violation and * MAY include config option for not generating Precedence Violation and
* Precedence Cutoff messages (OK as we don't generate them at all) * Precedence Cutoff messages (OK as we don't generate them at all)
* MUST use Host Unreachable or Dest. Host Unknown codes whenever other hosts * MUST use Host Unreachable or Dest. Host Unknown codes whenever other hosts
...@@ -344,7 +358,7 @@ struct socket icmp_socket; ...@@ -344,7 +358,7 @@ struct socket icmp_socket;
/* /*
* Send an ICMP frame. * Send an ICMP frame.
*/ */
/* /*
* Initialize the transmit rate limitation mechanism. * Initialize the transmit rate limitation mechanism.
...@@ -370,7 +384,8 @@ static void xrlim_init(void) ...@@ -370,7 +384,8 @@ static void xrlim_init(void)
* Check transmit rate limitation for given message. * Check transmit rate limitation for given message.
* *
* RFC 1812: 4.3.2.8 SHOULD be able to limit error message rate * RFC 1812: 4.3.2.8 SHOULD be able to limit error message rate
* SHOULD allow setting of rate limits (we allow in the source) * SHOULD allow setting of rate limits (we allow
* in the source)
*/ */
static int xrlim_allow(int type, __u32 addr) static int xrlim_allow(int type, __u32 addr)
...@@ -385,7 +400,8 @@ static int xrlim_allow(int type, __u32 addr) ...@@ -385,7 +400,8 @@ static int xrlim_allow(int type, __u32 addr)
if (!r) if (!r)
return 1; return 1;
for (c = r->cache; c < &r->cache[XRLIM_CACHE_SIZE]; c++) /* Cache lookup */ for (c = r->cache; c < &r->cache[XRLIM_CACHE_SIZE]; c++)
/* Cache lookup */
if (c->daddr == addr) if (c->daddr == addr)
break; break;
...@@ -645,6 +661,22 @@ static void icmp_unreach(struct icmphdr *icmph, struct sk_buff *skb, struct devi ...@@ -645,6 +661,22 @@ static void icmp_unreach(struct icmphdr *icmph, struct sk_buff *skb, struct devi
unsigned short old_mtu = ntohs(iph->tot_len); unsigned short old_mtu = ntohs(iph->tot_len);
unsigned short new_mtu = ntohs(icmph->un.echo.sequence); unsigned short new_mtu = ntohs(icmph->un.echo.sequence);
/*
* RFC1191 5. 4.2BSD based router can return incorrect
* Total Length. If current mtu is unknown or old_mtu
* is not less than current mtu, reduce old_mtu by 4 times
* the header length.
*/
if (skb->sk == NULL /* can this happen? */
|| skb->sk->ip_route_cache == NULL
|| skb->sk->ip_route_cache->rt_mtu <= old_mtu)
{
NETDEBUG(printk(KERN_INFO "4.2BSD based fragmenting router between here and %s, mtu corrected from %d", in_ntoa(iph->daddr), old_mtu));
old_mtu -= 4 * iph->ihl;
NETDEBUG(printk(" to %d\n", old_mtu));
}
if (new_mtu < 68 || new_mtu >= old_mtu) if (new_mtu < 68 || new_mtu >= old_mtu)
{ {
/* /*
......
...@@ -8,8 +8,10 @@ ...@@ -8,8 +8,10 @@
* Authors: see ip.c * Authors: see ip.c
* *
* Fixes: * Fixes:
* Many : Split from ip.c , see ip_input.c for history. * Many : Split from ip.c , see ip_input.c for
* Dave Gregorich : NULL ip_rt_put fix for multicast routing. * history.
* Dave Gregorich : NULL ip_rt_put fix for multicast
* routing.
* Jos Vos : Add call_out_firewall before sending, * Jos Vos : Add call_out_firewall before sending,
* use output device for accounting. * use output device for accounting.
* Jos Vos : Call forward firewall after routing * Jos Vos : Call forward firewall after routing
...@@ -225,6 +227,23 @@ int ip_forward(struct sk_buff *skb, struct device *dev, int is_frag, ...@@ -225,6 +227,23 @@ int ip_forward(struct sk_buff *skb, struct device *dev, int is_frag,
#ifdef CONFIG_FIREWALL #ifdef CONFIG_FIREWALL
if(!(is_frag&IPFWD_MASQUERADED)) if(!(is_frag&IPFWD_MASQUERADED))
{ {
#ifdef CONFIG_IP_MASQUERADE
/*
* Check that any ICMP packets are not for a
* masqueraded connection. If so rewrite them
* and skip the firewall checks
*/
if (iph->protocol == IPPROTO_ICMP)
{
if ((fw_res = ip_fw_masq_icmp(&skb, dev2)) < 0)
/* Problem - ie bad checksum */
return -1;
if (fw_res)
/* ICMP matched - skip firewall */
goto skip_call_fw_firewall;
}
#endif
fw_res=call_fw_firewall(PF_INET, dev2, iph, NULL); fw_res=call_fw_firewall(PF_INET, dev2, iph, NULL);
switch (fw_res) { switch (fw_res) {
case FW_ACCEPT: case FW_ACCEPT:
...@@ -236,6 +255,10 @@ int ip_forward(struct sk_buff *skb, struct device *dev, int is_frag, ...@@ -236,6 +255,10 @@ int ip_forward(struct sk_buff *skb, struct device *dev, int is_frag,
default: default:
return -1; return -1;
} }
#ifdef CONFIG_IP_MASQUERADE
skip_call_fw_firewall:
#endif
} }
#endif #endif
......
...@@ -568,8 +568,108 @@ int ip_fw_masquerade(struct sk_buff **skb_ptr, struct device *dev) ...@@ -568,8 +568,108 @@ int ip_fw_masquerade(struct sk_buff **skb_ptr, struct device *dev)
return 0; return 0;
} }
/*
* Handle ICMP messages in forward direction.
* Find any that might be relevant, check against existing connections,
* forward to masqueraded host if relevant.
* Currently handles error types - unreachable, quench, ttl exceeded
*/
int ip_fw_masq_icmp(struct sk_buff **skb_p, struct device *dev)
{
struct sk_buff *skb = *skb_p;
struct iphdr *iph = skb->h.iph;
struct icmphdr *icmph = (struct icmphdr *)((char *)iph + (iph->ihl<<2));
struct iphdr *ciph; /* The ip header contained within the ICMP */
__u16 *pptr; /* port numbers from TCP/UDP contained header */
struct ip_masq *ms;
unsigned short len = ntohs(iph->tot_len) - (iph->ihl * 4);
#ifdef DEBUG_CONFIG_IP_MASQUERADE
printk("Incoming forward ICMP (%d) %lX -> %lX\n",
icmph->type,
ntohl(iph->saddr), ntohl(iph->daddr));
#endif
/*
* Work through seeing if this is for us.
* These checks are supposed to be in an order that
* means easy things are checked first to speed up
* processing.... however this means that some
* packets will manage to get a long way down this
* stack and then be rejected, but thats life
*/
if ((icmph->type != ICMP_DEST_UNREACH) &&
(icmph->type != ICMP_SOURCE_QUENCH) &&
(icmph->type != ICMP_TIME_EXCEEDED))
return 0;
/* Now find the contained IP header */
ciph = (struct iphdr *) (icmph + 1);
/* We are only interested ICMPs generated from TCP or UDP packets */
if ((ciph->protocol != IPPROTO_UDP) && (ciph->protocol != IPPROTO_TCP))
return 0;
/*
* Find the ports involved - this packet was
* incoming so the ports are right way round
* (but reversed relative to outer IP header!)
*/
pptr = (__u16 *)&(((char *)ciph)[ciph->ihl*4]);
if (ntohs(pptr[1]) < PORT_MASQ_BEGIN ||
ntohs(pptr[1]) > PORT_MASQ_END)
return 0;
/* Ensure the checksum is correct */
if (ip_compute_csum((unsigned char *) icmph, len))
{
/* Failed checksum! */
printk(KERN_INFO "MASQ: forward ICMP: failed checksum from %s!\n",
in_ntoa(iph->saddr));
return(-1);
}
#ifdef DEBUG_CONFIG_IP_MASQUERADE
printk("Handling forward ICMP for %lX:%X -> %lX:%X\n",
ntohl(ciph->saddr), ntohs(pptr[0]),
ntohl(ciph->daddr), ntohs(pptr[1]));
#endif
/* This is pretty much what ip_masq_in_get() does */
ms = ip_masq_in_get_2(ciph->protocol, ciph->saddr, pptr[0], ciph->daddr, pptr[1]);
if (ms == NULL)
return 0;
/* Now we do real damage to this packet...! */
/* First change the source IP address, and recalc checksum */
iph->saddr = ms->maddr;
ip_send_check(iph);
/* Now change the *dest* address in the contained IP */
ciph->daddr = ms->maddr;
ip_send_check(ciph);
/* the TCP/UDP dest port - cannot redo check */
pptr[1] = ms->mport;
/* And finally the ICMP checksum */
icmph->checksum = 0;
icmph->checksum = ip_compute_csum((unsigned char *) icmph, len);
#ifdef DEBUG_CONFIG_IP_MASQUERADE
printk("Rewrote forward ICMP to %lX:%X -> %lX:%X\n",
ntohl(ciph->saddr), ntohs(pptr[0]),
ntohl(ciph->daddr), ntohs(pptr[1]));
#endif
return 1;
}
/* /*
* Handle ICMP messages. * Handle ICMP messages in reverse (demasquerade) direction.
* Find any that might be relevant, check against existing connections, * Find any that might be relevant, check against existing connections,
* forward to masqueraded host if relevant. * forward to masqueraded host if relevant.
* Currently handles error types - unreachable, quench, ttl exceeded * Currently handles error types - unreachable, quench, ttl exceeded
...@@ -586,7 +686,7 @@ int ip_fw_demasq_icmp(struct sk_buff **skb_p, struct device *dev) ...@@ -586,7 +686,7 @@ int ip_fw_demasq_icmp(struct sk_buff **skb_p, struct device *dev)
unsigned short len = ntohs(iph->tot_len) - (iph->ihl * 4); unsigned short len = ntohs(iph->tot_len) - (iph->ihl * 4);
#ifdef DEBUG_CONFIG_IP_MASQUERADE #ifdef DEBUG_CONFIG_IP_MASQUERADE
printk("Incoming ICMP (%d) %lX -> %lX\n", printk("Incoming reverse ICMP (%d) %lX -> %lX\n",
icmph->type, icmph->type,
ntohl(iph->saddr), ntohl(iph->daddr)); ntohl(iph->saddr), ntohl(iph->daddr));
#endif #endif
...@@ -616,12 +716,13 @@ int ip_fw_demasq_icmp(struct sk_buff **skb_p, struct device *dev) ...@@ -616,12 +716,13 @@ int ip_fw_demasq_icmp(struct sk_buff **skb_p, struct device *dev)
if (ip_compute_csum((unsigned char *) icmph, len)) if (ip_compute_csum((unsigned char *) icmph, len))
{ {
/* Failed checksum! */ /* Failed checksum! */
printk(KERN_INFO "MASQ: ICMP: failed checksum from %s!\n", in_ntoa(iph->saddr)); printk(KERN_INFO "MASQ: reverse ICMP: failed checksum from %s!\n",
in_ntoa(iph->saddr));
return(-1); return(-1);
} }
#ifdef DEBUG_CONFIG_IP_MASQUERADE #ifdef DEBUG_CONFIG_IP_MASQUERADE
printk("Handling ICMP for %lX:%X -> %lX:%X\n", printk("Handling reverse ICMP for %lX:%X -> %lX:%X\n",
ntohl(ciph->saddr), ntohs(pptr[0]), ntohl(ciph->saddr), ntohs(pptr[0]),
ntohl(ciph->daddr), ntohs(pptr[1])); ntohl(ciph->daddr), ntohs(pptr[1]));
#endif #endif
...@@ -649,7 +750,7 @@ int ip_fw_demasq_icmp(struct sk_buff **skb_p, struct device *dev) ...@@ -649,7 +750,7 @@ int ip_fw_demasq_icmp(struct sk_buff **skb_p, struct device *dev)
icmph->checksum = ip_compute_csum((unsigned char *) icmph, len); icmph->checksum = ip_compute_csum((unsigned char *) icmph, len);
#ifdef DEBUG_CONFIG_IP_MASQUERADE #ifdef DEBUG_CONFIG_IP_MASQUERADE
printk("Rewrote ICMP to %lX:%X -> %lX:%X\n", printk("Rewrote reverse ICMP to %lX:%X -> %lX:%X\n",
ntohl(ciph->saddr), ntohs(pptr[0]), ntohl(ciph->saddr), ntohs(pptr[0]),
ntohl(ciph->daddr), ntohs(pptr[1])); ntohl(ciph->daddr), ntohs(pptr[1]));
#endif #endif
......
...@@ -8,6 +8,31 @@ ...@@ -8,6 +8,31 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/sysctl.h> #include <linux/sysctl.h>
/* From arp.c */
extern int sysctl_arp_res_time;
extern int sysctl_arp_dead_res_time;
extern int sysctl_arp_max_tries;
extern int sysctl_arp_timeout;
extern int sysctl_arp_check_interval;
extern int sysctl_arp_confirm_interval;
extern int sysctl_arp_confirm_timeout;
ctl_table ipv4_table[] = { ctl_table ipv4_table[] = {
{NET_IPV4_ARP_RES_TIME, "arp_res_time",
&sysctl_arp_res_time, sizeof(int), 0644, NULL, &proc_dointvec},
{NET_IPV4_ARP_DEAD_RES_TIME, "arp_dead_res_time",
&sysctl_arp_dead_res_time, sizeof(int), 0644, NULL, &proc_dointvec},
{NET_IPV4_ARP_MAX_TRIES, "arp_max_tries",
&sysctl_arp_max_tries, sizeof(int), 0644, NULL, &proc_dointvec},
{NET_IPV4_ARP_TIMEOUT, "arp_timeout",
&sysctl_arp_timeout, sizeof(int), 0644, NULL, &proc_dointvec},
{NET_IPV4_ARP_CHECK_INTERVAL, "arp_check_interval",
&sysctl_arp_check_interval, sizeof(int), 0644, NULL, &proc_dointvec},
{NET_IPV4_ARP_CONFIRM_INTERVAL, "arp_confirm_interval",
&sysctl_arp_confirm_interval, sizeof(int), 0644, NULL,
&proc_dointvec},
{NET_IPV4_ARP_CONFIRM_TIMEOUT, "arp_confirm_timeout",
&sysctl_arp_confirm_timeout, sizeof(int), 0644, NULL,
&proc_dointvec},
{0} {0}
}; };
...@@ -933,7 +933,7 @@ static int tcp_ack(struct sock *sk, struct tcphdr *th, u32 ack, int len) ...@@ -933,7 +933,7 @@ static int tcp_ack(struct sock *sk, struct tcphdr *th, u32 ack, int len)
/* /*
* Maybe we can take some stuff off of the write queue, * Maybe we can take some stuff off of the write queue,
* and put it onto the xmit queue. * and put it onto the xmit queue.
* FIXME: (?) There is bizzare case being tested here, to check if * FIXME: (?) There is bizarre case being tested here, to check if
* the data at the head of the queue ends before the start of * the data at the head of the queue ends before the start of
* the sequence we already ACKed. This does not appear to be * the sequence we already ACKed. This does not appear to be
* a case that can actually occur. Why are we testing it? * a case that can actually occur. Why are we testing it?
...@@ -1679,7 +1679,7 @@ int tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt, ...@@ -1679,7 +1679,7 @@ int tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
struct sock *sk; struct sock *sk;
int syn_ok=0; int syn_ok=0;
#ifdef CONFIG_IP_TRANSPARENT_PROXY #ifdef CONFIG_IP_TRANSPARENT_PROXY
int r; int r=0;
#endif #endif
/* /*
......
...@@ -61,7 +61,7 @@ void tcp_reset_xmit_timer(struct sock *sk, int why, unsigned long when) ...@@ -61,7 +61,7 @@ void tcp_reset_xmit_timer(struct sock *sk, int why, unsigned long when)
if (sk->retransmit_timer.expires < jiffies) { if (sk->retransmit_timer.expires < jiffies) {
/* We can get here if we reset the timer on an event /* We can get here if we reset the timer on an event
* that could not fire because the interupts where disabled. * that could not fire because the interrupts were disabled.
* make sure it happens soon. * make sure it happens soon.
*/ */
sk->retransmit_timer.expires = jiffies+2; sk->retransmit_timer.expires = jiffies+2;
......
...@@ -63,6 +63,21 @@ int netlink_donothing(struct sk_buff *skb) ...@@ -63,6 +63,21 @@ int netlink_donothing(struct sk_buff *skb)
return -EINVAL; return -EINVAL;
} }
static int netlink_select(struct inode *inode, struct file *file, int sel_type, select_table * wait)
{
unsigned int minor = MINOR(inode->i_rdev);
switch (sel_type) {
case SEL_IN:
if (skb_peek(&skb_queue_rd[minor])!=NULL)
return 1;
select_wait(&read_space_wait[minor], wait);
break;
case SEL_OUT:
return 1;
}
return 0;
}
/* /*
* Write a message to the kernel side of a communication link * Write a message to the kernel side of a communication link
*/ */
...@@ -161,7 +176,7 @@ static struct file_operations netlink_fops = { ...@@ -161,7 +176,7 @@ static struct file_operations netlink_fops = {
netlink_read, netlink_read,
netlink_write, netlink_write,
NULL, /* netlink_readdir */ NULL, /* netlink_readdir */
NULL, /* netlink_select */ netlink_select,
netlink_ioctl, netlink_ioctl,
NULL, /* netlink_mmap */ NULL, /* netlink_mmap */
netlink_open, netlink_open,
......
...@@ -31,6 +31,10 @@ ...@@ -31,6 +31,10 @@
#include <linux/net_alias.h> #include <linux/net_alias.h>
#endif #endif
#ifdef CONFIG_NETLINK
#include <net/netlink.h>
#endif
#ifdef CONFIG_NET_ALIAS #ifdef CONFIG_NET_ALIAS
#include <linux/net_alias.h> #include <linux/net_alias.h>
#endif #endif
...@@ -173,6 +177,12 @@ static struct symbol_table net_syms = { ...@@ -173,6 +177,12 @@ static struct symbol_table net_syms = {
X(arp_query), X(arp_query),
#endif /* CONFIG_INET */ #endif /* CONFIG_INET */
#ifdef CONFIG_NETLINK
X(netlink_attach),
X(netlink_detach),
X(netlink_post),
#endif /* CONFIG_NETLINK */
#include <linux/symtab_end.h> #include <linux/symtab_end.h>
}; };
......
...@@ -3,6 +3,13 @@ ...@@ -3,6 +3,13 @@
* *
* Begun April 1, 1996, Mike Shaver. * Begun April 1, 1996, Mike Shaver.
* Added /proc/sys/net directories for each protocol family. [MS] * Added /proc/sys/net directories for each protocol family. [MS]
*
* $Log: sysctl_net.c,v $
* Revision 1.2 1996/05/08 20:24:40 shaver
* Added bits for NET_BRIDGE and the NET_IPV4_ARP stuff and
* NET_IPV4_IP_FORWARD.
*
*
*/ */
#include <linux/config.h> #include <linux/config.h>
...@@ -35,6 +42,10 @@ extern ctl_table core_table[], unix_table[]; ...@@ -35,6 +42,10 @@ extern ctl_table core_table[], unix_table[];
extern ctl_table ether_table[], e802_table[]; extern ctl_table ether_table[], e802_table[];
#endif #endif
#ifdef CONFIG_BRIDGE
extern ctl_table bridge_table[];
#endif
ctl_table net_table[] = { ctl_table net_table[] = {
{NET_CORE, "core", NULL, 0, 0555, core_table}, {NET_CORE, "core", NULL, 0, 0555, core_table},
{NET_UNIX, "unix", NULL, 0, 0555, unix_table}, {NET_UNIX, "unix", NULL, 0, 0555, unix_table},
...@@ -56,6 +67,9 @@ ctl_table net_table[] = { ...@@ -56,6 +67,9 @@ ctl_table net_table[] = {
#endif #endif
#ifdef CONFIG_AX25 #ifdef CONFIG_AX25
{NET_AX25, "ax25", NULL, 0, 0555, ax25_table}, {NET_AX25, "ax25", NULL, 0, 0555, ax25_table},
#endif
#ifdef CONFIG_BRIDGE
{NET_BRIDGE, "bridge", NULL, 0, 0555, bridge_table},
#endif #endif
{0} {0}
}; };
...@@ -627,7 +627,7 @@ function parse_config_files () { ...@@ -627,7 +627,7 @@ function parse_config_files () {
# #
for i in MCmenu* for i in MCmenu*
do do
source $i source ./$i
done done
rm -f MCmenu* rm -f MCmenu*
...@@ -646,9 +646,30 @@ function activate_menu () { ...@@ -646,9 +646,30 @@ function activate_menu () {
comment_ctr=0 #So comment lines get unique tags comment_ctr=0 #So comment lines get unique tags
$1 "$default" #Create the lxdialog menu & functions $1 "$default" #Create the lxdialog menu & functions
. MCradiolists #Source the menu's functions
. MCmenu 2>MCdialog.out #Activate the lxdialog menu if [ "$?" != "0" ]
then
clear
cat <<EOM

Menuconfig has encountered a possible error in one of the kernel's
configuration files and is unable to continue.
Please report this to the author <roadcapw@cfw.com>. You may also
send a problem report to linux-kernel@vger.rutgers.edu or post a
message to the linux.dev.kernel news group.
Please indicate the kernel version you are trying to configure and
which menu you were trying to enter when this error occured.
EOM
cleanup
exit 1
fi
. ./MCradiolists #Source the menu's functions
. ./MCmenu 2>MCdialog.out #Activate the lxdialog menu
ret=$? ret=$?
read selection <MCdialog.out read selection <MCdialog.out
...@@ -678,6 +699,32 @@ function activate_menu () { ...@@ -678,6 +699,32 @@ function activate_menu () {
255|1) 255|1)
break break
;; ;;
139)
stty sane
clear
cat <<EOM

There seems to be a problem with the lxdialog companion utility which is
built prior to running Menuconfig. Usually this is an indicator that you
have upgraded/downgraded your ncurses libraries and did not remove the
old ncurses header file(s) in /usr/include or /usr/include/ncurses.
It is VERY important that you have only one set of ncurses header files
and that those files are properly version matched to the ncurses libraries
installed on your machine.
You may also need to rebuild lxdialog. This can be done by moving to
the /usr/src/linux/scripts/lxdialog directory and issuing the
"make clean all" command.
If you have verified that your ncurses install is correct, you may email
the author <roadcapw@cfw.com> or post a message on the linux.dev.kernel
news group for additional assistance.
EOM
cleanup
exit 139
;;
esac esac
done done
} }
...@@ -719,7 +766,7 @@ last retrieved. Leave blank to abort."\ ...@@ -719,7 +766,7 @@ last retrieved. Leave blank to abort."\
else else
echo -ne "\007" echo -ne "\007"
$DIALOG --backtitle "$backtitle" \ $DIALOG --backtitle "$backtitle" \
--infobox "File does not exit!" 3 38 --infobox "File does not exist!" 3 38
sleep 2 sleep 2
fi fi
else else
...@@ -815,7 +862,7 @@ function load_config_file () { ...@@ -815,7 +862,7 @@ function load_config_file () {
! /# .* is not set.*/ { print } ! /# .* is not set.*/ { print }
' $1 >.tmpconfig ' $1 >.tmpconfig
source .tmpconfig source ./.tmpconfig
rm -f .tmpconfig rm -f .tmpconfig
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment