patch-2.2.18 linux/drivers/isdn/isdn_ppp.c
Next file: linux/drivers/isdn/isdn_ppp.h
Previous file: linux/drivers/isdn/isdn_net.h
Back to the patch index
Back to the overall index
- Lines: 353
- Date:
Wed Nov 1 17:04:36 2000
- Orig file:
v2.2.17/drivers/isdn/isdn_ppp.c
- Orig date:
Sun Jun 11 21:44:14 2000
diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/drivers/isdn/isdn_ppp.c linux/drivers/isdn/isdn_ppp.c
@@ -18,256 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Log: isdn_ppp.c,v $
- * Revision 1.63 2000/03/16 15:46:37 kai
- * a little bugfix and cosmetic changes
- *
- * Revision 1.62 2000/02/12 19:26:55 kai
- * adopted to latest 2.3 softnet changes.
- *
- * tested with PPP and MPPP, it works here.
- * can somebody check raw-ip?
- *
- * also changed std2kern, stddiff for bash-1 compatibility,
- * hope this doesn't break anything.
- *
- * Revision 1.61 1999/11/20 22:14:14 detabc
- * added channel dial-skip in case of external use
- * (isdn phone or another isdn device) on the same NTBA.
- * usefull with two or more card's connected the different NTBA's.
- * global switchable in kernel-config and also per netinterface.
- *
- * add auto disable of netinterface's in case of:
- * to many connection's in short time.
- * config mistakes (wrong encapsulation, B2-protokoll or so on) on local
- * or remote side.
- * wrong password's or something else to a ISP (syncppp).
- *
- * possible encapsulations for this future are:
- * ISDN_NET_ENCAP_SYNCPPP, ISDN_NET_ENCAP_UIHDLC, ISDN_NET_ENCAP_RAWIP,
- * and ISDN_NET_ENCAP_CISCOHDLCK.
- *
- * Revision 1.60 1999/11/04 20:29:55 he
- * applied Andre Beck's reset_free fix
- *
- * Revision 1.59 1999/10/31 15:59:50 he
- * more skb headroom checks
- *
- * Revision 1.58 1999/10/30 13:13:01 keil
- * Henners isdn_ppp_skb_push:under fix
- *
- * Revision 1.57 1999/10/05 22:47:17 he
- * Removed dead ISDN_SYNCPPP_READDRESS code (obsoleted by sysctl_ip_dynaddr
- * and network address translation)
- *
- * Revision 1.56 1999/09/29 16:01:06 he
- * replaced dev_alloc_skb() for downstream skbs by equivalent alloc_skb()
- *
- * Revision 1.55 1999/09/23 22:07:51 detabc
- *
- * make ipc_head common usable (for use compressor with raw-ip)
- * add function before netif_rx(). needed for ipv4-tcp-keepalive-detect.
- * ~
- *
- * Revision 1.54 1999/09/13 23:25:17 he
- * serialized xmitting frames from isdn_ppp and BSENT statcallb
- *
- * Revision 1.53 1999/08/31 11:18:14 paul
- * various spelling corrections (new checksums may be needed, Karsten!)
- *
- * Revision 1.52 1999/08/22 20:26:07 calle
- * backported changes from kernel 2.3.14:
- * - several #include "config.h" gone, others come.
- * - "struct device" changed to "struct net_device" in 2.3.14, added a
- * define in isdn_compat.h for older kernel versions.
- *
- * Revision 1.51 1999/08/18 16:19:17 hipp
- * applied MPPP-resize-headroom patch
- *
- * Revision 1.50 1999/08/16 07:11:41 hipp
- * Additional VJ decomp-buffer-size increased from 40 to 128
- *
- * Revision 1.49 1999/07/06 07:47:11 calle
- * bugfix: dev_alloc_skb only reserve 16 bytes. We need to look at the
- * hdrlen the driver want. So I changed dev_alloc_skb calls
- * to alloc_skb and skb_reserve.
- *
- * Revision 1.48 1999/07/01 08:29:56 keil
- * compatibility to 2.3 kernel
- *
- * Revision 1.47 1999/04/18 14:06:59 fritz
- * Removed TIMRU stuff.
- *
- * Revision 1.46 1999/04/12 12:33:35 fritz
- * Changes from 2.0 tree.
- *
- * Revision 1.45 1998/12/30 17:48:24 paul
- * fixed syncPPP callback out
- *
- * Revision 1.44 1998/10/30 17:55:34 he
- * dialmode for x25iface and multulink ppp
- *
- * Revision 1.43 1998/10/29 17:23:54 hipp
- * Minor MPPP fixes, verboser logging.
- *
- * Revision 1.42 1998/07/20 11:30:07 hipp
- * Readded compression check
- *
- * Revision 1.41 1998/07/08 16:50:57 hipp
- * Compression changes
- *
- * Revision 1.40 1998/04/06 19:07:27 hipp
- * added check, whether compression is enabled.
- *
- * Revision 1.39 1998/03/25 22:46:53 hipp
- * Some additional CCP changes.
- *
- * Revision 1.38 1998/03/24 16:33:06 hipp
- * More CCP changes. BSD compression now "works" on a local loopback link.
- * Moved some isdn_ppp stuff from isdn.h to isdn_ppp.h
- *
- * Revision 1.37 1998/03/22 18:50:49 hipp
- * Added BSD Compression for syncPPP .. UNTESTED at the moment
- *
- * Revision 1.36 1998/03/09 17:46:30 he
- * merged in 2.1.89 changes
- *
- * Revision 1.35 1998/03/07 18:21:11 cal
- * Dynamic Timeout-Rule-Handling vs. 971110 included
- *
- * Revision 1.34 1998/02/25 17:49:48 he
- * Changed return codes caused be failing copy_{to,from}_user to -EFAULT
- *
- * Revision 1.33 1998/02/20 17:11:54 fritz
- * Changes for recent kernels.
- *
- * Revision 1.32 1998/01/31 19:29:55 calle
- * Merged changes from and for 2.1.82, not tested only compiled ...
- *
- * Revision 1.31 1997/10/09 21:29:01 fritz
- * New HL<->LL interface:
- * New BSENT callback with nr. of bytes included.
- * Sending without ACK.
- * New L1 error status (not yet in use).
- * Cleaned up obsolete structures.
- * Implemented Cisco-SLARP.
- * Changed local net-interface data to be dynamically allocated.
- * Removed old 2.0 compatibility stuff.
- *
- * Revision 1.30 1997/10/01 09:20:38 fritz
- * Removed old compatibility stuff for 2.0.X kernels.
- * From now on, this code is for 2.1.X ONLY!
- * Old stuff is still in the separate branch.
- *
- * Revision 1.29 1997/08/21 23:11:44 fritz
- * Added changes for kernels >= 2.1.45
- *
- * Revision 1.28 1997/06/17 13:05:57 hipp
- * Applied Eric's underflow-patches (slightly modified)
- * more compression changes (but disabled at the moment)
- * changed one copy_to_user() to run with enabled IRQs
- * a few MP changes
- * changed 'proto' handling in the isdn_ppp receive code
- *
- * Revision 1.27 1997/03/30 16:51:17 calle
- * changed calls to copy_from_user/copy_to_user and removed verify_area
- * were possible.
- *
- * Revision 1.26 1997/02/23 16:53:44 hipp
- * minor cleanup
- * some initial changes for future PPP compresion
- * added AC,PC compression for outgoing frames
- *
- * Revision 1.25 1997/02/12 20:37:35 hipp
- * New ioctl() PPPIOCGCALLINFO, minor cleanup
- *
- * Revision 1.24 1997/02/11 18:32:56 fritz
- * Bugfix in isdn_ppp_free_mpqueue().
- *
- * Revision 1.23 1997/02/10 11:12:19 fritz
- * More changes for Kernel 2.1.X compatibility.
- *
- * Revision 1.22 1997/02/06 15:03:51 hipp
- * changed GFP_KERNEL kmalloc to GFP_ATOMIC in isdn_ppp_fill_mpqueue()
- *
- * Revision 1.21 1997/02/03 23:29:38 fritz
- * Reformatted according CodingStyle
- * Bugfix: removed isdn_ppp_skb_destructor, used by upper layers.
- * Misc changes for Kernel 2.1.X compatibility.
- *
- * Revision 1.20 1996/10/30 12:21:58 fritz
- * Cosmetic fix: Compiler warning when compiling without MPP.
- *
- * Revision 1.19 1996/10/25 19:03:21 hipp
- * changed/added some defines to (re)allow compilation without MP/VJ
- *
- * Revision 1.18 1996/10/22 23:14:00 fritz
- * Changes for compatibility to 2.0.X and 2.1.X kernels.
- *
- * Revision 1.17 1996/10/22 09:39:49 hipp
- * a few MP changes and bugfixes
- *
- * Revision 1.16 1996/09/23 01:58:10 fritz
- * Fix: With syncPPP encapsulation, discard LCP packets
- * when calculating hangup timeout.
- *
- * Revision 1.15 1996/09/07 12:50:12 hipp
- * bugfixes (unknown device after failed dial attempt, minor bugs)
- *
- * Revision 1.14 1996/08/12 16:26:47 hipp
- * code cleanup
- * changed connection management from minors to slots
- *
- * Revision 1.13 1996/07/01 19:47:24 hipp
- * Fixed memory leak in VJ handling and more VJ changes
- *
- * Revision 1.12 1996/06/24 17:42:03 fritz
- * Minor bugfixes.
- *
- * Revision 1.11 1996/06/16 17:46:05 tsbogend
- * changed unsigned long to u32 to make Alpha people happy
- *
- * Revision 1.10 1996/06/11 14:50:29 hipp
- * Lot of changes and bugfixes.
- * New scheme to resend packets to busy LL devices.
- *
- * Revision 1.9 1996/05/18 01:37:01 fritz
- * Added spelling corrections and some minor changes
- * to stay in sync with kernel.
- *
- * Revision 1.8 1996/05/06 11:34:55 hipp
- * fixed a few bugs
- *
- * Revision 1.7 1996/04/30 11:07:42 fritz
- * Added Michael's ippp-bind patch.
- *
- * Revision 1.6 1996/04/30 09:33:09 fritz
- * Removed compatibility-macros.
- *
- * Revision 1.5 1996/04/20 16:32:32 fritz
- * Changed ippp_table to an array of pointers, allocating each part
- * separately.
- *
- * Revision 1.4 1996/02/19 15:25:50 fritz
- * Bugfix: Sync-PPP packets got compressed twice, when resent due to
- * send-queue-full reject.
- *
- * Revision 1.3 1996/02/11 02:27:12 fritz
- * Lot of Bugfixes my Michael.
- * Moved calls to skb_push() into isdn_net_header()
- * Fixed a possible race-condition in isdn_ppp_timer_timeout().
- *
- * Revision 1.2 1996/01/22 05:08:06 fritz
- * Merged in Michael's patches for MP.
- * Minor changes in isdn_ppp_xmit.
- *
- * Revision 1.1 1996/01/09 04:11:29 fritz
- * Initial revision
- *
*/
-/* TODO: right tbusy handling when using MP */
-
#define CONFIG_ISDN_CCP 1
#include <linux/config.h>
@@ -1206,12 +958,18 @@
if(is->debug & 0x10)
printk(KERN_DEBUG "received single link compressed frame\n");
skb = isdn_ppp_decompress(skb,is,NULL,proto);
- if(!skb)
+ if(!skb) {
+ printk(KERN_DEBUG "ippp: dropping LINK_COMP frame!\n");
return;
+ }
proto = isdn_ppp_strip_proto(skb);
+ } else {
+ skb = isdn_ppp_decompress(skb,is,NULL,proto);
+ if(!skb) {
+ printk(KERN_DEBUG "ippp: dropping uncompressed frame!\n");
+ return;
+ }
}
- else
- isdn_ppp_decompress(skb,is,NULL,proto);
}
if (proto == PPP_MP) {
@@ -1249,11 +1007,11 @@
}
if(proto == PPP_COMP) {
- if(!lp->master)
+ if(!lp->master) {
skb = isdn_ppp_decompress(skb,is,is,proto);
- else
+ } else {
skb = isdn_ppp_decompress(skb,is,ippp_table[((isdn_net_local *) (lp->master->priv))->ppp_slot],proto);
-
+ }
if(!skb) {
printk(KERN_DEBUG "ippp: compressed frame discarded!\n");
return;
@@ -1265,11 +1023,17 @@
isdn_ppp_frame_log("R-Decomp", skb->data, skb->len, 32,is->unit,lp->ppp_slot);
}
}
- else if(is->compflags & SC_DECOMP_ON) { /* If decomp is ON */
- if(!lp->master)
- isdn_ppp_decompress(skb,is,is,proto);
- else
- isdn_ppp_decompress(skb,is,ippp_table[((isdn_net_local *) (lp->master->priv))->ppp_slot],proto);
+ else if (is->compflags & SC_DECOMP_ON) { /* If decomp is ON */
+ if(!lp->master) {
+ skb = isdn_ppp_decompress(skb,is,is,proto);
+ } else {
+ skb = isdn_ppp_decompress(skb,is,ippp_table[((isdn_net_local *) (lp->master->priv))->ppp_slot],proto);
+ }
+
+ if(!skb) {
+ printk(KERN_DEBUG "ippp: compressed frame discarded!\n");
+ return;
+ }
}
switch (proto) {
@@ -2619,14 +2383,12 @@
* single link decompression
*/
if(!is->link_decompressor) {
- printk(KERN_ERR "ippp: no link decompressor defined!\n");
- dev_kfree_skb(skb);
- return NULL;
+ printk(KERN_DEBUG "ippp: no link decompressor defined!\n");
+ return skb;
}
if(!is->link_decomp_stat) {
printk(KERN_DEBUG "ippp: no link decompressor data allocated\n");
- dev_kfree_skb(skb);
- return NULL;
+ return skb;
}
stat = is->link_decomp_stat;
ipc = is->link_decompressor;
@@ -2637,14 +2399,12 @@
* 'normal' or bundle-compression
*/
if(!master->decompressor) {
- printk(KERN_ERR "ippp: no decompressor defined!\n");
- dev_kfree_skb(skb);
- return NULL;
+ printk(KERN_DEBUG "ippp: no decompressor defined!\n");
+ return skb;
}
if(!master->decomp_stat) {
printk(KERN_DEBUG "ippp: no decompressor data allocated\n");
- dev_kfree_skb(skb);
- return NULL;
+ return skb;
}
stat = master->decomp_stat;
ipc = master->decompressor;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)