Commit 4e6b9ed5 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.2.1

parent 27c44f56
VERSION = 1
PATCHLEVEL = 2
SUBLEVEL = 0
SUBLEVEL = 1
ARCH = i386
......
Linux kernel release 1.1.xx
Linux kernel release 1.2.xx
These are the release notes for linux version 1.1. Read them carefully,
These are the release notes for linux version 1.2. Read them carefully,
as they tell you what this is all about, explain how to install the
kernel, and what to do if something goes wrong.
Warning: This is a work in progress. If you are not reasonably at ease with
the C programming language, GCC, installing Linux, and recovering from
system crashes, please use the 1.0 version, or wait for 1.2.
WHAT IS LINUX?
Linux is a Unix clone for 386/486-based PCs written from scratch by
......@@ -23,12 +19,21 @@ WHAT IS LINUX?
It is distributed under the GNU General Public License - see the
accompanying COPYING file for more details.
DOCUMENTATION:
- there is a lot of documentation available both in electronic form on
the internet and in books, both Linux-specific and pertaining to
general UNIX questions. I'd recommend looking into the documentation
subdirectories on any Linux ftp site for the LDP (Linux Documentation
Project) books. This README is not meant to be documentation on the
system: there are much better sources available.
INSTALLING the kernel:
- If you install the full sources, do a
cd /usr/src
gzip -cd linux-1.1.XX.tar.gz | tar xfv -
gzip -cd linux-1.2.XX.tar.gz | tar xfv -
to get it all put in place. Replace "XX" with the version number of the
latest kernel.
......
......@@ -23,6 +23,7 @@
OBJS := ll_rw_blk.o ramdisk.o genhd.o
SRCS := ll_rw_blk.c ramdisk.c genhd.c
BLOCK_MODULE_OBJS =
ifdef CONFIG_BLK_DEV_FD
OBJS := $(OBJS) floppy.o
......@@ -47,6 +48,8 @@ endif
ifdef CONFIG_SBPCD
OBJS := $(OBJS) sbpcd.o
SRCS := $(SRCS) sbpcd.c
else
BLOCK_MODULE_OBJS := $(BLOCK_MODULE_OBJS) sbpcd.o
endif #CONFIG_SBPCD
ifdef CONFIG_SBPCD2
......@@ -82,6 +85,8 @@ endif
ifdef CONFIG_CDU535
OBJS := $(OBJS) sonycd535.o
SRCS := $(SRCS) sonycd535.c
else
BLOCK_MODULE_OBJS := $(BLOCK_MODULE_OBJS) sonycd535.o
endif
all: block.a
......@@ -94,7 +99,10 @@ block.a: $(OBJS)
dep:
$(CPP) -M $(SRCS) > .depend
modules:
modules: $(BLOCK_MODULE_OBJS)
echo $(BLOCK_MODULE_OBJS) > ../../modules/BLOCK_MODULES
(cd ../../modules;for i in $(BLOCK_MODULE_OBJS); do ln -sf ../drivers/block/$$i .; done)
dummy:
#
......
README.ide -- Information regarding ide.c and ide-cd.c (IDE driver in 1.1.95)
README.ide -- Information regarding ide.c and ide-cd.c (IDE driver in 1.2.x)
================================================================================
Supported by: mlord@bnr.ca -- disks, interfaces, probing
snyder@fnald0.fnal.gov -- cdroms, ATAPI, audio
......@@ -9,8 +9,8 @@ Major features of ide.c & ide-cd.c:
- support for up to two IDE interfaces on one or two IRQs
- support for any mix of up to four disk and/or cdrom drives
- support for reading IDE ATAPI cdrom drives (NEC, MITSUMI, VERSA, SONY)
- support for audio functions on FX400,NEC-260 cdrom drives (others?)
- support for reading IDE ATAPI cdrom drives (NEC,MITSUMI,VERTOS,SONY)
- support for audio functions
- auto-detection of interfaces, drives, IRQs, and disk geometries
-- "single" drives should be jumpered as "master", not "slave"
- support for BIOSs which report "more than 16 heads" on disk drives
......
This README belongs to release 3.2 or newer of the SoundBlaster Pro
This README belongs to release 3.4 or newer of the SoundBlaster Pro
(Matsushita, Kotobuki, Panasonic, CreativeLabs, Longshine and soon TEAC, too)
CD-ROM driver for Linux.
......@@ -18,12 +18,14 @@ a soundcard).
The quad-speed TEAC CD-55A drive uses the same interface types, but has a
totally different command and flow control scheme. Support is under
construction.
construction, but splitted: Greg Nowicki (nowicki@tardis.larc.nasa.gov)
cares about the separate driver "teaccd". Please, do not mail him merely for
asking "user questions" at the moment - the project is still a "baby".
CreativeLabs has a new drive "CD-200". Support is under construction.
Detection should already work.
Regarding CD200 and CD-55A support:
Regarding CD200 support:
Please, don't mail me about it if you are not a competent BETA tester
(if you are: mail!; I do not have such drives).
Please, don't drop simple questions about the new drives in the
......@@ -189,15 +191,27 @@ and see the contents of your CD in the /CD directory, and/or hear music with
"workman -c /dev/sbpcd &".
Using sbpcd as a "loadable module":
-----------------------------------
If you do NOT select "Matsushita/Panasonic CDROM driver support" during the
"make config" of your kernel, you can build the "loadable module" sbpcd.o.
Read /usr/src/linux/README.modules on this.
If sbpcd gets used as a module, the "audio copy" feature is disabled, and the
internal read-ahead buffer has a reduced size (the latter may affect throughput
a little bit under "slow" CPUs). Further, support of more than one interface
card (i.e. drives 4...15) is disabled.
Things of interest:
-------------------
The driver is configured to try the SoundBlaster Pro type of interface at
I/O port 0x0230 first. If this is not appropriate, sbpcd.h should get changed
The driver is configured to try the LaserMate type of interface at I/O port
0x0340 first. If this is not appropriate, sbpcd.h should get changed
(you will find the right place - just at the beginning).
No DMA and no IRQ is used, so the IRQ line stays free for the SB Pro sound
drivers.
No DMA and no IRQ is used.
To reduce or increase the amount of kernel messages, edit sbpcd.c and play
with the "DBG_xxx" switches (initialization of the variable "sbpcd_debug").
......@@ -356,6 +370,20 @@ right setup.
For every-day use, address and type should get configured within sbpcd.h. That
will stop the auto-probing due to success with the first try.
The kernel command "sbpcd=0" suppresses each auto-probing and causes
the driver not to find any drive; it is meant for people who love sbpcd
so much that they do not want to miss it, even if they miss the drives. ;-)
If you configure "#define CDROM_PORT 0" in sbpcd.h, the auto-probing is
initially disabled and needs an explicit kernel command to get activated.
Once activated, it does not stop before success or end-of-list. This may be
useful within "universal" CDROM installation boot floppies (but using the
loadable module would be better because it allows an "extended" auto-probing
without fearing NE2000 cards).
To shorten the auto-probing list to a single entry, set DISTRIBUTION 0 within
sbpcd.c.
Setting up address and interface type:
--------------------------------------
......@@ -532,10 +560,8 @@ is an all-zero number. I guess now almost no CD holds such a number.
Bug reports, comments, wishes, donations (technical information is a donation,
too :-) etc. to
emoenke@gwdg.de
or to eberhard_moenkeberg@rollo.central.de
or to my FIDO address: Eberhard Moenkeberg, 2:2437/210.27
SnailMail address, preferable for CD editors if they want to submit a free
"cooperation" copy:
Eberhard Moenkeberg
......
/*
* linux/drivers/block/ide.c Version 3.13 February 23, 1995
* linux/drivers/block/ide.c Version 3.14 March 7, 1995
*
* Copyright (C) 1994, 1995 Linus Torvalds & authors (see below)
*/
......@@ -104,6 +104,9 @@
* Version 3,12 simplify logic for selecting initial mult_count
* (fixes problems with buggy WD drives)
* Version 3.13 remove excess "multiple mode disabled" messages
* Version 3.14 fix ide_error() handling of BUSY_STAT
* fix byte-swapped cdrom strings (again.. arghh!)
* ignore INDEX bit when checking the ALTSTATUS reg
*
* To do:
* - special 32-bit controller-type detection & support
......@@ -612,17 +615,21 @@ static void ide_error (ide_dev_t *dev, const char *msg, byte stat)
return;
}
#endif /* IDE_DRIVE_CMD */
if (dev->type == disk && (stat & ERR_STAT)) {
/* err has different meaning on cdrom */
if (err & BBD_ERR) /* retries won't help this! */
rq->errors = ERROR_MAX;
else if (err & TRK0_ERR) /* help it find track zero */
rq->errors |= ERROR_RECAL;
}
if ((stat & DRQ_STAT) && rq->cmd == READ) {
int i = dev->mult_count ? dev->mult_count<<8 : 1<<8;
while (i-- > 0) /* try to flush data */
(void) IN_BYTE(HD_DATA, dev->hwif);
if (stat & BUSY_STAT) { /* other bits are useless when BUSY */
rq->errors |= ERROR_RESET;
} else {
if (dev->type == disk && (stat & ERR_STAT)) {
/* err has different meaning on cdrom */
if (err & BBD_ERR) /* retries won't help this! */
rq->errors = ERROR_MAX;
else if (err & TRK0_ERR) /* help it find track zero */
rq->errors |= ERROR_RECAL;
}
if ((stat & DRQ_STAT) && rq->cmd == READ) {
int i = dev->mult_count ? dev->mult_count<<8 : 1<<8;
while (i-- > 0) /* try to flush data */
(void) IN_BYTE(HD_DATA, dev->hwif);
}
}
if (GET_STAT(dev->hwif) & (BUSY_STAT|DRQ_STAT))
rq->errors |= ERROR_RESET; /* Mmmm.. timing problem */
......@@ -1612,9 +1619,14 @@ static void do_identify (ide_dev_t *dev, byte cmd)
/*
* WIN_IDENTIFY returns little-endian info,
* WIN_PIDENTIFY return big-endian info.
* WIN_PIDENTIFY *usually* returns little-endian info.
*/
bswap = (cmd == WIN_IDENTIFY);
bswap = 1;
if (cmd == WIN_PIDENTIFY) {
if ((id->model[0] == 'N' && id->model[1] == 'E')
|| (id->model[0] == 'F' && id->model[1] == 'X'))
bswap = 0; /* NEC and *some* Mitsumi units */
} /* Vertos drives may still be weird */
fixstring (id->model, sizeof(id->model), bswap);
fixstring (id->fw_rev, sizeof(id->fw_rev), bswap);
fixstring (id->serial_no, sizeof(id->serial_no), bswap);
......@@ -1738,10 +1750,11 @@ static int try_to_identify (ide_dev_t *dev, byte cmd)
}
#endif /* PROBE_FOR_IRQS */
delay_10ms(); /* take a deep breath */
if (IN_BYTE(HD_ALTSTATUS,DEV_HWIF) == IN_BYTE(HD_STATUS,DEV_HWIF))
hd_status = HD_ALTSTATUS; /* use non-intrusive polling */
else
if ((IN_BYTE(HD_ALTSTATUS,DEV_HWIF) ^ IN_BYTE(HD_STATUS,DEV_HWIF)) & ~INDEX_STAT) {
hd_status = HD_STATUS; /* an ancient Seagate drive */
printk("%s: probing with STATUS instead of ALTSTATUS\n", dev->name);
} else
hd_status = HD_ALTSTATUS; /* use non-intrusive polling */
OUT_BYTE(cmd,HD_COMMAND); /* ask drive for ID */
timeout = ((cmd == WIN_IDENTIFY) ? WAIT_WORSTCASE : WAIT_PIDENTIFY) / 2;
timeout += jiffies;
......
This diff is collapsed.
......@@ -1686,11 +1686,8 @@ static int con_write(struct tty_struct * tty, int from_user,
case '@': /* defined in ISO 2022 */
utf = 0;
continue;
case '8':
/* ISO/ECMA hasn't yet registered an
official ESC sequence for UTF-8,
so this one (ESC %8) will likely
change in the future. */
case 'G': /* prelim official escape code */
case '8': /* retained for compatibility */
utf = 1;
continue;
}
......
This diff is collapsed.
......@@ -1051,7 +1051,9 @@ static void release_dev(struct file * filp)
if (o_tty->ldisc.close)
(o_tty->ldisc.close)(o_tty);
o_tty->ldisc = ldiscs[N_TTY];
#if 0 /* No way! We just released the termios struct! */
o_tty->termios->c_line = N_TTY;
#endif
}
tty->driver.table[idx] = NULL;
......@@ -1659,7 +1661,7 @@ int tty_unregister_driver(struct tty_driver *driver)
int retval;
struct tty_driver *p;
int found = 0;
int major_inuse = 0;
char *othername = NULL;
if (*driver->refcount)
return -EBUSY;
......@@ -1668,14 +1670,15 @@ int tty_unregister_driver(struct tty_driver *driver)
if (p == driver)
found++;
else if (p->major == driver->major)
major_inuse++;
othername = p->name;
}
if (!major_inuse) {
if (othername == NULL) {
retval = unregister_chrdev(driver->major, driver->name);
if (retval)
return retval;
}
} else
register_chrdev(driver->major, othername, &tty_fops);
if (driver->prev)
driver->prev->next = driver->next;
......
......@@ -45,6 +45,7 @@ bad_clone_list[] = {
{"DE100", "DE200", {0x00, 0xDE, 0x01,}},
{"DE120", "DE220", {0x00, 0x80, 0xc8,}},
{"DFI1000", "DFI2000", {'D', 'F', 'I',}}, /* Original, eh? */
{"EtherNext UTP8", "EtherNext UTP16", {0x00, 0x00, 0x79}},
{0,}
};
......
......@@ -9,6 +9,13 @@ struct cyclades_chip {
int filler;
};
struct cyclades_monitor {
unsigned long int_count;
unsigned long char_count;
unsigned long char_max;
unsigned long char_last;
};
/*
* This is our internal structure for each serial port's state.
*
......@@ -45,14 +52,28 @@ struct cyclades_port {
int xmit_head;
int xmit_tail;
int xmit_cnt;
int default_threshold;
int default_timeout;
struct tq_struct tqueue;
struct termios normal_termios;
struct termios callout_termios;
struct wait_queue *open_wait;
struct wait_queue *close_wait;
struct cyclades_monitor mon;
};
#define CYCLADES_MAGIC 0x4359
#define CYGETMON 0x435901
#define CYGETTHRESH 0x435902
#define CYSETTHRESH 0x435903
#define CYGETDEFTHRESH 0x435904
#define CYSETDEFTHRESH 0x435905
#define CYGETTIMEOUT 0x435906
#define CYSETTIMEOUT 0x435907
#define CYGETDEFTIMEOUT 0x435908
#define CYSETDEFTIMEOUT 0x435909
/*
* Events are used to schedule things to happen at timer-interrupt
* time, instead of at cy interrupt time.
......
......@@ -227,6 +227,14 @@ typedef struct {
#define ELFCLASS64 2
#define ELFCLASSNUM 3
#define ELFDATANONE 0 /* e_ident[EI_DATA] */
#define ELFDATA2LSB 1
#define ELFDATA2MSB 2
#define EV_NONE 0 /* e_version, EI_VERSION */
#define EV_CURRENT 1
#define EV_NUM 2
#define ELF_START_MMAP 0x80000000
#endif /* _LINUX_ELF_H */
......@@ -80,7 +80,7 @@ struct ip_fw
* (ports[0] <= port <= ports[1]) *
* */
#define IP_FW_F_PRN 0x020 /* In verbose mode print this firewall*/
#define IP_FW_F_BIDIR 0x040 /* For accounting-count two way */
#define IP_FW_F_BIDIR 0x040 /* For bidirectional firewalls */
#define IP_FW_F_TCPSYN 0x080 /* For tcp packets-check SYN only */
#define IP_FW_F_ICMPRPL 0x100 /* Send back icmp unreachable packet */
#define IP_FW_F_MASK 0x1FF /* All possible flag bits mask */
......@@ -111,6 +111,15 @@ struct ip_fw
#define IP_ACCT_FLUSH (IP_FW_BASE_CTL+18)
#define IP_ACCT_ZERO (IP_FW_BASE_CTL+19)
struct ip_fwpkt
{
struct iphdr fwp_iph; /* IP header */
union {
struct tcphdr fwp_tcph; /* TCP header or */
struct udphdr fwp_udph; /* UDP header */
} fwp_protoh;
struct in_addr fwp_via; /* interface address */
};
/*
* Main firewall chains definitions and global var's definitions.
......@@ -129,10 +138,10 @@ extern int ip_fw_ctl(int, void *, int);
#endif
#ifdef CONFIG_IP_ACCT
extern struct ip_fw *ip_acct_chain;
extern int ip_acct_cnt(struct iphdr *, struct device *, struct ip_fw *);
extern void ip_acct_cnt(struct iphdr *, struct device *, struct ip_fw *);
extern int ip_acct_ctl(int, void *, int);
#endif
extern int ip_fw_chk(struct iphdr *, struct device *rif,struct ip_fw *, int);
extern int ip_fw_chk(struct iphdr *, struct device *rif,struct ip_fw *, int, int);
#endif /* KERNEL */
#endif /* _IP_FW_H */
......@@ -120,9 +120,8 @@
#define DBG_AUD 25 /* "read audio" debugging */
#define DBG_SEQ 26 /* Sequoia interface configuration trace */
#define DBG_LCS 27 /* Longshine LCS-7260 debugging trace */
#define DBG_TEA 28 /* TEAC CD-55A debugging trace */
#define DBG_CD2 29 /* MKE CD200 debugging trace */
#define DBG_000 30 /* unnecessary information */
#define DBG_CD2 28 /* MKE CD200 debugging trace */
#define DBG_000 29 /* unnecessary information */
/*==========================================================================*/
/*==========================================================================*/
......@@ -254,13 +253,11 @@
#define drv_099 (drv_fam1+0x01) /* <100 */
#define drv_100 (drv_fam1+0x02) /* >=100 */
#define drv_famT 0x40 /* TEAC CD-55A */
#define drv_fam2 0x80 /* CD200 family */
#define fam0_drive (DriveStruct[d].drv_type&drv_fam0)
#define famL_drive (DriveStruct[d].drv_type&drv_famL)
#define fam1_drive (DriveStruct[d].drv_type&drv_fam1)
#define famT_drive (DriveStruct[d].drv_type&drv_famT)
#define fam2_drive (DriveStruct[d].drv_type&drv_fam2)
#define fam0L_drive (DriveStruct[d].drv_type&(drv_fam0|drv_famL))
#define fam1L_drive (DriveStruct[d].drv_type&(drv_fam1|drv_famL))
......@@ -522,19 +519,15 @@ Read XA Parameter:
* CR-56x: CMD1_
* CD200: CMD2_
* LCS-7260: CMDL_
* TEAC CD-55A: CMDT_
*/
#define CMD1_RESET 0x0a
#define CMD2_RESET 0x01
#define CMDT_RESET 0xc0
#define CMD1_LOCK_CTL 0x0c
#define CMD2_LOCK_CTL 0x1e
#define CMDL_LOCK_CTL 0x0e
#define CMDT_LOCK_CTL 0x1e
#define CMD1_TRAY_CTL 0x07
#define CMD2_TRAY_CTL 0x1b
#define CMDL_TRAY_CTL 0x0d
#define CMDT_TRAY_CTL 0x1b
#define CMD1_MULTISESS 0x8d
#define CMDL_MULTISESS 0x8c
#define CMD1_SUBCHANINF 0x11
......@@ -542,7 +535,6 @@ Read XA Parameter:
#define CMD2_x02 0x02
#define CMD1_x08 0x08
#define CMD2_x08 0x08
#define CMDT_x08 0x08
#define CMD2_SETSPEED 0xda
#define CMD0_PATH_CHECK 0x00
......@@ -553,12 +545,10 @@ Read XA Parameter:
#define CMD1_SEEK 0x01
#define CMD2_SEEK 0x2b
#define CMDL_SEEK 0x01
#define CMDT_SEEK 0x2b
#define CMD0_READ 0x02
#define CMD1_READ 0x10
#define CMD2_READ 0x28
#define CMDL_READ 0x02
#define CMDT_READ 0x28
#define CMD0_READ_XA 0x03
#define CMD2_READ_XA 0xd4
#define CMDL_READ_XA 0x03 /* really ?? */
......@@ -585,33 +575,27 @@ Read XA Parameter:
#define CMD1_PLAY_MSF 0x0e
#define CMD2_PLAY_MSF 0x47
#define CMDL_PLAY_MSF 0x
#define CMDT_PLAY_MSF 0x47
#define CMD0_PLAY_TI 0x0c
#define CMD0_STATUS 0x81
#define CMD1_STATUS 0x05
#define CMD2_STATUS 0x00
#define CMDL_STATUS 0x81
#define CMDT_STATUS 0x00
#define CMD0_READ_ERR 0x82
#define CMD1_READ_ERR 0x82
#define CMD2_READ_ERR 0x03
#define CMDL_READ_ERR 0x82
#define CMDT_READ_ERR 0x03 /* get audio status */
#define CMD0_READ_VER 0x83
#define CMD1_READ_VER 0x83
#define CMD2_READ_VER 0x12
#define CMDT_READ_VER 0x12 /* ??? (unused) */
#define CMDL_READ_VER 0x83
#define CMD0_SETMODE 0x84
#define CMD1_SETMODE 0x09
#define CMD2_SETMODE 0x55
#define CMDL_SETMODE 0x84
#define CMDT_SETMODE 0x55
#define CMD0_GETMODE 0x85
#define CMD1_GETMODE 0x84
#define CMD2_GETMODE 0x5a
#define CMDL_GETMODE 0x85
#define CMDT_GETMODE 0x5a
#define CMD0_SET_XA 0x86
#define CMD0_GET_XA 0x87
#define CMD0_CAPACITY 0x88
......@@ -622,13 +606,11 @@ Read XA Parameter:
#define CMD1_READSUBQ 0x87
#define CMD2_READSUBQ 0x42
#define CMDL_READSUBQ 0x89
#define CMDT_READSUBQ 0x42
#define CMD0_DISKCODE 0x8a
#define CMD0_DISKINFO 0x8b
#define CMD1_DISKINFO 0x8b
#define CMD2_DISKINFO 0x43
#define CMDL_DISKINFO 0x8b
#define CMDT_DISKINFO 0x43
#define CMD0_READTOC 0x8c
#define CMD1_READTOC 0x8c
#define CMD2_READTOC 0x
......@@ -637,7 +619,6 @@ Read XA Parameter:
#define CMD1_PAU_RES 0x0d
#define CMD2_PAU_RES 0x4b
#define CMDL_PAU_RES 0x8d
#define CMDT_PAU_RES 0x4b
#define CMD0_PACKET 0x8e
#define CMD1_PACKET 0x8e
#define CMD2_PACKET 0x
......
Changes for NET3.017
Upgrade Notes from 1.0
[Alan Cox - Alan.Cox@linux.org]
This is mostly small stuff as follows:
Upgrading to 1.2.0 from a 1.0 kernel networking set. If you are using
a complete 1.2 distribution you can ignore this.
o accept()ed socket don't end up with an invalid sk->socket and give bogus
netstat output.
o FASYNC/SIGIO now works with sockets.
o Fixed the permissions on F_SETOWN for all. Its now as broken/working
as other systems. Really we need something like a 32bit generation
number on processes.
o ARP allows proxy for whole networks (a la cisco routers)
o TCP sendto() reports ENOTCONN in the right cases
o Removed some surplus uncommented code from tcp.c
o Fixed protocol violation during closedown in tcp.c
[Still not got the window < MSS bug fix included]
This doesn't attempt to list the changes. That would be too large. Instead
just what you need and can change
Fixes for 1.1.58
arp,ifconfig, etc. Get net-tools-1.1.95 (or 1.2.0 if its out) from
ftp.linux.org.uk:/pub/Linux/Networking/PROGRAMS/NetTools, and install
these. You will also acquire a couple of new tools "plipconfig" for tuning
plip links and "ipfw" for ip firewall management.
o non blocking connect fail gets the error code right.
o select() not reporting read ok after an urgent read fixed.
bootpd: The original bootpd has a bug that the 1.2 kernel spots. You will
need to upgrade this to the version in
ftp.linux.org.uk:/pub/Linux/Networking/PROGRAMS/Upgrades
Standard programs that you ought to update are
named 4.7.x to 4.9.x Stops named dying occasionally
pop3d 1.001 to 1.004 Fixes a bug that can lose mail
A complete current networking set for Linux can be obtained by getting
the NetKit[A,B...] series archives from ftp.funet.fi. Funet also carries
binaries for Linux mbone applications if you now wish to make use of
these facilities.
For commercial UK custom Linux networking projects, drivers and development
(but not free support!) I can be contacted via
I^2IT Ltd, The Innovation Centre, University Of Wales
Swansea SA2 8PP.
Fax: +44 1792 295811
Tel: +44 1792 295213
Please don't send commercial queries to my email address as I have that
in an academic and _not_ commercial capacity. On the other hand feel
free to send bug reports, queries and enhancements that way.
Alan
......@@ -130,9 +130,15 @@ struct arp_table
#define ARP_CHECK_INTERVAL (60 * HZ)
enum proxy {
PROXY_EXACT=0,
PROXY_ANY,
PROXY_NONE,
};
/* Forward declarations. */
static void arp_check_expire (unsigned long);
static struct arp_table *arp_lookup(unsigned long paddr, int exact);
static struct arp_table *arp_lookup(unsigned long paddr, enum proxy proxy);
static struct timer_list arp_timer =
......@@ -497,6 +503,7 @@ void arp_destroy(unsigned long ip_addr, int force)
struct arp_table **pentry;
unsigned long hash = HASH(ip_addr);
ugly:
cli();
pentry = &arp_tables[hash];
if (! *pentry) /* also check proxy entries */
......@@ -512,7 +519,12 @@ void arp_destroy(unsigned long ip_addr, int force)
del_timer(&entry->timer);
sti();
arp_release_entry(entry);
return;
/* this would have to be cleaned up */
goto ugly;
/* perhaps like this ?
cli();
entry = *pentry;
*/
}
pentry = &entry->next;
if (!checked_proxies && ! *pentry)
......@@ -842,7 +854,7 @@ int arp_find(unsigned char *haddr, unsigned long paddr, struct device *dev,
/*
* Find an entry
*/
entry = arp_lookup(paddr, 1);
entry = arp_lookup(paddr, PROXY_NONE);
if (entry != NULL) /* It exists */
{
......@@ -1006,11 +1018,11 @@ int arp_get_info(char *buffer, char **start, off_t offset, int length)
/*
* This will find an entry in the ARP table by looking at the IP address.
* If exact is true then only exact IP matches will be allowed
* If proxy is PROXY_EXACT then only exact IP matches will be allowed
* for proxy entries, otherwise the netmask will be used
*/
static struct arp_table *arp_lookup(unsigned long paddr, int exact)
static struct arp_table *arp_lookup(unsigned long paddr, enum proxy proxy)
{
struct arp_table *entry;
unsigned long hash = HASH(paddr);
......@@ -1019,9 +1031,10 @@ static struct arp_table *arp_lookup(unsigned long paddr, int exact)
if (entry->ip == paddr) break;
/* it's possibly a proxy entry (with a netmask) */
if (!entry)
if (!entry && proxy != PROXY_NONE)
for (entry=arp_tables[PROXY_HASH]; entry != NULL; entry = entry->next)
if (exact? (entry->ip==paddr) : !((entry->ip^paddr)&entry->mask))
if ((proxy==PROXY_EXACT) ? (entry->ip==paddr)
: !((entry->ip^paddr)&entry->mask))
break;
return entry;
......@@ -1099,7 +1112,7 @@ static int arp_req_set(struct arpreq *req)
/*
* Find the entry
*/
entry = arp_lookup(ip, 1);
entry = arp_lookup(ip, PROXY_EXACT);
if (entry && (entry->flags & ATF_PUBL) != (r.arp_flags & ATF_PUBL))
{
sti();
......@@ -1179,7 +1192,7 @@ static int arp_req_get(struct arpreq *req)
si = (struct sockaddr_in *) &r.arp_pa;
cli();
entry = arp_lookup(si->sin_addr.s_addr,0);
entry = arp_lookup(si->sin_addr.s_addr,PROXY_ANY);
if (entry == NULL)
{
......
......@@ -109,6 +109,7 @@
#include "protocol.h"
#include "route.h"
#include "tcp.h"
#include "udp.h"
#include <linux/skbuff.h>
#include "sock.h"
#include "arp.h"
......@@ -1270,7 +1271,7 @@ static void ip_forward(struct sk_buff *skb, struct device *dev, int is_frag)
#ifdef CONFIG_IP_FIREWALL
int err;
if((err=ip_fw_chk(skb->h.iph, dev, ip_fw_fwd_chain, ip_fw_fwd_policy))!=1)
if((err=ip_fw_chk(skb->h.iph, dev, ip_fw_fwd_chain, ip_fw_fwd_policy, 0))!=1)
{
if(err==-1)
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_UNREACH, 0, dev);
......@@ -1500,7 +1501,7 @@ int ip_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt)
#ifdef CONFIG_IP_FIREWALL
if ((err=ip_fw_chk(iph,dev,ip_fw_blk_chain,ip_fw_blk_policy))!=1)
if ((err=ip_fw_chk(iph,dev,ip_fw_blk_chain,ip_fw_blk_policy, 0))!=1)
{
if(err==-1)
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0, dev);
......@@ -1817,6 +1818,12 @@ void ip_queue_xmit(struct sock *sk, struct device *dev,
skb->ip_hdr = iph;
iph->tot_len = ntohs(skb->len-dev->hard_header_len);
#ifdef CONFIG_IP_FIREWALL
if(ip_fw_chk(iph, dev, ip_fw_blk_chain, ip_fw_blk_policy, 0) != 1)
/* just don't send this packet */
return;
#endif
/*
* No reassigning numbers to fragments...
*/
......
This diff is collapsed.
......@@ -465,6 +465,7 @@ ipxitf_send(ipx_interface *intrfc, struct sk_buff *skb, char *node)
struct datalink_proto *dl = intrfc->if_dlink;
char dest_node[IPX_NODE_LEN];
int send_to_wire = 1;
int addr_len;
/* We need to know how many skbuffs it will take to send out this
* packet to avoid unnecessary copies.
......@@ -501,8 +502,13 @@ ipxitf_send(ipx_interface *intrfc, struct sk_buff *skb, char *node)
return 0;
}
/* In some case, ipxitf_adjust_skbuff can overwrite node */
memcpy(dest_node, node, IPX_NODE_LEN);
/* determine the appropriate hardware address */
addr_len = dev->addr_len;
if (memcmp(ipx_broadcast_node, node, IPX_NODE_LEN) == 0) {
memcpy(dest_node, dev->broadcast, addr_len);
} else {
memcpy(dest_node, &(node[IPX_NODE_LEN-addr_len]), addr_len);
}
/* make any compensation for differing physical/data link size */
skb = ipxitf_adjust_skbuff(intrfc, skb);
......@@ -699,9 +705,6 @@ ipxitf_create(ipx_interface_definition *idef)
if(dev->addr_len>IPX_NODE_LEN)
return -EINVAL;
if(dev->addr_len<2)
return -EINVAL;
if ((intrfc = ipxitf_find_using_phys(dev, dlink_type)) == NULL) {
/* Ok now create */
......@@ -782,8 +785,6 @@ ipxitf_auto_create(struct device *dev, unsigned short dlink_type)
/* Check addresses are suitable */
if(dev->addr_len>IPX_NODE_LEN) return NULL;
if(dev->addr_len<2) return NULL;
intrfc=(ipx_interface *)kmalloc(sizeof(ipx_interface),GFP_ATOMIC);
if (intrfc!=NULL) {
intrfc->if_dev=dev;
......
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