aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-24 12:42:15 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-24 12:42:15 -0400
commitb2510b1696730307e7a388ea04132236ab45ac20 (patch)
treebfdf9d950f52f1fba9316452b9576e561dca42d3 /drivers
parentc8cbee61c9d53ee28473ad33bbb54f6a88f5e3af (diff)
parent5b5a60da281c767196427ce8144deae6ec46b389 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [NET]: Make skb_seq_read unmap the last fragment [NET]: Re-enable irqs before pushing pending DMA requests [TCP] tcp_read_sock: Allow recv_actor() return return negative error value. [PPP]: Fix osize too small errors when decoding mppe. [PPP]: Revert 606f585e363527da9feaed79465132c0c661fd9e [TIPC]: Fix infinite loop in netlink handler [SKBUFF]: Fix incorrect config #ifdef around skb_copy_secmark [IPV4]: include sysctl.h from inetdevice.h [IPV6] NDISC: Fix thinko to control Router Preference support. [NETFILTER]: nfctnetlink: Don't allow to change helper [NETFILTER]: nf_conntrack_sip: add missing message types containing RTP info
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ppp_generic.c13
-rw-r--r--drivers/net/ppp_mppe.c10
2 files changed, 17 insertions, 6 deletions
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 541168713f1f..3ef0092dc09c 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -1708,7 +1708,18 @@ ppp_decompress_frame(struct ppp *ppp, struct sk_buff *skb)
1708 goto err; 1708 goto err;
1709 1709
1710 if (proto == PPP_COMP) { 1710 if (proto == PPP_COMP) {
1711 ns = dev_alloc_skb(ppp->mru + PPP_HDRLEN); 1711 int obuff_size;
1712
1713 switch(ppp->rcomp->compress_proto) {
1714 case CI_MPPE:
1715 obuff_size = ppp->mru + PPP_HDRLEN + 1;
1716 break;
1717 default:
1718 obuff_size = ppp->mru + PPP_HDRLEN;
1719 break;
1720 }
1721
1722 ns = dev_alloc_skb(obuff_size);
1712 if (ns == 0) { 1723 if (ns == 0) {
1713 printk(KERN_ERR "ppp_decompress_frame: no memory\n"); 1724 printk(KERN_ERR "ppp_decompress_frame: no memory\n");
1714 goto err; 1725 goto err;
diff --git a/drivers/net/ppp_mppe.c b/drivers/net/ppp_mppe.c
index 5ae80bbe2edc..d5bdd2574659 100644
--- a/drivers/net/ppp_mppe.c
+++ b/drivers/net/ppp_mppe.c
@@ -493,14 +493,14 @@ mppe_decompress(void *arg, unsigned char *ibuf, int isize, unsigned char *obuf,
493 493
494 /* 494 /*
495 * Make sure we have enough room to decrypt the packet. 495 * Make sure we have enough room to decrypt the packet.
496 * To account for possible PFC we should only subtract 1 496 * Note that for our test we only subtract 1 byte whereas in
497 * byte whereas in mppe_compress() we added 2 bytes (+MPPE_OVHD); 497 * mppe_compress() we added 2 bytes (+MPPE_OVHD);
498 * However, we assume no PFC, thus subtracting 2 bytes. 498 * this is to account for possible PFC.
499 */ 499 */
500 if (osize < isize - MPPE_OVHD - 2) { 500 if (osize < isize - MPPE_OVHD - 1) {
501 printk(KERN_DEBUG "mppe_decompress[%d]: osize too small! " 501 printk(KERN_DEBUG "mppe_decompress[%d]: osize too small! "
502 "(have: %d need: %d)\n", state->unit, 502 "(have: %d need: %d)\n", state->unit,
503 osize, isize - MPPE_OVHD - 2); 503 osize, isize - MPPE_OVHD - 1);
504 return DECOMP_ERROR; 504 return DECOMP_ERROR;
505 } 505 }
506 osize = isize - MPPE_OVHD - 2; /* assume no PFC */ 506 osize = isize - MPPE_OVHD - 2; /* assume no PFC */