diff -ruN linux-2.6.12.orig/drivers/net/Kconfig linux-2.6.12/drivers/net/Kconfig
--- linux-2.6.12.orig/drivers/net/Kconfig 2005-06-28 19:57:16.000000000 +0200
+++ linux-2.6.12/drivers/net/Kconfig 2005-06-28 20:07:01.000000000 +0200
@@ -2417,6 +2417,32 @@
module; it is called bsd_comp and will show up in the directory
modules once you have said "make modules". If unsure, say N.
+config PPP_MPPE_MPPC
+ tristate "Microsoft PPP compression/encryption (MPPC/MPPE)"
+ depends on PPP
+ select CRYPTO_SHA1
+ select CRYPTO_ARC4
+ ---help---
+ Support for the Microsoft Point-To-Point Compression (RFC2118) and
+ Microsoft Point-To-Point Encryption (RFC3078). These protocols are
+ supported by Microsoft Windows and wide range of "hardware" access
+ servers. MPPE is common protocol in Virtual Private Networks. According
+ to RFC3078, MPPE supports 40, 56 and 128-bit key lengths. Depending on
+ PPP daemon configuration on both ends of the link, following scenarios
+ are possible:
+ - only compression (MPPC) is used,
+ - only encryption (MPPE) is used,
+ - compression and encryption (MPPC+MPPE) are used.
+
+ Please note that Hi/Fn (http://www.hifn.com) holds patent on MPPC so
+ you should check if this patent is valid in your country in order to
+ avoid legal problems.
+
+ For more information please visit http://free.polbox.pl/h/hs001
+
+ To compile this driver as a module, choose M here. The module will
+ be called ppp_mppe_mppc.ko.
+
config PPPOE
tristate "PPP over Ethernet (EXPERIMENTAL)"
depends on EXPERIMENTAL && PPP
diff -ruN linux-2.6.12.orig/drivers/net/Makefile linux-2.6.12/drivers/net/Makefile
--- linux-2.6.12.orig/drivers/net/Makefile 2005-06-28 19:57:16.000000000 +0200
+++ linux-2.6.12/drivers/net/Makefile 2005-06-28 20:07:01.000000000 +0200
@@ -105,6 +105,7 @@
obj-$(CONFIG_PPP_SYNC_TTY) += ppp_synctty.o
obj-$(CONFIG_PPP_DEFLATE) += ppp_deflate.o
obj-$(CONFIG_PPP_BSDCOMP) += bsd_comp.o
+obj-$(CONFIG_PPP_MPPE_MPPC) += ppp_mppe_mppc.o
obj-$(CONFIG_PPPOE) += pppox.o pppoe.o
obj-$(CONFIG_SLIP) += slip.o
diff -ruN linux-2.6.12.orig/drivers/net/ppp_generic.c linux-2.6.12/drivers/net/ppp_generic.c
--- linux-2.6.12.orig/drivers/net/ppp_generic.c 2005-06-28 19:57:20.000000000 +0200
+++ linux-2.6.12/drivers/net/ppp_generic.c 2005-06-28 20:07:01.000000000 +0200
@@ -19,7 +19,7 @@
* PPP driver, written by Michael Callahan and Al Longyear, and
* subsequently hacked by Paul Mackerras.
*
- * ==FILEVERSION 20041108==
+ * ==FILEVERSION 20050110==
*/
#include <linux/config.h>
@@ -105,6 +105,7 @@
spinlock_t rlock; /* lock for receive side 58 */
spinlock_t wlock; /* lock for transmit side 5c */
int mru; /* max receive unit 60 */
+ int mru_alloc; /* MAX(1500,MRU) for dev_alloc_skb() */
unsigned int flags; /* control bits 64 */
unsigned int xstate; /* transmit state bits 68 */
unsigned int rstate; /* receive state bits 6c */
@@ -632,7 +633,9 @@
case PPPIOCSMRU:
if (get_user(val, p))
break;
- ppp->mru = val;
+ ppp->mru_alloc = ppp->mru = val;
+ if (ppp->mru_alloc < PPP_MRU)
+ ppp->mru_alloc = PPP_MRU; /* increase for broken peers */
err = 0;
break;
@@ -1107,14 +1110,37 @@
case PPP_CCP:
/* peek at outbound CCP frames */
ppp_ccp_peek(ppp, skb, 0);
+ /*
+ * When LZS or MPPE/MPPC has been negotiated we don't send
+ * CCP_RESETACK after receiving CCP_RESETREQ; in fact pppd
+ * sends such a packet but we silently discard it here
+ */
+ if (CCP_CODE(skb->data+2) == CCP_RESETACK
+ && (ppp->xcomp->compress_proto == CI_MPPE
+ || ppp->xcomp->compress_proto == CI_LZS)) {
+ --ppp->stats.tx_packets;
+ ppp->stats.tx_bytes -= skb->len - 2;
+ kfree_skb(skb);
+ return;
+ }
break;
}
/* try to do packet compression */
if ((ppp->xstate & SC_COMP_RUN) && ppp->xc_state != 0
&& proto != PPP_LCP && proto != PPP_CCP) {
- new_skb = alloc_skb(ppp->dev->mtu + ppp->dev->hard_header_len,
- GFP_ATOMIC);
+ int comp_ovhd = 0;
+ /*
+ * because of possible data expansion when MPPC or LZS
+ * is used, allocate compressor's buffer 12.5% bigger
+ * than MTU
+ */
+ if (ppp->xcomp->compress_proto == CI_MPPE)
+ comp_ovhd = ((ppp->dev->mtu * 9) / 8) + 1 + MPPE_OVHD;
+ else if (ppp->xcomp->compress_proto == CI_LZS)
+ comp_ovhd = ((ppp->dev->mtu * 9) / 8) + 1 + LZS_OVHD;
+ new_skb = alloc_skb(ppp->dev->mtu + ppp->dev->hard_header_len
+ + comp_ovhd, GFP_ATOMIC);
if (new_skb == 0) {
printk(KERN_ERR "PP
|