public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix PPP deflate compression
@ 2003-08-07 23:45 Paul Mackerras
  2003-08-07 23:56 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Mackerras @ 2003-08-07 23:45 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux-kernel

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
 
 /*

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fix PPP deflate compression
  2003-08-07 23:45 [PATCH] fix PPP deflate compression Paul Mackerras
@ 2003-08-07 23:56 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2003-08-07 23:56 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linux-kernel

On Fri, 8 Aug 2003 09:45:24 +1000
Paul Mackerras <paulus@samba.org> wrote:

> Please apply.

Applied, thanks a lot Paul.

If you could CC: netdev@oss.sgi.com for networking patch
submissions in the future, I'd really appreciate it.

Thanks again.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-08-08  0:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-07 23:45 [PATCH] fix PPP deflate compression Paul Mackerras
2003-08-07 23:56 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox