lkml.org 
[lkml]   [2003]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] fix PPP deflate compression
This patch fixes two bugs that were stopping PPP compression (and in
particular, Deflate compression) from working.

The first bug was pointed out by Richard Moats. In the conversion to
use pskb_may_pull, we ended up with a bogus test which basically meant
that the kernel driver never saw the CCP conf-ack packets and thus
never enabled compression.

The second bug crept in with the change of DEFLATE_MIN_SIZE from 8 to
9. Changing that definition had the unfortunate side-effect of
changing the way that the code interpreted the encoded Deflate
parameter bytes. This meant that we were using the wrong window size,
twice what we had actually negotiated with the peer.

Please apply.

Paul.

diff -urN linux-2.5/drivers/net/ppp_generic.c pmac-2.5/drivers/net/ppp_generic.c
--- linux-2.5/drivers/net/ppp_generic.c 2003-07-11 10:41:26.000000000 +1000
+++ pmac-2.5/drivers/net/ppp_generic.c 2003-08-07 14:59:13.000000000 +1000
@@ -2073,7 +2073,8 @@
case CCP_CONFACK:
if ((ppp->flags & (SC_CCP_OPEN | SC_CCP_UP)) != SC_CCP_OPEN)
break;
- if (!pskb_may_pull(skb, len = CCP_LENGTH(dp)) + 2)
+ len = CCP_LENGTH(dp);
+ if (!pskb_may_pull(skb, len + 2))
return; /* too short */
dp += CCP_HDRLEN;
len -= CCP_HDRLEN;
diff -urN linux-2.5/include/linux/ppp-comp.h pmac-2.5/include/linux/ppp-comp.h
--- linux-2.5/include/linux/ppp-comp.h 2003-06-15 12:12:49.000000000 +1000
+++ pmac-2.5/include/linux/ppp-comp.h 2003-08-07 16:10:06.000000000 +1000
@@ -185,10 +185,9 @@
#define DEFLATE_MIN_SIZE 9
#define DEFLATE_MAX_SIZE 15
#define DEFLATE_METHOD_VAL 8
-#define DEFLATE_SIZE(x) (((x) >> 4) + DEFLATE_MIN_SIZE)
+#define DEFLATE_SIZE(x) (((x) >> 4) + 8)
#define DEFLATE_METHOD(x) ((x) & 0x0F)
-#define DEFLATE_MAKE_OPT(w) ((((w) - DEFLATE_MIN_SIZE) << 4) \
- + DEFLATE_METHOD_VAL)
+#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL)
#define DEFLATE_CHK_SEQUENCE 0

/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.044 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site