diff -u --recursive --new-file v1.1.69/linux/Makefile linux/Makefile --- v1.1.69/linux/Makefile Thu Dec 1 19:15:03 1994 +++ linux/Makefile Fri Dec 2 11:24:53 1994 @@ -1,6 +1,6 @@ VERSION = 1 PATCHLEVEL = 1 -SUBLEVEL = 69 +SUBLEVEL = 70 ARCH = i386 diff -u --recursive --new-file v1.1.69/linux/arch/i386/Makefile linux/arch/i386/Makefile --- v1.1.69/linux/arch/i386/Makefile Tue Nov 15 15:35:38 1994 +++ linux/arch/i386/Makefile Fri Dec 2 11:21:50 1994 @@ -22,7 +22,11 @@ ifdef CONFIG_M486 CFLAGS := $(CFLAGS) -m486 else +ifdef CONFIG_M586 +CFLAGS := $(CFLAGS) -mpentium +else CFLAGS := $(CFLAGS) -m386 +endif endif zBoot/zSystem: zBoot/*.c zBoot/*.S tools/zSystem diff -u --recursive --new-file v1.1.69/linux/arch/i386/config.in linux/arch/i386/config.in --- v1.1.69/linux/arch/i386/config.in Thu Dec 1 19:15:03 1994 +++ linux/arch/i386/config.in Fri Dec 2 11:50:02 1994 @@ -11,9 +11,20 @@ bool 'XT harddisk support' CONFIG_BLK_DEV_XD n bool 'Networking support' CONFIG_NET y bool 'Limit memory to low 16MB' CONFIG_MAX_16M n +bool 'PCI bios support' CONFIG_PCI n bool 'System V IPC' CONFIG_SYSVIPC y bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF y +#bool 'Use -mpentium flag for Pentium-specific optimizations' CONFIG_M586 n +#if [ "$CONFIG_M586" = "n" ]; then bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y +#fi + +comment 'Screen saver mode' + +bool 'VESA Power Saving Protocol Support' CONFIG_VESA_PSPM n +if [ "$CONFIG_VESA_PSPM" = "y" ]; then +bool 'VESA PSPM Force Off' CONFIG_PSPM_FORCE_OFF n +fi if [ "$CONFIG_NET" = "y" ]; then comment 'Networking options' @@ -60,7 +71,9 @@ bool 'UltraStor 14F/34F support' CONFIG_SCSI_U14_34F n bool 'Future Domain 16xx SCSI support' CONFIG_SCSI_FUTURE_DOMAIN n bool 'Generic NCR5380 SCSI support' CONFIG_SCSI_GENERIC_NCR5380 n -bool 'NCR53c7,8xx SCSI support' CONFIG_SCSI_NCR53C7xx n +if [ "$CONFIG_PCI" = "y" ]; then + bool 'NCR53c7,8xx SCSI support' CONFIG_SCSI_NCR53C7xx n +fi bool 'Always IN2000 SCSI support (test release)' CONFIG_SCSI_IN2000 n bool 'PAS16 SCSI support' CONFIG_SCSI_PAS16 n bool 'QLOGIC SCSI support' CONFIG_SCSI_QLOGIC n diff -u --recursive --new-file v1.1.69/linux/drivers/char/console.c linux/drivers/char/console.c --- v1.1.69/linux/drivers/char/console.c Tue Nov 29 18:51:24 1994 +++ linux/drivers/char/console.c Fri Dec 2 11:21:50 1994 @@ -160,7 +160,9 @@ static int console_blanked = 0; static int blankinterval = 10*60*HZ; +#ifndef CONFIG_VESA_PSPM static long blank_origin, blank__origin, unblank_origin; +#endif struct vc_data { unsigned long vc_screenbuf_size; @@ -288,6 +290,159 @@ #define vcmode (vt_cons[currcons]->vc_mode) #define structsize (sizeof(struct vc_data) + sizeof(struct vt_struct)) +#ifdef CONFIG_VESA_PSPM +/* + * This section(s) handles the VESA Power Saving Protocol that let a * + * monitor be powered down whenever not needed for a longer time. * + * VESA protocol defines: * + * * + * Mode/Status HSync VSync Video * + * ---------------------------------------------- * + * "On" on on active * + * "Suspend" {either} on off blank * + * { or } off on blank * + * "Off" off off blank << PSPM_FORCE_OFF * + * * + * Original code taken from the Power Management Utility (PMU) of * + * Huang shi chao, delivered together with many new monitor models * + * capable of the VESA Power Saving Protocol. * + * Adapted to Linux by Christoph Rimek (chrimek@toppoint.de) 15-may-94 * + * Re-Adapted by Nicholas Leon (nicholas@neko.binary9.com) 10/94 * + * (with minor reorganization/changes) * + */ + + +static void vesa_blank(void); +static void vesa_unblank(void); + +#define seq_port_reg (0x3c4) /* Sequencer register select port */ +#define seq_port_val (0x3c5) /* Sequencer register value port */ +#define video_misc_rd (0x3cc) /* Video misc. read port */ +#define video_misc_wr (0x3c2) /* Video misc. write port */ + +/* structure holding original VGA register settings */ +static struct { + unsigned char SeqCtrlIndex; /* Sequencer Index reg. */ + unsigned char CrtCtrlIndex; /* CRT-Contr. Index reg. */ + unsigned char CrtMiscIO; /* Miscellaneous register */ +#ifdef CONFIG_PSPM_FORCE_OFF + unsigned char HorizontalTotal; /* CRT-Controller:00h */ + unsigned char HorizDisplayEnd; /* CRT-Controller:01h */ + unsigned char StartHorizRetrace; /* CRT-Controller:04h */ + unsigned char EndHorizRetrace; /* CRT-Controller:05h */ +#endif + unsigned char Overflow; /* CRT-Controller:07h */ + unsigned char StartVertRetrace; /* CRT-Controller:10h */ + unsigned char EndVertRetrace; /* CRT-Controller:11h */ + unsigned char ModeControl; /* CRT-Controller:17h */ + unsigned char ClockingMode; /* Seq-Controller:01h */ +} vga; + +/* routine to blank a vesa screen */ +static void vesa_blank(void) +{ + /* save original values of VGA controller registers */ + cli(); + vga.SeqCtrlIndex = inb_p(seq_port_reg); + vga.CrtCtrlIndex = inb_p(video_port_reg); + vga.CrtMiscIO = inb_p(video_misc_rd); + sti(); +#ifdef CONFIG_PSPM_FORCE_OFF + outb_p(0x00,video_port_reg); /* HorizontalTotal */ + vga.HorizontalTotal = inb_p(video_port_val); + outb_p(0x01,video_port_reg); /* HorizDisplayEnd */ + vga.HorizDisplayEnd = inb_p(video_port_val); + outb_p(0x04,video_port_reg); /* StartHorizRetrace */ + vga.StartHorizRetrace = inb_p(video_port_val); + outb_p(0x05,video_port_reg); /* EndHorizRetrace */ + vga.EndHorizRetrace = inb_p(video_port_val); +#endif + outb_p(0x07,video_port_reg); /* Overflow */ + vga.Overflow = inb_p(video_port_val); + outb_p(0x10,video_port_reg); /* StartVertRetrace */ + vga.StartVertRetrace = inb_p(video_port_val); + outb_p(0x11,video_port_reg); /* EndVertRetrace */ + vga.EndVertRetrace = inb_p(video_port_val); + outb_p(0x17,video_port_reg); /* ModeControl */ + vga.ModeControl = inb_p(video_port_val); + outb_p(0x01,seq_port_reg); /* ClockingMode */ + vga.ClockingMode = inb_p(seq_port_val); + + /* assure that video is enabled */ + /* "0x20" is VIDEO_ENABLE_bit in register 01 of sequencer */ + cli(); + outb_p(0x01,seq_port_reg); + outb_p(vga.ClockingMode | 0x20,seq_port_val); + +/* sti(); + cli(); */ + + /* test for vertical retrace in process.... */ + if ((vga.CrtMiscIO & 0x80) == 0x80) + outb_p(vga.CrtMiscIO & 0xef,video_misc_wr); + + /* Set to minimum (0) and * + * to maximum (incl. overflow) * + * Result: turn off vertical sync (VSync) pulse */ + outb_p(0x10,video_port_reg); /* StartVertRetrace */ + outb_p(0xff,video_port_val); /* maximum value */ + outb_p(0x11,video_port_reg); /* EndVertRetrace */ + outb_p(0x40,video_port_val); /* minimum (bits 0..3) */ + outb_p(0x07,video_port_reg); /* Overflow */ + outb_p(vga.Overflow | 0x84,video_port_val); /* bits 9,10 of */ + /* vert. retrace */ +#ifdef CONFIG_PSPM_FORCE_OFF + /* Set to minimum (0) and * + * to maximum * + * Result: turn off horizontal sync (HSync) pulse */ + outb_p(0x04,video_port_reg); /* StartHorizRetrace */ + outb_p(0xff,video_port_val); /* maximum */ + outb_p(0x05,video_port_reg); /* EndHorizRetrace */ + outb_p(0x00,video_port_val); /* minimum (0) */ +#endif + /* restore both index registers */ + outb_p(vga.SeqCtrlIndex,seq_port_reg); + outb_p(vga.CrtCtrlIndex,video_port_reg); + sti(); + +} + +/* routine to unblank a vesa screen */ +static void vesa_unblank(void) +{ + /* restore original values of VGA controller registers */ + cli(); + outb_p(vga.CrtMiscIO,video_misc_wr); +#ifdef CONFIG_PSPM_FORCE_OFF + outb_p(0x00,video_port_reg); /* HorizontalTotal */ + outb_p(vga.HorizontalTotal,video_port_val); + outb_p(0x01,video_port_reg); /* HorizDisplayEnd */ + outb_p(vga.HorizDisplayEnd,video_port_val); + outb_p(0x04,video_port_reg); /* StartHorizRetrace */ + outb_p(vga.StartHorizRetrace,video_port_val); + outb_p(0x05,video_port_reg); /* EndHorizRetrace */ + outb_p(vga.EndHorizRetrace,video_port_val); +#endif + outb_p(0x07,video_port_reg); /* Overflow */ + outb_p(vga.Overflow,video_port_val); + outb_p(0x10,video_port_reg); /* StartVertRetrace */ + outb_p(vga.StartVertRetrace,video_port_val); + outb_p(0x11,video_port_reg); /* EndVertRetrace */ + outb_p(vga.EndVertRetrace,video_port_val); + outb_p(0x17,video_port_reg); /* ModeControl */ + outb_p(vga.ModeControl,video_port_val); + outb_p(0x01,seq_port_reg); /* ClockingMode */ + outb_p(vga.ClockingMode,seq_port_val); + + /* restore index/control registers */ + outb_p(vga.SeqCtrlIndex,seq_port_reg); + outb_p(vga.CrtCtrlIndex,video_port_reg); + sti(); +} + +#endif /* CONFIG_VESA_PSPM */ + + static void * memsetw(void * s, unsigned short c, unsigned int count) { __asm__("cld\n\t" @@ -2032,7 +2187,9 @@ void blank_screen(void) { +#ifndef CONFIG_VESA_PSPM int currcons; +#endif if (console_blanked) return; @@ -2043,6 +2200,9 @@ } timer_table[BLANK_TIMER].fn = unblank_screen; +#ifdef CONFIG_VESA_PSPM + vesa_blank(); +#else /* try not to lose information by blanking, and not to waste memory */ currcons = fg_console; has_scrolled = 0; @@ -2053,14 +2213,17 @@ unblank_origin = origin; memsetw((void *)blank_origin, BLANK, video_mem_term-blank_origin); hide_cursor(); +#endif console_blanked = fg_console + 1; } void unblank_screen(void) { int currcons; +#ifndef CONFIG_VESA_PSPM int resetorg; long offset; +#endif if (!console_blanked) return; @@ -2075,6 +2238,10 @@ timer_active |= 1<request.dev = -1; /* Mark as not busy */ (STp->buffer)->in_use = 0; STp->buffer = NULL; - STp->density = 0; /* Clear the errorneus "residue" */ + STp->density = 0; /* Clear the erroneous "residue" */ STp->write_prot = 0; STp->block_size = 0; STp->eof = ST_NOEOF; diff -u --recursive --new-file v1.1.69/linux/fs/proc/net.c linux/fs/proc/net.c --- v1.1.69/linux/fs/proc/net.c Thu Aug 11 11:14:05 1994 +++ linux/fs/proc/net.c Fri Dec 2 13:05:09 1994 @@ -50,6 +50,10 @@ extern int dev_get_info(char *, char **, off_t, int); extern int rt_get_info(char *, char **, off_t, int); extern int snmp_get_info(char *, char **, off_t, int); +extern int ip_acct_procinfo(char *, char **, off_t, int); +extern int ip_fw_blk_procinfo(char *, char **, off_t, int); +extern int ip_fw_fwd_procinfo(char *, char **, off_t, int); +extern int ip_mc_procinfo(char *, char **, off_t, int); #endif /* CONFIG_INET */ #ifdef CONFIG_IPX extern int ipx_get_info(char *, char **, off_t, int); @@ -115,6 +119,16 @@ #ifdef CONFIG_INET_RARP { PROC_NET_RARP, 4, "rarp"}, #endif +#ifdef CONFIG_IP_MULTICAST + { PROC_NET_IGMP, 4, "igmp"}, +#endif +#ifdef CONFIG_IP_FIREWALL + { PROC_NET_IPFWFWD, 10, "ip_forward"}, + { PROC_NET_IPBLFWD, 8, "ip_block"}, +#endif +#ifdef CONFIG_IP_ACCT + { PROC_NET_IPACCT, 7, "ip_acct"}, +#endif #endif /* CONFIG_INET */ #ifdef CONFIG_IPX { PROC_NET_IPX_ROUTE, 9, "ipx_route" }, @@ -237,6 +251,24 @@ case PROC_NET_SNMP: length = snmp_get_info(page, &start, file->f_pos,thistime); break; +#ifdef CONFIG_IP_MULTICAST + case PROC_NET_IGMP: + length = ip_mc_procinfo(page, &start, file->f_pos,thistime); + break; +#endif +#ifdef CONFIG_IP_FIREWALL + case PROC_NET_IPFWFWD: + length = ip_fw_fwd_procinfo(page, &start, file->f_pos,thistime); + break; + case PROC_NET_IPBLFWD: + length = ip_fw_blk_procinfo(page, &start, file->f_pos,thistime); + break; +#endif +#ifdef CONFIG_IP_ACCT + case PROC_NET_IPACCT: + length = ip_acct_procinfo(page, &start, file->f_pos,thistime); + break; +#endif #ifdef CONFIG_INET_RARP case PROC_NET_RARP: length = rarp_get_info(page,&start,file->f_pos,thistime); diff -u --recursive --new-file v1.1.69/linux/include/asm-alpha/types.h linux/include/asm-alpha/types.h --- v1.1.69/linux/include/asm-alpha/types.h Mon Nov 28 14:21:46 1994 +++ linux/include/asm-alpha/types.h Fri Dec 2 11:05:12 1994 @@ -2,6 +2,35 @@ #define _ALPHA_TYPES_H /* + * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the + * header files exported to user space + */ + +typedef signed char __s8; +typedef unsigned char __u8; + +typedef signed short __s16; +typedef unsigned short __u16; + +typedef signed int __s32; +typedef unsigned int __u32; + +/* + * There are 32-bit compilers for the alpha out there.. + */ +#if ((~0UL) == 0xffffffff) + +typedef signed long long __s64; +typedef unsigned long long __u64; + +#else + +typedef signed long __s64; +typedef unsigned long __u64; + +#endif + +/* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ diff -u --recursive --new-file v1.1.69/linux/include/asm-i386/types.h linux/include/asm-i386/types.h --- v1.1.69/linux/include/asm-i386/types.h Mon Nov 28 14:21:46 1994 +++ linux/include/asm-i386/types.h Fri Dec 2 11:05:12 1994 @@ -2,6 +2,23 @@ #define _I386_TYPES_H /* + * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the + * header files exported to user space + */ + +typedef signed char __s8; +typedef unsigned char __u8; + +typedef signed short __s16; +typedef unsigned short __u16; + +typedef signed long __s32; +typedef unsigned long __u32; + +typedef signed long long __s64; +typedef unsigned long long __u64; + +/* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ diff -u --recursive --new-file v1.1.69/linux/include/linux/ip.h linux/include/linux/ip.h --- v1.1.69/linux/include/linux/ip.h Tue Nov 29 18:51:28 1994 +++ linux/include/linux/ip.h Fri Dec 2 11:06:19 1994 @@ -29,24 +29,24 @@ struct timestamp { - u8 len; - u8 ptr; + __u8 len; + __u8 ptr; union { #if defined(__i386__) - u8 flags:4, + __u8 flags:4, overflow:4; #elif defined(__mc68000__) - u8 overflow:4, + __u8 overflow:4, flags:4; #elif defined(__alpha__) - u8 flags:4, + __u8 flags:4, overflow:4; #else #error "Adjust this structure to match your CPU" #endif - u8 full_char; + __u8 full_char; } x; - u32 data[9]; + __u32 data[9]; }; @@ -74,26 +74,26 @@ struct iphdr { #if defined(__i386__) - u8 ihl:4, + __u8 ihl:4, version:4; #elif defined (__mc68000__) - u8 version:4, + __u8 version:4, ihl:4; #elif defined (__alpha__) - u8 ihl:4, + __u8 ihl:4, version:4; #else #error "Adjust this structure to match your CPU" #endif - u8 tos; - u16 tot_len; - u16 id; - u16 frag_off; - u8 ttl; - u8 protocol; - u16 check; - u32 saddr; - u32 daddr; + __u8 tos; + __u16 tot_len; + __u16 id; + __u16 frag_off; + __u8 ttl; + __u8 protocol; + __u16 check; + __u32 saddr; + __u32 daddr; /*The options start here. */ }; diff -u --recursive --new-file v1.1.69/linux/include/linux/proc_fs.h linux/include/linux/proc_fs.h --- v1.1.69/linux/include/linux/proc_fs.h Tue Aug 23 09:49:08 1994 +++ linux/include/linux/proc_fs.h Fri Dec 2 12:45:16 1994 @@ -58,6 +58,16 @@ #ifdef CONFIG_INET_RARP PROC_NET_RARP, #endif +#ifdef CONFIG_IP_MULTICAST + PROC_NET_IGMP, +#endif +#ifdef CONFIG_IP_FIREWALL + PROC_NET_IPFWFWD, + PROC_NET_IPBLFWD, +#endif +#ifdef CONFIG_IP_ACCT + PROC_NET_IPACCT, +#endif #endif #ifdef CONFIG_IPX PROC_NET_IPX_ROUTE, diff -u --recursive --new-file v1.1.69/linux/include/linux/tcp.h linux/include/linux/tcp.h --- v1.1.69/linux/include/linux/tcp.h Tue Nov 29 18:51:28 1994 +++ linux/include/linux/tcp.h Fri Dec 2 11:07:04 1994 @@ -23,12 +23,12 @@ struct tcphdr { - u16 source; - u16 dest; - u32 seq; - u32 ack_seq; + __u16 source; + __u16 dest; + __u32 seq; + __u32 ack_seq; #if defined(__i386__) - u16 res1:4, + __u16 res1:4, doff:4, fin:1, syn:1, @@ -38,7 +38,7 @@ urg:1, res2:2; #elif defined(__mc68000__) - u16 res2:2, + __u16 res2:2, urg:1, ack:1, psh:1, @@ -48,7 +48,7 @@ doff:4, res1:4; #elif defined(__alpha__) - u16 res1:4, + __u16 res1:4, doff:4, fin:1, syn:1, @@ -60,9 +60,9 @@ #else #error "Adjust this structure for your cpu alignment rules" #endif - u16 window; - u16 check; - u16 urg_ptr; + __u16 window; + __u16 check; + __u16 urg_ptr; }; diff -u --recursive --new-file v1.1.69/linux/kernel/bios32.c linux/kernel/bios32.c --- v1.1.69/linux/kernel/bios32.c Mon Nov 28 14:21:47 1994 +++ linux/kernel/bios32.c Fri Dec 2 11:51:13 1994 @@ -41,16 +41,6 @@ #include -/* - * It would seem some PCI bioses are buggy, so we don't actually use these - * routines unless we need to.. - */ -#ifdef CONFIG_SCSI_NCR53C7xx - #define CONFIG_PCI -#else - #undef CONFIG_PCI -#endif - #define PCIBIOS_PCI_FUNCTION_ID 0xb1XX #define PCIBIOS_PCI_BIOS_PRESENT 0xb101 #define PCIBIOS_FIND_PCI_DEVICE 0xb102 diff -u --recursive --new-file v1.1.69/linux/kernel/ksyms.c linux/kernel/ksyms.c --- v1.1.69/linux/kernel/ksyms.c Thu Dec 1 19:15:05 1994 +++ linux/kernel/ksyms.c Fri Dec 2 11:52:57 1994 @@ -34,12 +34,13 @@ #include #include #endif +#ifdef CONFIG_PCI +#include +#endif #include extern char floppy_track_buffer[]; extern void set_device_ro(int dev,int flag); -#include -#include extern void *sys_call_table; @@ -69,6 +70,18 @@ /* system info variables */ X(EISA_bus), X(wp_works_ok), + +#ifdef CONFIG_PCI + /* PCI BIOS support */ + X(pcibios_find_class), + X(pcibios_find_device), + X(pcibios_read_config_byte), + X(pcibios_read_config_word), + X(pcibios_read_config_dword), + X(pcibios_write_config_byte), + X(pcibios_write_config_word), + X(pcibios_write_config_dword), +#endif /* process memory management */ X(verify_area), diff -u --recursive --new-file v1.1.69/linux/net/inet/af_inet.c linux/net/inet/af_inet.c --- v1.1.69/linux/net/inet/af_inet.c Thu Dec 1 19:15:05 1994 +++ linux/net/inet/af_inet.c Fri Dec 2 14:06:17 1994 @@ -444,8 +444,15 @@ return -EAGAIN; /* We might as well re use these. */ + /* + * note that the backlog is "unsigned char", so truncate it + * somewhere. We might as well truncate it to what everybody + * else does.. + */ + if (backlog > 5) + backlog = 5; sk->max_ack_backlog = backlog; - if (sk->state != TCP_LISTEN) + if (sk->state != TCP_LISTEN) { sk->ack_backlog = 0; sk->state = TCP_LISTEN; @@ -656,6 +663,7 @@ sk->ip_mc_loop=0; sk->ip_mc_ttl=1; *sk->ip_mc_name=0; + sk->ip_mc_list=NULL; #endif sk->state_change = def_callback1; diff -u --recursive --new-file v1.1.69/linux/net/inet/dev.c linux/net/inet/dev.c --- v1.1.69/linux/net/inet/dev.c Thu Dec 1 19:15:05 1994 +++ linux/net/inet/dev.c Fri Dec 2 12:44:45 1994 @@ -1442,6 +1442,8 @@ case SIOCSIFMEM: case SIOCSIFMAP: case SIOCSIFSLAVE: + case SIOCADDMULTI: + case SIOCDELMULTI: if (!suser()) return -EPERM; return dev_ifsioc(arg, cmd); diff -u --recursive --new-file v1.1.69/linux/net/inet/igmp.c linux/net/inet/igmp.c --- v1.1.69/linux/net/inet/igmp.c Thu Dec 1 19:15:06 1994 +++ linux/net/inet/igmp.c Fri Dec 2 11:18:59 1994 @@ -5,7 +5,7 @@ * Alan Cox * * WARNING: - * This is a 'prelimary' implementation... on your own head + * This is a 'preliminary' implementation... on your own head * be it. * * This program is free software; you can redistribute it and/or diff -u --recursive --new-file v1.1.69/linux/net/inet/igmp.h linux/net/inet/igmp.h --- v1.1.69/linux/net/inet/igmp.h Thu Dec 1 19:15:06 1994 +++ linux/net/inet/igmp.h Fri Dec 2 11:18:59 1994 @@ -5,7 +5,7 @@ * Alan Cox * * WARNING: - * This is a 'prelimary' implementation... on your own head + * This is a 'preliminary' implementation... on your own head * be it. * * This program is free software; you can redistribute it and/or diff -u --recursive --new-file v1.1.69/linux/net/inet/ip.c linux/net/inet/ip.c --- v1.1.69/linux/net/inet/ip.c Thu Dec 1 19:15:06 1994 +++ linux/net/inet/ip.c Fri Dec 2 12:10:44 1994 @@ -876,7 +876,7 @@ fp = qp->fragments; while(fp != NULL) { - if(count+fp->len>skb->len) + if(count+fp->len > skb->len) { printk("Invalid fragment list: Fragment over size.\n"); ip_free(qp); @@ -1610,6 +1610,7 @@ skb=ip_defrag(iph,skb,dev); if(skb==NULL) return 0; + skb->dev = dev; iph=skb->h.iph; } diff -u --recursive --new-file v1.1.69/linux/net/inet/ip_fw.c linux/net/inet/ip_fw.c --- v1.1.69/linux/net/inet/ip_fw.c Thu Dec 1 19:15:06 1994 +++ linux/net/inet/ip_fw.c Fri Dec 2 12:45:16 1994 @@ -214,7 +214,7 @@ } /* * At this moment we surely know the protocol of this - * packet and we'll check if it matches,then proceed futher.. + * packet and we'll check if it matches,then proceed further.. */ if (proto==frwl_proto) { @@ -387,7 +387,7 @@ } /* * At this moment we surely know the protocol of this - * packet and we'll check if it matches,then proceed futher.. + * packet and we'll check if it matches,then proceed further.. */ if (proto==frwl_proto) { @@ -628,10 +628,7 @@ if (chtmp_prev) chtmp_prev->next=ftmp; else - { *chainptr=ftmp; - printk("ip_fw: add_to_chain: Can't happen"); - } restore_flags(flags); return(0); } @@ -866,7 +863,7 @@ /* * Here we really working hard-adding new elements - * to blocking/forwarding chains or deleting'em + * to blocking/forwarding chains or deleting 'em */ if ( stage == IP_FW_ADD_BLK || stage == IP_FW_ADD_FWD @@ -905,3 +902,73 @@ return(EINVAL); } #endif /* CONFIG_IP_FIREWALL */ + +#if defined(CONFIG_IP_FIREWALL) || defined(CONFIG_IP_ACCT) + +static int ip_chain_procinfo(struct ip_fw *chain, char *buffer, char **start, off_t offset, int length) +{ + off_t pos=0, begin=0; + struct ip_fw *i; + unsigned long flags; + int len=0; + + + len=sprintf(buffer,"Firewall Rules\n"); + save_flags(flags); + cli(); + + i=chain; + + while(i!=NULL) + { + len+=sprintf(buffer+len,"%08lX/%08lX->%08lX/%08lX %X ", + ntohl(i->src.s_addr),ntohl(i->src_mask.s_addr), + ntohl(i->dst.s_addr),ntohl(i->dst_mask.s_addr), + i->flags); + len+=sprintf(buffer+len,"%u %u %lu %lu ", + i->n_src_p,i->n_dst_p, i->p_cnt,i->b_cnt); + len+=sprintf(buffer+len,"%u %u %u %u %u %u %u %u %u %u\n", + i->ports[0],i->ports[1],i->ports[2],i->ports[3], + i->ports[4],i->ports[5],i->ports[6],i->ports[7], + i->ports[8],i->ports[9]); + pos=begin+len; + if(posoffset+length) + break; + i=i->next; + } + restore_flags(flags); + *start=buffer+(offset-begin); + len-=(offset-begin); + if(len>length) + len=length; + return len; +} +#endif + +#ifdef CONFIG_IP_ACCT + +int ip_acct_procinfo(char *buffer, char **start, off_t offset, int length) +{ + return ip_chain_procinfo(ip_acct_chain, buffer,start,offset,length); +} + +#endif + +#ifdef CONFIG_IP_FIREWALL + +int ip_fw_blk_procinfo(char *buffer, char **start, off_t offset, int length) +{ + return ip_chain_procinfo(ip_fw_blk_chain, buffer,start,offset,length); +} + +int ip_fw_fwd_procinfo(char *buffer, char **start, off_t offset, int length) +{ + return ip_chain_procinfo(ip_fw_fwd_chain, buffer,start,offset,length); +} + +#endif diff -u --recursive --new-file v1.1.69/linux/net/inet/route.c linux/net/inet/route.c --- v1.1.69/linux/net/inet/route.c Sat Nov 26 18:36:07 1994 +++ linux/net/inet/route.c Fri Dec 2 12:44:45 1994 @@ -23,6 +23,7 @@ * Alan Cox : MTU in route table * Alan Cox : MSS actually. Also added the window * clamper. + * Sam Lantinga : Fixed route matching in rt_del() * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -66,7 +67,7 @@ * Remove a routing table entry. */ -static void rt_del(unsigned long dst) +static void rt_del(unsigned long dst, char *devname) { struct rtable *r, **rp; unsigned long flags; @@ -82,7 +83,9 @@ cli(); while((r = *rp) != NULL) { - if (r->rt_dst != dst) + /* Make sure both the destination and the device match */ + if ( r->rt_dst != dst || + (devname != NULL && strcmp((r->rt_dev)->name,devname) != 0) ) { rp = &r->rt_next; continue; @@ -467,9 +470,19 @@ static int rt_kill(struct rtentry *r) { struct sockaddr_in *trg; + char *devname; + int err; trg = (struct sockaddr_in *) &r->rt_dst; - rt_del(trg->sin_addr.s_addr); + if ((devname = r->rt_dev) != NULL) + { + err = getname(devname, &devname); + if (err) + return err; + } + rt_del(trg->sin_addr.s_addr, devname); + if ( devname != NULL ) + putname(devname); return 0; } diff -u --recursive --new-file v1.1.69/linux/net/inet/udp.c linux/net/inet/udp.c --- v1.1.69/linux/net/inet/udp.c Thu Dec 1 19:15:06 1994 +++ linux/net/inet/udp.c Thu Dec 1 18:11:08 1994 @@ -563,9 +563,9 @@ struct sock *sk; struct udphdr *uh; unsigned short ulen; - int addr_type=IS_MYADDR; + int addr_type = IS_MYADDR; - if(skb->dev->pa_addr!=daddr) + if(!dev || dev->pa_addr!=daddr) addr_type=ip_chk_addr(daddr); /* @@ -621,7 +621,7 @@ else skb1=skb; if(skb1) - udp_deliver(sk, uh, skb1,skb->dev,saddr,daddr,len); + udp_deliver(sk, uh, skb1, dev,saddr,daddr,len); sk=sknext; } while(sknext!=NULL); @@ -648,7 +648,7 @@ return(0); } - return udp_deliver(sk,uh,skb,skb->dev, saddr, daddr, len); + return udp_deliver(sk,uh,skb,dev, saddr, daddr, len); } static int udp_deliver(struct sock *sk, struct udphdr *uh, struct sk_buff *skb, struct device *dev, long saddr, long daddr, int len)