1 --- linux/drivers/net/ppp.c.orig Sun Mar 25 08:31:15 2001
2 +++ linux/drivers/net/ppp.c Mon Mar 25 09:27:28 2002
3 @@ -2468,10 +2468,14 @@
6 struct sk_buff *new_skb;
7 + int new_skb_size = ppp->mtu + PPP_HDRLEN;
10 /* Allocate an skb for the compressed frame. */
11 - new_skb = alloc_skb(ppp->mtu + PPP_HDRLEN, GFP_ATOMIC);
12 + if (ppp->sc_xcomp->compress_proto == CI_MPPE)
13 + /* CCP [must have] reduced MTU by MPPE_PAD. */
14 + new_skb_size += MPPE_PAD;
15 + new_skb = alloc_skb(new_skb_size, GFP_ATOMIC);
16 if (new_skb == NULL) {
17 printk(KERN_ERR "ppp_send_frame: no memory\n");
19 @@ -2482,19 +2486,32 @@
20 /* Compress the frame. */
21 new_count = (*ppp->sc_xcomp->compress)
22 (ppp->sc_xc_state, data, new_skb->data,
23 - count, ppp->mtu + PPP_HDRLEN);
24 + count, new_skb_size);
26 /* Did it compress? */
27 if (new_count > 0 && (ppp->flags & SC_CCP_UP)) {
28 skb_put(new_skb, new_count);
32 + } else if (new_count == 0) {
34 * The frame could not be compressed, or it could not
35 * be sent in compressed form because CCP is down.
41 + * MPPE requires that we do not send unencrypted
42 + * frames. The compressor will return -1 if we
43 + * should drop the frame. We cannot simply test
44 + * the compress_proto because MPPE and MPPC share
47 + printk(KERN_ERR "ppp: compressor dropped pkt\n");