From b39cd08347c72483a4521a55301a0fa147a2a2b1 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 5 Feb 2000 12:13:22 +0000 Subject: Import of Linux 2.2.13 subset (ipv4 stack and related) --- pfinet/linux-src/include/linux/apm_bios.h | 1 + pfinet/linux-src/include/linux/capability.h | 4 +- pfinet/linux-src/include/linux/concap.h | 14 ++---- pfinet/linux-src/include/linux/cyclades.h | 65 +++++++++++++++--------- pfinet/linux-src/include/linux/fs.h | 48 +----------------- pfinet/linux-src/include/linux/i2c.h | 1 + pfinet/linux-src/include/linux/isdn.h | 74 +++++++++++++++------------- pfinet/linux-src/include/linux/isdn_ppp.h | 6 +-- pfinet/linux-src/include/linux/isdnif.h | 12 +++-- pfinet/linux-src/include/linux/kernelcapi.h | 28 ++++++----- pfinet/linux-src/include/linux/pagemap.h | 1 + pfinet/linux-src/include/linux/pci.h | 4 ++ pfinet/linux-src/include/linux/poll.h | 12 ++--- pfinet/linux-src/include/linux/posix_types.h | 10 +--- pfinet/linux-src/include/linux/proc_fs.h | 1 + pfinet/linux-src/include/linux/quotaops.h | 3 +- pfinet/linux-src/include/linux/sched.h | 9 ++-- pfinet/linux-src/include/linux/sem.h | 2 +- pfinet/linux-src/include/linux/stddef.h | 4 ++ pfinet/linux-src/include/linux/string.h | 5 +- pfinet/linux-src/include/linux/synclink.h | 16 +++--- pfinet/linux-src/include/linux/sysctl.h | 6 ++- pfinet/linux-src/include/linux/tty.h | 2 + pfinet/linux-src/include/linux/videodev.h | 1 + pfinet/linux-src/include/net/ip.h | 16 ++++++ pfinet/linux-src/net/core/dev.c | 2 +- pfinet/linux-src/net/ipv4/Config.in | 3 -- pfinet/linux-src/net/ipv4/arp.c | 9 +++- pfinet/linux-src/net/ipv4/icmp.c | 19 +++---- pfinet/linux-src/net/ipv4/ip_fw.c | 9 +++- pfinet/linux-src/net/ipv4/ip_input.c | 16 ++---- pfinet/linux-src/net/ipv4/ip_masq.c | 6 ++- pfinet/linux-src/net/ipv4/ip_masq_autofw.c | 4 +- pfinet/linux-src/net/ipv4/ip_masq_mfw.c | 5 +- pfinet/linux-src/net/ipv4/ip_masq_portfw.c | 9 ++-- pfinet/linux-src/net/ipv4/ip_masq_user.c | 2 +- pfinet/linux-src/net/ipv4/ip_output.c | 4 +- pfinet/linux-src/net/ipv4/route.c | 4 +- pfinet/linux-src/net/ipv4/sysctl_net_ipv4.c | 7 ++- pfinet/linux-src/net/ipv4/tcp_ipv4.c | 5 +- 40 files changed, 234 insertions(+), 215 deletions(-) (limited to 'pfinet') diff --git a/pfinet/linux-src/include/linux/apm_bios.h b/pfinet/linux-src/include/linux/apm_bios.h index a478c0c6..7dc036b2 100644 --- a/pfinet/linux-src/include/linux/apm_bios.h +++ b/pfinet/linux-src/include/linux/apm_bios.h @@ -130,6 +130,7 @@ extern int apm_display_unblank(void); #define APM_NOT_ENGAGED 0x0b #define APM_BAD_FUNCTION 0x0c #define APM_RESUME_DISABLED 0x0d +#define APM_NO_ERROR 0x53 #define APM_BAD_STATE 0x60 #define APM_NO_EVENTS 0x80 #define APM_NOT_PRESENT 0x86 diff --git a/pfinet/linux-src/include/linux/capability.h b/pfinet/linux-src/include/linux/capability.h index 07d554ca..03c93dad 100644 --- a/pfinet/linux-src/include/linux/capability.h +++ b/pfinet/linux-src/include/linux/capability.h @@ -89,9 +89,9 @@ typedef __u32 kernel_cap_t; /* Overrides the following restrictions that the effective user ID shall match the file owner ID when setting the S_ISUID and S_ISGID bits on that file; that the effective group ID (or one of the - supplementary group IDs shall match the file owner ID when setting + supplementary group IDs) shall match the file owner ID when setting the S_ISGID bit on that file; that the S_ISUID and S_ISGID bits are - cleared on successful return from chown(2). */ + cleared on successful return from chown(2) (not implemented). */ #define CAP_FSETID 4 diff --git a/pfinet/linux-src/include/linux/concap.h b/pfinet/linux-src/include/linux/concap.h index 05f74d82..b8e72dc6 100644 --- a/pfinet/linux-src/include/linux/concap.h +++ b/pfinet/linux-src/include/linux/concap.h @@ -1,4 +1,4 @@ -/* $Id: concap.h,v 1.1 1998/02/01 00:15:11 keil Exp $ +/* $Id: concap.h,v 1.2 1999/08/23 15:54:21 keil Exp $ */ #ifndef _LINUX_CONCAP_H #define _LINUX_CONCAP_H @@ -25,11 +25,11 @@ struct concap_device_ops; /* this manages all data needed by the encapsulation protocol */ struct concap_proto{ - struct device *net_dev; /* net device using our service */ - struct concap_device_ops *dops; /* callbacks provided by device */ - struct concap_proto_ops *pops; /* callbacks provided by us */ + struct device *net_dev; /* net device using our service */ + struct concap_device_ops *dops; /* callbacks provided by device */ + struct concap_proto_ops *pops; /* callbacks provided by us */ int flags; - void *proto_data; /* protocol specific private data, to + void *proto_data; /* protocol specific private data, to be accessed via *pops methods only*/ /* : @@ -107,7 +107,3 @@ extern int concap_nop(struct concap_proto *cprot); extern int concap_drop_skb(struct concap_proto *cprot, struct sk_buff *skb); #endif #endif - - - - diff --git a/pfinet/linux-src/include/linux/cyclades.h b/pfinet/linux-src/include/linux/cyclades.h index f1043fdf..008254e6 100644 --- a/pfinet/linux-src/include/linux/cyclades.h +++ b/pfinet/linux-src/include/linux/cyclades.h @@ -1,9 +1,9 @@ /* $Revision: 2.6 $$Date: 1998/08/10 16:57:01 $ * linux/include/linux/cyclades.h * - * This file is maintained by Ivan Passos , - * Marcio Saito and - * Randolph Bentson . + * This file was initially written by + * Randolph Bentson and is maintained by + * Ivan Passos . * * This file contains the general definitions for the cyclades.c driver *$Log: cyclades.h,v $ @@ -317,6 +317,7 @@ struct FIRM_ID { #define C_IN_RXOFL 0x00010000 /* RX buffer overflow */ #define C_IN_IOCTLW 0x00020000 /* I/O control w/ wait */ #define C_IN_MRTS 0x00040000 /* modem RTS drop */ +#define C_IN_ICHAR 0x00080000 /* flow control */ @@ -373,6 +374,8 @@ struct FIRM_ID { #define C_CM_TXLOWWM 0x61 /* Tx buffer low water mark */ #define C_CM_RXHIWM 0x62 /* Rx buffer high water mark */ #define C_CM_RXNNDT 0x63 /* rx no new data timeout */ +#define C_CM_TXFEMPTY 0x64 +#define C_CM_ICHAR 0x65 #define C_CM_MDCD 0x70 /* modem DCD change */ #define C_CM_MDSR 0x71 /* modem DSR change */ #define C_CM_MRI 0x72 /* modem RI change */ @@ -410,6 +413,8 @@ struct CH_CTRL { uclong hw_overflow; /* hw overflow counter */ uclong sw_overflow; /* sw overflow counter */ uclong comm_error; /* frame/parity error counter */ + uclong ichar; + uclong filler[7]; }; @@ -490,7 +495,25 @@ struct ZFW_CTRL { /****************** ****************** *******************/ #endif +/* Per card data structure */ +struct cyclades_card { + long base_addr; + long ctl_addr; + int irq; + int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */ + int first_line; /* minor number of first channel on card */ + int bus_index; /* address shift - 0 for ISA, 1 for PCI */ + int intr_enabled; /* FW Interrupt flag - 0 disabled, 1 enabled */ +#ifdef __KERNEL__ + spinlock_t card_lock; +#else + uclong filler; +#endif +}; +struct cyclades_chip { + int filler; +}; #ifdef __KERNEL__ @@ -508,20 +531,13 @@ struct ZFW_CTRL { #define cy_readw(port) readw(port) #define cy_readl(port) readl(port) -/* Per card data structure */ - -struct cyclades_card { - long base_addr; - long ctl_addr; - int irq; - int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */ - int first_line; /* minor number of first channel on card */ - int bus_index; /* address shift - 0 for ISA, 1 for PCI */ - int intr_enabled; /* FW Interrupt flag - 0 disabled, 1 enabled */ -}; - -struct cyclades_chip { - int filler; +/* + * Statistics counters + */ +struct cyclades_icount { + __u32 cts, dsr, rng, dcd, tx, rx; + __u32 frame, parity, overrun, brk; + __u32 buf_overrun; }; /* @@ -568,16 +584,18 @@ struct cyclades_port { int xmit_cnt; int default_threshold; int default_timeout; - struct tq_struct tqueue; + unsigned long jiffies[3]; + unsigned long rflush_count; struct termios normal_termios; struct termios callout_termios; + struct cyclades_monitor mon; + struct cyclades_idle_stats idle_stats; + struct cyclades_icount icount; + struct tq_struct tqueue; struct wait_queue *open_wait; struct wait_queue *close_wait; struct wait_queue *shutdown_wait; - struct cyclades_monitor mon; - unsigned long jiffies[3]; - unsigned long rflush_count; - struct cyclades_idle_stats idle_stats; + struct wait_queue *delta_msr_wait; }; /* @@ -590,6 +608,8 @@ struct cyclades_port { #define Cy_EVENT_BREAK 3 #define Cy_EVENT_OPEN_WAKEUP 4 #define Cy_EVENT_SHUTDOWN_WAKEUP 5 +#define Cy_EVENT_DELTA_WAKEUP 6 +#define Cy_EVENT_Z_RX_FULL 7 #define CLOSING_WAIT_DELAY 30*HZ #define CY_CLOSING_WAIT_NONE 65535 @@ -768,6 +788,7 @@ struct cyclades_port { #define CyRTPR (0x21*2) #define CyMSVR1 (0x6C*2) #define CyMSVR2 (0x6D*2) +#define CyANY_DELTA (0xF0) #define CyDSR (0x80) #define CyCTS (0x40) #define CyRI (0x20) diff --git a/pfinet/linux-src/include/linux/fs.h b/pfinet/linux-src/include/linux/fs.h index 2fd11f7b..93a39537 100644 --- a/pfinet/linux-src/include/linux/fs.h +++ b/pfinet/linux-src/include/linux/fs.h @@ -22,6 +22,7 @@ #include #include #include +#include /* just in case the #define NULL previously in here was needed */ struct poll_table_struct; @@ -65,10 +66,6 @@ extern int max_super_blocks, nr_super_blocks; #define READA 2 /* read-ahead - don't block if no resources */ #define WRITEA 3 /* write-ahead - don't block if no resources */ -#ifndef NULL -#define NULL ((void *) 0) -#endif - #define NIL_FILP ((struct file *)0) #define SEL_IN 1 #define SEL_OUT 2 @@ -184,7 +181,6 @@ typedef char buffer_block[BLOCK_SIZE]; #define BH_Lock 2 /* 1 if the buffer is locked */ #define BH_Req 3 /* 0 if the buffer has been invalidated */ #define BH_Protected 6 /* 1 if the buffer is protected */ -#define BH_LowPrio 7 /* 1 if the buffer is lowprio */ /* * Try to keep the most commonly used fields in single cache lines (16 @@ -755,7 +751,6 @@ extern struct file *inuse_filps; extern void refile_buffer(struct buffer_head * buf); extern void set_writetime(struct buffer_head * buf, int flag); extern int try_to_free_buffers(struct page *); -extern void cache_drop_behind(struct buffer_head *bh); extern int nr_buffers; extern int buffermem; @@ -776,25 +771,6 @@ extern inline void mark_buffer_clean(struct buffer_head * bh) } } -extern inline void mark_buffer_highprio(struct buffer_head * bh) -{ - clear_bit(BH_LowPrio, &bh->b_state); -} - -extern inline void mark_buffer_lowprio(struct buffer_head * bh) -{ - /* - * dirty buffers cannot be marked lowprio. - */ - if (!buffer_dirty(bh)) - set_bit(BH_LowPrio, &bh->b_state); -} - -static inline int buffer_lowprio(struct buffer_head * bh) -{ - return test_bit(BH_LowPrio, &bh->b_state); -} - extern inline void mark_buffer_dirty(struct buffer_head * bh, int flag) { if (!test_and_set_bit(BH_Dirty, &bh->b_state)) { @@ -802,23 +778,6 @@ extern inline void mark_buffer_dirty(struct buffer_head * bh, int flag) if (bh->b_list != BUF_DIRTY) refile_buffer(bh); } - /* - * if a buffer gets marked dirty then it has to lose - * it's lowprio state. - */ - mark_buffer_highprio(bh); -} - -extern inline void mark_buffer_dirty_lowprio(struct buffer_head * bh) -{ - if (!test_and_set_bit(BH_Dirty, &bh->b_state)) { - if (bh->b_list != BUF_DIRTY) - refile_buffer(bh); - /* - * Mark it lowprio only if it was not dirty before! - */ - set_bit(BH_LowPrio, &bh->b_state); - } } extern int check_disk_change(kdev_t dev); @@ -889,7 +848,6 @@ extern struct buffer_head * getblk(kdev_t, int, int); extern struct buffer_head * find_buffer(kdev_t dev, int block, int size); extern void ll_rw_block(int, int, struct buffer_head * bh[]); extern int is_read_only(kdev_t); -extern int is_device_idle(kdev_t); extern void __brelse(struct buffer_head *); extern inline void brelse(struct buffer_head *buf) { @@ -905,12 +863,8 @@ extern inline void bforget(struct buffer_head *buf) extern void set_blocksize(kdev_t dev, int size); extern unsigned int get_hardblocksize(kdev_t dev); extern struct buffer_head * bread(kdev_t dev, int block, int size); -extern struct buffer_head * buffer_ready (kdev_t dev, int block, int size); -extern void bread_ahead (kdev_t dev, int block, int size); extern struct buffer_head * breada(kdev_t dev,int block, int size, unsigned int pos, unsigned int filesize); -extern struct buffer_head * breada_blocks(kdev_t dev,int block, - int size, int blocks); extern int brw_page(int, struct page *, kdev_t, int [], int, int); diff --git a/pfinet/linux-src/include/linux/i2c.h b/pfinet/linux-src/include/linux/i2c.h index 273b2a71..6082de3d 100644 --- a/pfinet/linux-src/include/linux/i2c.h +++ b/pfinet/linux-src/include/linux/i2c.h @@ -39,6 +39,7 @@ struct i2c_device; #define I2C_BUSID_BT848 1 /* I2C bus on a BT848 */ /* 2 is used in 2.3.x */ #define I2C_BUSID_BUZ 3 /* I2C bus on a BUZ */ +#define I2C_BUSID_ZORAN 4 /* I2C bus on a Zoran */ /* * struct for a driver for a i2c chip (tuner, soundprocessor, diff --git a/pfinet/linux-src/include/linux/isdn.h b/pfinet/linux-src/include/linux/isdn.h index 853f236f..acb653d6 100644 --- a/pfinet/linux-src/include/linux/isdn.h +++ b/pfinet/linux-src/include/linux/isdn.h @@ -1,8 +1,8 @@ -/* $Id: isdn.h,v 1.70 1999/07/31 12:59:58 armin Exp $ +/* $Id: isdn.h,v 1.76 1999/09/14 10:16:21 keil Exp $ * * Main header for the Linux ISDN subsystem (linklevel). * - * Copyright 1994,95,96 by Fritz Elfert (fritz@wuemaus.franken.de) + * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de) * Copyright 1995,96 by Thinking Objects Software GmbH Wuerzburg * Copyright 1995,96 by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de) * @@ -21,6 +21,29 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdn.h,v $ + * Revision 1.76 1999/09/14 10:16:21 keil + * change ABC include + * + * Revision 1.75 1999/09/13 23:25:17 he + * serialized xmitting frames from isdn_ppp and BSENT statcallb + * + * Revision 1.74 1999/09/12 16:19:39 detabc + * added abc features + * low cost routing for net-interfaces (only the HL side). + * need more implementation in the isdnlog-utility + * udp info support (first part). + * different EAZ on outgoing call's. + * more checks on D-Channel callbacks (double use of channels). + * tested and running with kernel 2.3.17 + * + * Revision 1.73 1999/09/06 07:29:36 fritz + * Changed my mail-address. + * + * Revision 1.72 1999/09/04 22:20:19 detabc + * + * Revision 1.71 1999/08/23 15:54:22 keil + * more backported changes from kernel 2.3.14 + * * Revision 1.70 1999/07/31 12:59:58 armin * Added tty fax capabilities. * @@ -247,7 +270,6 @@ #ifndef isdn_h #define isdn_h -#include #include #include @@ -276,6 +298,14 @@ #define ISDN_MINOR_PPPMAX (128 + (ISDN_MAX_CHANNELS-1)) #define ISDN_MINOR_STATUS 255 +#undef CONFIG_ISDN_WITH_ABC_CALLB +#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK +#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP +#undef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ +#undef CONFIG_ISDN_WITH_ABC_CALL_CHECK_SYNCRO +#undef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT + + /* New ioctl-codes */ #define IIOCNETAIF _IO('I',1) #define IIOCNETDIF _IO('I',2) @@ -299,6 +329,7 @@ #define IIOCNETDIL _IO('I',20) #define IIOCGETCPS _IO('I',21) #define IIOCGETDVR _IO('I',22) +#define IIOCNETLCR _IO('I',23) /* dwabc ioctl for LCR from isdnlog */ #define IIOCNETALN _IO('I',32) #define IIOCNETDLN _IO('I',33) @@ -393,9 +424,6 @@ typedef struct { #ifdef __KERNEL__ -#ifndef STANDALONE -#include -#endif #include #include #include @@ -438,7 +466,6 @@ typedef struct { #include - #define ISDN_DRVIOCTL_MASK 0x7f /* Mask for Device-ioctl */ /* Until now unused */ @@ -504,12 +531,6 @@ typedef struct { #define ISDN_NET_CALLBACK 0x04 /* activate callback */ #define ISDN_NET_CBHUP 0x08 /* hangup before callback */ #define ISDN_NET_CBOUT 0x10 /* remote machine does callback */ -#if 0 -/* Unused??? */ -#define ISDN_NET_CLONE 0x08 /* clone a tmp interface when called */ -#define ISDN_NET_TMP 0x10 /* tmp interface until getting an IP */ -#define ISDN_NET_DYNAMIC 0x20 /* this link is dynamically allocated */ -#endif #define ISDN_NET_MAGIC 0x49344C02 /* for paranoia-checking */ @@ -580,18 +601,18 @@ typedef struct isdn_net_local_s { ulong sqfull_stamp; /* Start-Time of overload */ ulong slavedelay; /* Dynamic bundling delaytime */ int triggercps; /* BogoCPS needed for trigger slave */ - struct device *srobin; /* Ptr to Master device for slaves */ + struct device *srobin; /* Ptr to Master device for slaves */ isdn_net_phone *phone[2]; /* List of remote-phonenumbers */ /* phone[0] = Incoming Numbers */ /* phone[1] = Outgoing Numbers */ isdn_net_phone *dial; /* Pointer to dialed number */ - struct device *master; /* Ptr to Master device for slaves */ - struct device *slave; /* Ptr to Slave device for masters */ + struct device *master; /* Ptr to Master device for slaves */ + struct device *slave; /* Ptr to Slave device for masters */ struct isdn_net_local_s *next; /* Ptr to next link in bundle */ struct isdn_net_local_s *last; /* Ptr to last link in bundle */ struct isdn_net_dev_s *netdev; /* Ptr to netdev */ struct sk_buff *first_skb; /* Ptr to skb that triggers dialing */ - struct sk_buff *sav_skb; /* Ptr to skb, rejected by LL-driver*/ + struct sk_buff *volatile sav_skb; /* Ptr to skb, rejected by LL-driver*/ /* Ptr to orig. hard_header_cache */ int (*org_hhc)( struct neighbour *neigh, @@ -619,7 +640,7 @@ typedef struct isdn_net_dev_s { isdn_net_local *local; isdn_net_local *queue; void *next; /* Pointer to next isdn-interface */ - struct device dev; /* interface to upper levels */ + struct device dev; /* interface to upper levels */ #ifdef CONFIG_ISDN_PPP struct mpqueue *mp_last; struct ippp_bundle ib; @@ -743,12 +764,8 @@ typedef struct modem_info { atemu emu; /* AT-emulator data */ struct termios normal_termios; /* For saving termios structs */ struct termios callout_termios; -#ifdef COMPAT_HAS_NEW_WAITQ - wait_queue_head_t open_wait, close_wait; -#else struct wait_queue *open_wait; struct wait_queue *close_wait; -#endif struct semaphore write_sem; } modem_info; @@ -826,11 +843,7 @@ typedef struct { ulong flags; /* Misc driver Flags */ int locks; /* Number of locks for this driver */ int channels; /* Number of channels */ -#ifdef COMPAT_HAS_NEW_WAITQ - wait_queue_head_t st_waitq; /* Wait-Queue for status-read's */ -#else struct wait_queue *st_waitq; /* Wait-Queue for status-read's */ -#endif int maxbufsize; /* Maximum Buffersize supported */ unsigned long pktcount; /* Until now: unused */ int stavail; /* Chars avail on Status-device */ @@ -841,13 +854,8 @@ typedef struct { unsigned long DLEflag; /* Flags: Insert DLE at next read */ #endif struct sk_buff_head *rpqueue; /* Pointers to start of Rcv-Queue */ -#ifdef COMPAT_HAS_NEW_WAITQ - wait_queue_head_t *rcv_waitq; /* Wait-Queues for B-Channel-Reads */ - wait_queue_head_t *snd_waitq; /* Wait-Queue for B-Channel-Send's */ -#else struct wait_queue **rcv_waitq; /* Wait-Queues for B-Channel-Reads */ struct wait_queue **snd_waitq; /* Wait-Queue for B-Channel-Send's */ -#endif char msn2eaz[10][ISDN_MSNLEN]; /* Mapping-Table MSN->EAZ */ } driver; @@ -863,11 +871,7 @@ typedef struct isdn_devt { /* see ISDN_TIMER_..defines */ int global_flags; infostruct *infochain; /* List of open info-devs. */ -#ifdef COMPAT_HAS_NEW_WAITQ - wait_queue_head_t info_waitq; /* Wait-Queue for isdninfo */ -#else struct wait_queue *info_waitq; /* Wait-Queue for isdninfo */ -#endif struct timer_list timer; /* Misc.-function Timer */ int chanmap[ISDN_MAX_CHANNELS];/* Map minor->device-channel */ int drvmap[ISDN_MAX_CHANNELS]; /* Map minor->driver-index */ diff --git a/pfinet/linux-src/include/linux/isdn_ppp.h b/pfinet/linux-src/include/linux/isdn_ppp.h index a62101d0..06d71797 100644 --- a/pfinet/linux-src/include/linux/isdn_ppp.h +++ b/pfinet/linux-src/include/linux/isdn_ppp.h @@ -3,7 +3,7 @@ #ifndef _LINUX_ISDN_PPP_H #define _LINUX_ISDN_PPP_H -#include +#include #define CALLTYPE_INCOMING 0x1 #define CALLTYPE_OUTGOING 0x2 @@ -206,11 +206,7 @@ struct ippp_struct { struct ippp_buf_queue rq[NUM_RCV_BUFFS]; /* packet queue for isdn_ppp_read() */ struct ippp_buf_queue *first; /* pointer to (current) first packet */ struct ippp_buf_queue *last; /* pointer to (current) last used packet in queue */ -#ifdef COMPAT_HAS_NEW_WAITQ - wait_queue_head_t wq; -#else struct wait_queue *wq; -#endif struct task_struct *tk; unsigned int mpppcfg; unsigned int pppcfg; diff --git a/pfinet/linux-src/include/linux/isdnif.h b/pfinet/linux-src/include/linux/isdnif.h index aeb177ab..6d639860 100644 --- a/pfinet/linux-src/include/linux/isdnif.h +++ b/pfinet/linux-src/include/linux/isdnif.h @@ -1,10 +1,10 @@ -/* $Id: isdnif.h,v 1.29 1999/07/31 13:00:02 armin Exp $ +/* $Id: isdnif.h,v 1.31 1999/09/06 07:29:36 fritz Exp $ * * Linux ISDN subsystem * * Definition of the interface between the subsystem and its low-level drivers. * - * Copyright 1994,95,96 by Fritz Elfert (fritz@wuemaus.franken.de) + * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de) * Copyright 1995,96 Thinking Objects Software GmbH Wuerzburg * * This program is free software; you can redistribute it and/or modify @@ -22,6 +22,12 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdnif.h,v $ + * Revision 1.31 1999/09/06 07:29:36 fritz + * Changed my mail-address. + * + * Revision 1.30 1999/08/23 15:54:29 keil + * more backported changes from kernel 2.3.14 + * * Revision 1.29 1999/07/31 13:00:02 armin * Added tty fax capabilities. * @@ -134,7 +140,7 @@ #ifndef isdnif_h #define isdnif_h -#include +#include /* * Values for general protocol-selection diff --git a/pfinet/linux-src/include/linux/kernelcapi.h b/pfinet/linux-src/include/linux/kernelcapi.h index 7b212be0..5778d2eb 100644 --- a/pfinet/linux-src/include/linux/kernelcapi.h +++ b/pfinet/linux-src/include/linux/kernelcapi.h @@ -1,11 +1,15 @@ /* - * $Id: kernelcapi.h,v 1.3 1999/07/01 15:26:56 calle Exp $ + * $Id: kernelcapi.h,v 1.4 1999/09/10 17:24:19 calle Exp $ * * Kernel CAPI 2.0 Interface for Linux * * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: kernelcapi.h,v $ + * Revision 1.4 1999/09/10 17:24:19 calle + * Changes for proposed standard for CAPI2.0: + * - AK148 "Linux Exention" + * * Revision 1.3 1999/07/01 15:26:56 calle * complete new version (I love it): * + new hardware independed "capi_driver" interface that will make it easy to: @@ -70,19 +74,19 @@ typedef struct kcapi_flagdef { #ifdef __KERNEL__ struct capi_interface { - int (*capi_installed) (void); + __u16 (*capi_isinstalled) (void); - __u16(*capi_register) (capi_register_params * rparam, __u16 * applidp); - __u16(*capi_release) (__u16 applid); - __u16(*capi_put_message) (__u16 applid, struct sk_buff * msg); - __u16(*capi_get_message) (__u16 applid, struct sk_buff ** msgp); - __u16(*capi_set_signal) (__u16 applid, + __u16 (*capi_register) (capi_register_params * rparam, __u16 * applidp); + __u16 (*capi_release) (__u16 applid); + __u16 (*capi_put_message) (__u16 applid, struct sk_buff * msg); + __u16 (*capi_get_message) (__u16 applid, struct sk_buff ** msgp); + __u16 (*capi_set_signal) (__u16 applid, void (*signal) (__u16 applid, __u32 param), __u32 param); - __u16(*capi_get_manufacturer) (__u16 contr, __u8 buf[CAPI_MANUFACTURER_LEN]); - __u16(*capi_get_version) (__u16 contr, struct capi_version * verp); - __u16(*capi_get_serial) (__u16 contr, __u8 serial[CAPI_SERIAL_LEN]); - __u16(*capi_get_profile) (__u16 contr, struct capi_profile * profp); + __u16 (*capi_get_manufacturer) (__u32 contr, __u8 buf[CAPI_MANUFACTURER_LEN]); + __u16 (*capi_get_version) (__u32 contr, struct capi_version * verp); + __u16(*capi_get_serial) (__u32 contr, __u8 serial[CAPI_SERIAL_LEN]); + __u16(*capi_get_profile) (__u32 contr, struct capi_profile * profp); /* * to init controllers, data is always in user memory @@ -96,7 +100,7 @@ struct capi_interface { struct capi_interface_user { char name[20]; - void (*callback) (unsigned int cmd, __u16 contr, void *data); + void (*callback) (unsigned int cmd, __u32 contr, void *data); /* internal */ struct capi_interface_user *next; }; diff --git a/pfinet/linux-src/include/linux/pagemap.h b/pfinet/linux-src/include/linux/pagemap.h index 3e1e89b4..1f5a62dd 100644 --- a/pfinet/linux-src/include/linux/pagemap.h +++ b/pfinet/linux-src/include/linux/pagemap.h @@ -148,6 +148,7 @@ static inline void wait_on_page(struct page * page) __wait_on_page(page); } +extern void update_vm_cache_conditional(struct inode *, unsigned long, const char *, int, unsigned long); extern void update_vm_cache(struct inode *, unsigned long, const char *, int); #endif diff --git a/pfinet/linux-src/include/linux/pci.h b/pfinet/linux-src/include/linux/pci.h index 505bb16f..8f5eda0c 100644 --- a/pfinet/linux-src/include/linux/pci.h +++ b/pfinet/linux-src/include/linux/pci.h @@ -283,6 +283,7 @@ * . */ #define PCI_VENDOR_ID_COMPAQ 0x0e11 +#define PCI_DEVICE_ID_COMPAQ_TOKENRING 0x0508 #define PCI_DEVICE_ID_COMPAQ_1280 0x3033 #define PCI_DEVICE_ID_COMPAQ_TRIFLEX 0x4000 #define PCI_DEVICE_ID_COMPAQ_SMART2P 0xae10 @@ -301,6 +302,7 @@ #define PCI_DEVICE_ID_NCR_53C825 0x0003 #define PCI_DEVICE_ID_NCR_53C815 0x0004 #define PCI_DEVICE_ID_NCR_53C860 0x0006 +#define PCI_DEVICE_ID_NCR_53C1510D 0x000a #define PCI_DEVICE_ID_NCR_53C896 0x000b #define PCI_DEVICE_ID_NCR_53C895 0x000c #define PCI_DEVICE_ID_NCR_53C885 0x000d @@ -755,6 +757,7 @@ #define PCI_DEVICE_ID_VIA_82C585 0x0585 #define PCI_DEVICE_ID_VIA_82C586_0 0x0586 #define PCI_DEVICE_ID_VIA_82C595 0x0595 +#define PCI_DEVICE_ID_VIA_82C596_0 0x0596 #define PCI_DEVICE_ID_VIA_82C597_0 0x0597 #define PCI_DEVICE_ID_VIA_82C598_0 0x0598 #define PCI_DEVICE_ID_VIA_82C926 0x0926 @@ -762,6 +765,7 @@ #define PCI_DEVICE_ID_VIA_82C595_97 0x1595 #define PCI_DEVICE_ID_VIA_82C586_2 0x3038 #define PCI_DEVICE_ID_VIA_82C586_3 0x3040 +#define PCI_DEVICE_ID_VIA_82C686_5 0x3058 #define PCI_DEVICE_ID_VIA_86C100A 0x6100 #define PCI_DEVICE_ID_VIA_82C597_1 0x8597 #define PCI_DEVICE_ID_VIA_82C598_1 0x8598 diff --git a/pfinet/linux-src/include/linux/poll.h b/pfinet/linux-src/include/linux/poll.h index 972c0cb0..7eb57334 100644 --- a/pfinet/linux-src/include/linux/poll.h +++ b/pfinet/linux-src/include/linux/poll.h @@ -59,6 +59,9 @@ typedef struct { unsigned long *res_in, *res_out, *res_ex; } fd_set_bits; +/* + * How many longwords for "nr" bits? + */ #define FDS_BITPERLONG (8*sizeof(long)) #define FDS_LONGS(nr) (((nr)+FDS_BITPERLONG-1)/FDS_BITPERLONG) #define FDS_BYTES(nr) (FDS_LONGS(nr)*sizeof(long)) @@ -87,17 +90,14 @@ int get_fd_set(unsigned long nr, void *ufdset, unsigned long *fdset) static inline void set_fd_set(unsigned long nr, void *ufdset, unsigned long *fdset) { - if (ufdset) { - nr = FDS_BYTES(nr); - __copy_to_user(ufdset, fdset, nr); - } + if (ufdset) + __copy_to_user(ufdset, fdset, FDS_BYTES(nr)); } static inline void zero_fd_set(unsigned long nr, unsigned long *fdset) { - nr = FDS_BYTES(nr); - memset(fdset, 0, nr); + memset(fdset, 0, FDS_BYTES(nr)); } extern int do_select(int n, fd_set_bits *fds, long *timeout); diff --git a/pfinet/linux-src/include/linux/posix_types.h b/pfinet/linux-src/include/linux/posix_types.h index 338160e4..3ee2ed9d 100644 --- a/pfinet/linux-src/include/linux/posix_types.h +++ b/pfinet/linux-src/include/linux/posix_types.h @@ -1,15 +1,7 @@ #ifndef _LINUX_POSIX_TYPES_H #define _LINUX_POSIX_TYPES_H -/* - * This file is generally used by user-level software, so you need to - * be a little careful about namespace pollution etc. Also, we cannot - * assume GCC is being used. - */ - -#ifndef NULL -# define NULL ((void *) 0) -#endif +#include /* * This allows for 1024 file descriptors: if NR_OPEN is ever grown diff --git a/pfinet/linux-src/include/linux/proc_fs.h b/pfinet/linux-src/include/linux/proc_fs.h index 9d0d94e2..e1b0a893 100644 --- a/pfinet/linux-src/include/linux/proc_fs.h +++ b/pfinet/linux-src/include/linux/proc_fs.h @@ -194,6 +194,7 @@ enum scsi_directory_inos { PROC_SCSI_AMIGA7XX, PROC_SCSI_MVME16x, PROC_SCSI_BVME6000, + PROC_SCSI_SIM710, PROC_SCSI_A3000, PROC_SCSI_A2091, PROC_SCSI_GVP11, diff --git a/pfinet/linux-src/include/linux/quotaops.h b/pfinet/linux-src/include/linux/quotaops.h index 8de13430..bb76e715 100644 --- a/pfinet/linux-src/include/linux/quotaops.h +++ b/pfinet/linux-src/include/linux/quotaops.h @@ -99,8 +99,7 @@ extern __inline__ int DQUOT_TRANSFER(struct dentry *dentry, struct iattr *iattr) int error = -EDQUOT; if (dentry->d_inode->i_sb->dq_op) { - if (IS_QUOTAINIT(dentry->d_inode) == 0) - dentry->d_inode->i_sb->dq_op->initialize(dentry->d_inode, -1); + dentry->d_inode->i_sb->dq_op->initialize(dentry->d_inode, -1); error = dentry->d_inode->i_sb->dq_op->transfer(dentry, iattr, current->fsuid); } else { error = notify_change(dentry, iattr); diff --git a/pfinet/linux-src/include/linux/sched.h b/pfinet/linux-src/include/linux/sched.h index 5ef85c63..4a5ffd58 100644 --- a/pfinet/linux-src/include/linux/sched.h +++ b/pfinet/linux-src/include/linux/sched.h @@ -97,10 +97,6 @@ struct sched_param { int sched_priority; }; -#ifndef NULL -#define NULL ((void *) 0) -#endif - #ifdef __KERNEL__ #include @@ -328,6 +324,10 @@ struct task_struct { struct signal_queue *sigqueue, **sigqueue_tail; unsigned long sas_ss_sp; size_t sas_ss_size; + +/* Thread group tracking */ + u32 parent_exec_id; + u32 self_exec_id; }; /* @@ -394,6 +394,7 @@ struct task_struct { /* files */ &init_files, \ /* mm */ &init_mm, \ /* signals */ SPIN_LOCK_UNLOCKED, &init_signals, {{0}}, {{0}}, NULL, &init_task.sigqueue, 0, 0, \ +/* exec cts */ 0,0, \ } union task_union { diff --git a/pfinet/linux-src/include/linux/sem.h b/pfinet/linux-src/include/linux/sem.h index 3fb2a48f..13c9a8ac 100644 --- a/pfinet/linux-src/include/linux/sem.h +++ b/pfinet/linux-src/include/linux/sem.h @@ -61,7 +61,7 @@ struct seminfo { }; #define SEMMNI 128 /* ? max # of semaphore identifiers */ -#define SEMMSL 32 /* <= 512 max num of semaphores per id */ +#define SEMMSL 250 /* <= 512 max num of semaphores per id */ #define SEMMNS (SEMMNI*SEMMSL) /* ? max # of semaphores in system */ #define SEMOPM 32 /* ~ 100 max num of ops per semop call */ #define SEMVMX 32767 /* semaphore maximum value */ diff --git a/pfinet/linux-src/include/linux/stddef.h b/pfinet/linux-src/include/linux/stddef.h index 39da8088..dfa23221 100644 --- a/pfinet/linux-src/include/linux/stddef.h +++ b/pfinet/linux-src/include/linux/stddef.h @@ -2,7 +2,11 @@ #define _LINUX_STDDEF_H #undef NULL +#if defined(__cplusplus) +#define NULL 0 +#else #define NULL ((void *)0) +#endif #undef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) diff --git a/pfinet/linux-src/include/linux/string.h b/pfinet/linux-src/include/linux/string.h index 1b3fa4e5..9ea63cd0 100644 --- a/pfinet/linux-src/include/linux/string.h +++ b/pfinet/linux-src/include/linux/string.h @@ -2,10 +2,7 @@ #define _LINUX_STRING_H_ #include /* for size_t */ - -#ifndef NULL -#define NULL ((void *) 0) -#endif +#include /* for NULL */ #ifdef __cplusplus extern "C" { diff --git a/pfinet/linux-src/include/linux/synclink.h b/pfinet/linux-src/include/linux/synclink.h index 70ce90e1..450341b7 100644 --- a/pfinet/linux-src/include/linux/synclink.h +++ b/pfinet/linux-src/include/linux/synclink.h @@ -1,7 +1,7 @@ /* * SyncLink Multiprotocol Serial Adapter Driver * - * ==FILEDATE 19990523== + * ==FILEDATE 19990810== * * Copyright (C) 1998 by Microgate Corporation * @@ -50,8 +50,9 @@ #define BIT31 0x80000000 -#define HDLC_MAX_FRAME_SIZE 4096 +#define HDLC_MAX_FRAME_SIZE 65535 #define MAX_ASYNC_TRANSMIT 4096 +#define MAX_ASYNC_BUFFER_SIZE 4096 #define ASYNC_PARITY_NONE 0 #define ASYNC_PARITY_EVEN 1 @@ -68,12 +69,12 @@ #define HDLC_FLAG_AUTO_RTS 0x0080 #define HDLC_FLAG_RXC_DPLL 0x0100 #define HDLC_FLAG_RXC_BRG 0x0200 -#define HDLC_FLAG_RXC_TXCPIN 0x8000 -#define HDLC_FLAG_RXC_RXCPIN 0x0000 +#define HDLC_FLAG_RXC_TXCPIN 0x8000 +#define HDLC_FLAG_RXC_RXCPIN 0x0000 #define HDLC_FLAG_TXC_DPLL 0x0400 #define HDLC_FLAG_TXC_BRG 0x0800 -#define HDLC_FLAG_TXC_TXCPIN 0x0000 -#define HDLC_FLAG_TXC_RXCPIN 0x0008 +#define HDLC_FLAG_TXC_TXCPIN 0x0000 +#define HDLC_FLAG_TXC_RXCPIN 0x0008 #define HDLC_FLAG_DPLL_DIV8 0x1000 #define HDLC_FLAG_DPLL_DIV16 0x2000 #define HDLC_FLAG_DPLL_DIV32 0x0000 @@ -81,6 +82,7 @@ #define HDLC_CRC_NONE 0 #define HDLC_CRC_16_CCITT 1 +#define HDLC_CRC_32_CCITT 2 #define HDLC_TXIDLE_FLAGS 0 #define HDLC_TXIDLE_ALT_ZEROS_ONES 1 @@ -132,7 +134,7 @@ typedef struct _MGSL_PARAMS unsigned char encoding; /* NRZ, NRZI, etc. */ unsigned long clock_speed; /* external clock speed in bits per second */ unsigned char addr_filter; /* receive HDLC address filter, 0xFF = disable */ - unsigned short crc_type; /* None, CRC16 or CRC16-CCITT */ + unsigned short crc_type; /* None, CRC16-CCITT, or CRC32-CCITT */ unsigned char preamble_length; unsigned char preamble; diff --git a/pfinet/linux-src/include/linux/sysctl.h b/pfinet/linux-src/include/linux/sysctl.h index aba1498a..753df742 100644 --- a/pfinet/linux-src/include/linux/sysctl.h +++ b/pfinet/linux-src/include/linux/sysctl.h @@ -103,7 +103,8 @@ enum KERN_MSGMAX=35, /* int: Maximum size of a messege */ KERN_MSGMNB=36, /* int: Maximum message queue size */ KERN_MSGPOOL=37, /* int: Maximum system message pool size */ - KERN_SYSRQ=38 /* int: Sysreq enable */ + KERN_SYSRQ=38, /* int: Sysreq enable */ + KERN_SHMALL=41 /* int: maximum size of shared memory */ }; @@ -224,7 +225,8 @@ enum NET_IPV4_ICMP_PARAMPROB_RATE=62, NET_IPV4_ICMP_ECHOREPLY_RATE=63, NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES=64, - NET_IPV4_IGMP_MAX_MEMBERSHIPS=65 + NET_IPV4_IGMP_MAX_MEMBERSHIPS=65, + NET_IPV4_ALWAYS_DEFRAG=67 }; enum { diff --git a/pfinet/linux-src/include/linux/tty.h b/pfinet/linux-src/include/linux/tty.h index 55aabe43..d215a270 100644 --- a/pfinet/linux-src/include/linux/tty.h +++ b/pfinet/linux-src/include/linux/tty.h @@ -303,6 +303,7 @@ struct tty_struct { unsigned long canon_head; unsigned int canon_column; struct semaphore atomic_read; + struct semaphore atomic_write; }; /* tty magic number */ @@ -328,6 +329,7 @@ struct tty_struct { #define TTY_HW_COOK_OUT 14 #define TTY_HW_COOK_IN 15 #define TTY_PTY_LOCK 16 +#define TTY_NO_WRITE_SPLIT 17 #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) diff --git a/pfinet/linux-src/include/linux/videodev.h b/pfinet/linux-src/include/linux/videodev.h index 119b60ee..b3427409 100644 --- a/pfinet/linux-src/include/linux/videodev.h +++ b/pfinet/linux-src/include/linux/videodev.h @@ -278,6 +278,7 @@ struct video_unit #define VID_HARDWARE_TYPHOON 19 #define VID_HARDWARE_VINO 20 /* Reserved for SGI Indy Vino */ #define VID_HARDWARE_CADET 21 /* Cadet radio */ +#define VID_HARDWARE_TRUST 22 /* Trust FM Radio */ /* * Initialiser list diff --git a/pfinet/linux-src/include/net/ip.h b/pfinet/linux-src/include/net/ip.h index 5e80fb43..1a6cb610 100644 --- a/pfinet/linux-src/include/net/ip.h +++ b/pfinet/linux-src/include/net/ip.h @@ -203,6 +203,22 @@ extern __inline__ void ip_eth_mc_map(u32 addr, char *buf) buf[3]=addr&0x7F; } +/* + * Map a multicast IP onto multicast MAC for type Token Ring. + * This conforms to RFC1469 Option 2 Multicasting i.e. + * using a functional address to transmit / receive + * multicast packets. + */ + +extern __inline__ void ip_tr_mc_map(u32 addr, char *buf) +{ + buf[0]=0xC0; + buf[1]=0x00; + buf[2]=0x00; + buf[3]=0x04; + buf[4]=0x00; + buf[5]=0x00; +} extern int ip_call_ra_chain(struct sk_buff *skb); diff --git a/pfinet/linux-src/net/core/dev.c b/pfinet/linux-src/net/core/dev.c index cc9584a1..75fae54a 100644 --- a/pfinet/linux-src/net/core/dev.c +++ b/pfinet/linux-src/net/core/dev.c @@ -1284,7 +1284,7 @@ static int sprintf_wireless_stats(char *buffer, struct device *dev) stats->qual.level, stats->qual.updated & 2 ? '.' : ' ', stats->qual.noise, - stats->qual.updated & 3 ? '.' : ' ', + stats->qual.updated & 4 ? '.' : ' ', stats->discard.nwid, stats->discard.code, stats->discard.misc); diff --git a/pfinet/linux-src/net/ipv4/Config.in b/pfinet/linux-src/net/ipv4/Config.in index 29786da5..8982bc1e 100644 --- a/pfinet/linux-src/net/ipv4/Config.in +++ b/pfinet/linux-src/net/ipv4/Config.in @@ -31,14 +31,12 @@ if [ "$CONFIG_FIREWALL" = "y" ]; then define_bool CONFIG_NETLINK_DEV y fi fi - bool 'IP: always defragment (required for masquerading)' CONFIG_IP_ALWAYS_DEFRAG if [ "$CONFIG_IP_MULTIPLE_TABLES" = "y" ]; then bool 'IP: use FWMARK value as routing key' CONFIG_IP_ROUTE_FWMARK fi fi fi if [ "$CONFIG_IP_FIREWALL" = "y" ]; then - if [ "$CONFIG_IP_ALWAYS_DEFRAG" != "n" ]; then bool 'IP: transparent proxy support' CONFIG_IP_TRANSPARENT_PROXY bool 'IP: masquerading' CONFIG_IP_MASQUERADE if [ "$CONFIG_IP_MASQUERADE" != "n" ]; then @@ -54,7 +52,6 @@ if [ "$CONFIG_IP_FIREWALL" = "y" ]; then fi fi fi - fi fi bool 'IP: optimize as router not host' CONFIG_IP_ROUTER tristate 'IP: tunneling' CONFIG_NET_IPIP diff --git a/pfinet/linux-src/net/ipv4/arp.c b/pfinet/linux-src/net/ipv4/arp.c index 27d2f802..1e5cf1b1 100644 --- a/pfinet/linux-src/net/ipv4/arp.c +++ b/pfinet/linux-src/net/ipv4/arp.c @@ -194,9 +194,14 @@ int arp_mc_map(u32 addr, u8 *haddr, struct device *dev, int dir) { switch (dev->type) { case ARPHRD_ETHER: - case ARPHRD_IEEE802: case ARPHRD_FDDI: - ip_eth_mc_map(addr, haddr); + ip_eth_mc_map(addr, haddr) ; + return 0 ; + case ARPHRD_IEEE802: + if ( (dev->name[0] == 't') && (dev->name[1] == 'r')) /* Token Ring */ + ip_tr_mc_map(addr,haddr) ; + else + ip_eth_mc_map(addr, haddr); return 0; default: if (dir) { diff --git a/pfinet/linux-src/net/ipv4/icmp.c b/pfinet/linux-src/net/ipv4/icmp.c index 34b48a93..78c54be8 100644 --- a/pfinet/linux-src/net/ipv4/icmp.c +++ b/pfinet/linux-src/net/ipv4/icmp.c @@ -3,7 +3,7 @@ * * Alan Cox, * - * Version: $Id: icmp.c,v 1.52.2.2 1999/06/20 21:27:39 davem Exp $ + * Version: $Id: icmp.c,v 1.52.2.3 1999/09/22 16:33:02 davem Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -320,6 +320,8 @@ int sysctl_icmp_echo_ignore_broadcasts = 0; /* Control parameter - ignore bogus broadcast responses? */ int sysctl_icmp_ignore_bogus_error_responses =0; +extern int sysctl_ip_always_defrag; + /* * ICMP control array. This specifies what to do with each ICMP. */ @@ -537,10 +539,9 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, unsigned long info) * Now check at the protocol level */ if (!rt) { -#ifndef CONFIG_IP_ALWAYS_DEFRAG - if (net_ratelimit()) + if (sysctl_ip_always_defrag == 0 && + net_ratelimit()) printk(KERN_DEBUG "icmp_send: destinationless packet\n"); -#endif return; } if (rt->rt_flags&(RTCF_BROADCAST|RTCF_MULTICAST)) @@ -698,7 +699,7 @@ static void icmp_unreach(struct icmphdr *icmph, struct sk_buff *skb, int len) break; case ICMP_FRAG_NEEDED: if (ipv4_config.no_pmtu_disc) { - if (net_ratelimit()) + if (sysctl_ip_always_defrag == 0 && net_ratelimit()) printk(KERN_INFO "ICMP: %d.%d.%d.%d: fragmentation needed and DF set.\n", NIPQUAD(iph->daddr)); } else { @@ -710,7 +711,7 @@ static void icmp_unreach(struct icmphdr *icmph, struct sk_buff *skb, int len) } break; case ICMP_SR_FAILED: - if (net_ratelimit()) + if (sysctl_ip_always_defrag == 0 && net_ratelimit()) printk(KERN_INFO "ICMP: %d.%d.%d.%d: Source Route Failed.\n", NIPQUAD(iph->daddr)); break; default: @@ -923,7 +924,7 @@ static void icmp_timestamp(struct icmphdr *icmph, struct sk_buff *skb, int len) static void icmp_address(struct icmphdr *icmph, struct sk_buff *skb, int len) { #if 0 - if (net_ratelimit()) + if (sysctl_ip_always_defrag == 0 && net_ratelimit()) printk(KERN_DEBUG "a guy asks for address mask. Who is it?\n"); #endif } @@ -953,8 +954,8 @@ static void icmp_address_reply(struct icmphdr *icmph, struct sk_buff *skb, int l if (mask == ifa->ifa_mask && inet_ifa_match(rt->rt_src, ifa)) return; } - if (net_ratelimit()) - printk(KERN_INFO "Wrong address mask %08lX from %08lX/%s\n", + if (sysctl_ip_always_defrag == 0 && net_ratelimit()) + printk(KERN_INFO "Wrong address mask %08X from %08X/%s\n", ntohl(mask), ntohl(rt->rt_src), dev->name); } diff --git a/pfinet/linux-src/net/ipv4/ip_fw.c b/pfinet/linux-src/net/ipv4/ip_fw.c index 99a91d53..6319b89e 100644 --- a/pfinet/linux-src/net/ipv4/ip_fw.c +++ b/pfinet/linux-src/net/ipv4/ip_fw.c @@ -422,7 +422,7 @@ static void dump_packet(const struct iphdr *ip, printk("%d ",f->ipfw.fw_redirpt); } - printk("%s PROTO=%d %ld.%ld.%ld.%ld:%hu %ld.%ld.%ld.%ld:%hu" + printk("%s PROTO=%d %d.%d.%d.%d:%hu %d.%d.%d.%d:%hu" " L=%hu S=0x%2.2hX I=%hu F=0x%4.4hX T=%hu", ifname, ip->protocol, (ntohl(ip->saddr)>>24)&0xFF, @@ -484,6 +484,11 @@ static int find_special(ip_chainlabel label, int *answer) return 1; #ifdef CONFIG_IP_TRANSPARENT_PROXY } else if (strcmp(label,IP_FW_LABEL_REDIRECT) == 0) { + extern int sysctl_ip_always_defrag; + static int enabled = 0; + + if(!enabled) + sysctl_ip_always_defrag++; *answer = FW_REDIRECT; return 1; #endif @@ -1537,7 +1542,7 @@ static int dump_rule(char *buffer, len=sprintf(buffer, "%9s " /* Chain name */ - "%08lX/%08lX->%08lX/%08lX " /* Source & Destination IPs */ + "%08X/%08X->%08X/%08X " /* Source & Destination IPs */ "%.16s " /* Interface */ "%X %X " /* fw_flg and fw_invflg fields */ "%u " /* Protocol */ diff --git a/pfinet/linux-src/net/ipv4/ip_input.c b/pfinet/linux-src/net/ipv4/ip_input.c index 7a3e2618..b1725fa3 100644 --- a/pfinet/linux-src/net/ipv4/ip_input.c +++ b/pfinet/linux-src/net/ipv4/ip_input.c @@ -154,6 +154,7 @@ struct ip_mib ip_statistics={2,IPDEFTTL,}; /* Forwarding=No, Default TTL=64 */ +int sysctl_ip_always_defrag = 0; /* * Handle the issuing of an ioctl() request @@ -170,11 +171,6 @@ int ip_ioctl(struct sock *sk, int cmd, unsigned long arg) } } - -#if defined(CONFIG_IP_TRANSPARENT_PROXY) && !defined(CONFIG_IP_ALWAYS_DEFRAG) -#define CONFIG_IP_ALWAYS_DEFRAG 1 -#endif - /* * 0 - deliver * 1 - block @@ -235,18 +231,17 @@ int ip_local_deliver(struct sk_buff *skb) unsigned char hash; int flag = 0; -#ifndef CONFIG_IP_ALWAYS_DEFRAG /* * Reassemble IP fragments. */ - if (iph->frag_off & htons(IP_MF|IP_OFFSET)) { + if (sysctl_ip_always_defrag == 0 && + (iph->frag_off & htons(IP_MF|IP_OFFSET))) { skb = ip_defrag(skb); if (!skb) return 0; iph = skb->nh.iph; } -#endif #ifdef CONFIG_IP_MASQUERADE /* @@ -443,16 +438,15 @@ int ip_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt) __skb_trim(skb, len); } -#ifdef CONFIG_IP_ALWAYS_DEFRAG /* Won't send ICMP reply, since skb->dst == NULL. --RR */ - if (iph->frag_off & htons(IP_MF|IP_OFFSET)) { + if (sysctl_ip_always_defrag != 0 && + iph->frag_off & htons(IP_MF|IP_OFFSET)) { skb = ip_defrag(skb); if (!skb) return 0; iph = skb->nh.iph; ip_send_check(iph); } -#endif #ifdef CONFIG_FIREWALL /* diff --git a/pfinet/linux-src/net/ipv4/ip_masq.c b/pfinet/linux-src/net/ipv4/ip_masq.c index 0187c58d..6d0588c0 100644 --- a/pfinet/linux-src/net/ipv4/ip_masq.c +++ b/pfinet/linux-src/net/ipv4/ip_masq.c @@ -880,6 +880,8 @@ static __u16 get_next_mport(void) * Be careful, it can be called from u-space */ +extern int sysctl_ip_always_defrag; + struct ip_masq * ip_masq_new(int proto, __u32 maddr, __u16 mport, __u32 saddr, __u16 sport, __u32 daddr, __u16 dport, unsigned mflags) { struct ip_masq *ms, *mst; @@ -910,6 +912,7 @@ struct ip_masq * ip_masq_new(int proto, __u32 maddr, __u16 mport, __u32 saddr, _ return NULL; } MOD_INC_USE_COUNT; + sysctl_ip_always_defrag++; memset(ms, 0, sizeof(*ms)); INIT_LIST_HEAD(&ms->s_list); INIT_LIST_HEAD(&ms->m_list); @@ -1057,6 +1060,7 @@ struct ip_masq * ip_masq_new(int proto, __u32 maddr, __u16 mport, __u32 saddr, _ mport_nono: kfree_s(ms, sizeof(*ms)); + sysctl_ip_always_defrag--; MOD_DEC_USE_COUNT; return NULL; } @@ -2280,7 +2284,7 @@ static int ip_msqhst_procinfo(char *buffer, char **start, off_t offset, * nor cli() 8) */ - sprintf(temp,"%s %08lX:%04X %08lX:%04X %04X %08X %6d %6d %7lu", + sprintf(temp,"%s %08X:%04X %08X:%04X %04X %08X %6d %6d %7lu", masq_proto_name(ms->protocol), ntohl(ms->saddr), ntohs(ms->sport), ntohl(ms->daddr), ntohs(ms->dport), diff --git a/pfinet/linux-src/net/ipv4/ip_masq_autofw.c b/pfinet/linux-src/net/ipv4/ip_masq_autofw.c index d2a1729c..30301441 100644 --- a/pfinet/linux-src/net/ipv4/ip_masq_autofw.c +++ b/pfinet/linux-src/net/ipv4/ip_masq_autofw.c @@ -2,7 +2,7 @@ * IP_MASQ_AUTOFW auto forwarding module * * - * $Id: ip_masq_autofw.c,v 1.3 1998/08/29 23:51:10 davem Exp $ + * $Id: ip_masq_autofw.c,v 1.3.2.1 1999/08/13 18:26:20 davem Exp $ * * Author: Richard Lynch * @@ -179,13 +179,13 @@ static __inline__ int ip_autofw_add(struct ip_autofw_user * af) { struct ip_autofw * newaf; newaf = kmalloc( sizeof(struct ip_autofw), GFP_KERNEL ); - init_timer(&newaf->timer); if ( newaf == NULL ) { printk("ip_autofw_add: malloc said no\n"); return( ENOMEM ); } + init_timer(&newaf->timer); MOD_INC_USE_COUNT; memcpy(newaf, af, sizeof(struct ip_autofw_user)); diff --git a/pfinet/linux-src/net/ipv4/ip_masq_mfw.c b/pfinet/linux-src/net/ipv4/ip_masq_mfw.c index 60c77970..d28f610a 100644 --- a/pfinet/linux-src/net/ipv4/ip_masq_mfw.c +++ b/pfinet/linux-src/net/ipv4/ip_masq_mfw.c @@ -3,7 +3,7 @@ * * Does (reverse-masq) forwarding based on skb->fwmark value * - * $Id: ip_masq_mfw.c,v 1.3.2.1 1999/07/02 10:10:03 davem Exp $ + * $Id: ip_masq_mfw.c,v 1.3.2.3 1999/09/22 16:33:26 davem Exp $ * * Author: Juan Jose Ciarlante * based on Steven Clarke's portfw @@ -216,6 +216,7 @@ static int mfw_delhost(struct ip_masq_mfw *mfw, struct ip_mfw_user *mu) (!mu->rport || h->port == mu->rport)) { /* HIT */ atomic_dec(&mfw->nhosts); + e = h->list.prev; list_del(&h->list); kfree_s(h, sizeof(*h)); MOD_DEC_USE_COUNT; @@ -687,7 +688,7 @@ static struct ip_masq * mfw_in_create(const struct sk_buff *skb, const struct ip /* * Only open TCP tunnel if SYN+!ACK packet */ - if (!tph.th->syn && tph.th->ack) + if (!tph.th->syn || tph.th->ack) return NULL; case IPPROTO_UDP: break; diff --git a/pfinet/linux-src/net/ipv4/ip_masq_portfw.c b/pfinet/linux-src/net/ipv4/ip_masq_portfw.c index 6c697a10..c4b1ef4c 100644 --- a/pfinet/linux-src/net/ipv4/ip_masq_portfw.c +++ b/pfinet/linux-src/net/ipv4/ip_masq_portfw.c @@ -2,7 +2,7 @@ * IP_MASQ_PORTFW masquerading module * * - * $Id: ip_masq_portfw.c,v 1.3.2.1 1999/07/02 10:10:02 davem Exp $ + * $Id: ip_masq_portfw.c,v 1.3.2.2 1999/08/13 18:26:29 davem Exp $ * * Author: Steven Clarke * @@ -85,7 +85,8 @@ static __inline__ int ip_portfw_del(__u16 protocol, __u16 lport, __u32 laddr, __ (!laddr || n->laddr == laddr) && (!raddr || n->raddr == raddr) && (!rport || n->rport == rport)) { - list_del(entry); + entry = n->list.prev; + list_del(&n->list); ip_masq_mod_dec_nent(mmod_self); kfree_s(n, sizeof(struct ip_portfw)); MOD_DEC_USE_COUNT; @@ -422,8 +423,6 @@ static struct ip_masq * portfw_in_create(const struct sk_buff *skb, const struct raddr, rport, iph->saddr, portp[0], 0); - ip_masq_listen(ms); - if (!ms || atomic_read(&mmod_self->mmod_nent) <= 1 /* || ip_masq_nlocks(&portfw_lock) != 1 */ ) /* @@ -431,6 +430,8 @@ static struct ip_masq * portfw_in_create(const struct sk_buff *skb, const struct */ goto out; + ip_masq_listen(ms); + /* * Entry created, lock==1. * if pref_cnt == 0, move diff --git a/pfinet/linux-src/net/ipv4/ip_masq_user.c b/pfinet/linux-src/net/ipv4/ip_masq_user.c index 51297441..f369f03d 100644 --- a/pfinet/linux-src/net/ipv4/ip_masq_user.c +++ b/pfinet/linux-src/net/ipv4/ip_masq_user.c @@ -2,7 +2,7 @@ * IP_MASQ_USER user space control module * * - * $Id: ip_masq_user.c,v 1.1.2.1 1999/08/07 10:56:33 davem Exp $ + * $Id: ip_masq_user.c,v 1.1.2.2 1999/08/13 18:26:33 davem Exp $ */ #include diff --git a/pfinet/linux-src/net/ipv4/ip_output.c b/pfinet/linux-src/net/ipv4/ip_output.c index 44d63557..c8f416ee 100644 --- a/pfinet/linux-src/net/ipv4/ip_output.c +++ b/pfinet/linux-src/net/ipv4/ip_output.c @@ -5,7 +5,7 @@ * * The Internet Protocol (IP) output module. * - * Version: $Id: ip_output.c,v 1.67 1999/03/25 00:43:00 davem Exp $ + * Version: $Id: ip_output.c,v 1.67.2.1 1999/09/07 02:25:23 davem Exp $ * * Authors: Ross Biro, * Fred N. van Kempen, @@ -320,7 +320,7 @@ void ip_queue_xmit(struct sk_buff *skb) if (skb2 == NULL) return; if (sk) - skb_set_owner_w(skb, sk); + skb_set_owner_w(skb2, sk); skb = skb2; iph = skb->nh.iph; } diff --git a/pfinet/linux-src/net/ipv4/route.c b/pfinet/linux-src/net/ipv4/route.c index 06eb5fe5..b308995b 100644 --- a/pfinet/linux-src/net/ipv4/route.c +++ b/pfinet/linux-src/net/ipv4/route.c @@ -717,8 +717,8 @@ void ip_rt_redirect(u32 old_gw, u32 daddr, u32 new_gw, reject_redirect: #ifdef CONFIG_IP_ROUTE_VERBOSE if (IN_DEV_LOG_MARTIANS(in_dev) && net_ratelimit()) - printk(KERN_INFO "Redirect from %lX/%s to %lX ignored." - "Path = %lX -> %lX, tos %02x\n", + printk(KERN_INFO "Redirect from %X/%s to %X ignored." + "Path = %X -> %X, tos %02x\n", ntohl(old_gw), dev->name, ntohl(new_gw), ntohl(saddr), ntohl(daddr), tos); #endif diff --git a/pfinet/linux-src/net/ipv4/sysctl_net_ipv4.c b/pfinet/linux-src/net/ipv4/sysctl_net_ipv4.c index e578e4e7..235b36d1 100644 --- a/pfinet/linux-src/net/ipv4/sysctl_net_ipv4.c +++ b/pfinet/linux-src/net/ipv4/sysctl_net_ipv4.c @@ -1,7 +1,7 @@ /* * sysctl_net_ipv4.c: sysctl interface to net IPV4 subsystem. * - * $Id: sysctl_net_ipv4.c,v 1.38.2.1 1999/08/08 08:43:14 davem Exp $ + * $Id: sysctl_net_ipv4.c,v 1.38.2.2 1999/09/22 16:33:30 davem Exp $ * * Begun April 1, 1996, Mike Shaver. * Added /proc/sys/net/ipv4 directory entry (empty =) ). [MS] @@ -41,6 +41,9 @@ extern int sysctl_ipfrag_time; /* From ip_output.c */ extern int sysctl_ip_dynaddr; +/* From ip_input.c */ +extern int sysctl_ip_always_defrag; + /* From ip_masq.c */ extern int sysctl_ip_masq_debug; @@ -141,6 +144,8 @@ ctl_table ipv4_table[] = { &sysctl_ipfrag_low_thresh, sizeof(int), 0644, NULL, &proc_dointvec}, {NET_IPV4_DYNADDR, "ip_dynaddr", &sysctl_ip_dynaddr, sizeof(int), 0644, NULL, &proc_dointvec}, + {NET_IPV4_ALWAYS_DEFRAG, "ip_always_defrag", + &sysctl_ip_always_defrag, sizeof(int), 0644, NULL, &proc_dointvec}, #ifdef CONFIG_IP_MASQUERADE {NET_IPV4_IP_MASQ_DEBUG, "ip_masq_debug", &sysctl_ip_masq_debug, sizeof(int), 0644, NULL, &proc_dointvec}, diff --git a/pfinet/linux-src/net/ipv4/tcp_ipv4.c b/pfinet/linux-src/net/ipv4/tcp_ipv4.c index c2c78365..904f8b5d 100644 --- a/pfinet/linux-src/net/ipv4/tcp_ipv4.c +++ b/pfinet/linux-src/net/ipv4/tcp_ipv4.c @@ -525,7 +525,8 @@ gotit: static inline __u32 tcp_v4_init_sequence(struct sock *sk, struct sk_buff *skb) { - return secure_tcp_sequence_number(sk->saddr, sk->daddr, + return secure_tcp_sequence_number(skb->nh.iph->daddr, + skb->nh.iph->saddr, skb->h.th->dest, skb->h.th->source); } @@ -1866,7 +1867,7 @@ do_rewrite: /* Ouch!, this should not happen. */ if (!sk->saddr || !sk->rcv_saddr) { printk(KERN_WARNING "tcp_v4_rebuild_header(): not valid sock addrs: " - "saddr=%08lX rcv_saddr=%08lX\n", + "saddr=%08X rcv_saddr=%08X\n", ntohl(sk->saddr), ntohl(sk->rcv_saddr)); return 0; -- cgit v1.2.3