Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Jun 1997 16:40:09 -0400 (EDT)
From:      John Capo <jc@irbs.com>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/3743: Only TCP packets should be VJ compressed
Message-ID:  <199706012040.QAA15049@irbs.irbs.com>
Resent-Message-ID: <199706012050.NAA04521@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         3743
>Category:       bin
>Synopsis:       Only TCP packets should be VJ compressed
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun  1 13:50:01 PDT 1997
>Last-Modified:
>Originator:     John Capo
>Organization:
IRBS Engineering
>Release:        FreeBSD-current
>Environment:

	

>Description:

If vjcomp is enabled, all packets are passed to sl_compress_tcp()
for possible compression.  sl_compress_tcp() assumes that the packet
is TCP.

>How-To-Repeat:

Install SKIP from Sun.  Watch packets be corrupted when the encryption
key changes.  Traceroute fails sometimes too, probably due to the
right kind of UDP packet looking like a TCP packet.

>Fix:

Index: vjcomp.c
===================================================================
RCS file: /usr/cvs/src/usr.sbin/ppp/vjcomp.c,v
retrieving revision 1.7
diff -u -r1.7 vjcomp.c
--- vjcomp.c	1997/05/07 23:30:50	1.7
+++ vjcomp.c	1997/06/01 20:19:20
@@ -43,6 +43,7 @@
 SendPppFrame(bp)
 struct mbuf *bp;
 {
+  struct ip *ip;
   int type;
   int proto;
   int cproto = IpcpInfo.his_compproto >> 16;
@@ -50,9 +51,11 @@
 #ifdef DEBUG
   logprintf("SendPppFrame: proto = %x\n", IpcpInfo.his_compproto);
 #endif
-  if (((struct ip *)MBUF_CTOP(bp))->ip_p == IPPROTO_TCP
-      && cproto== PROTO_VJCOMP) {
-    type = sl_compress_tcp(bp, (struct ip *)MBUF_CTOP(bp), &cslc, IpcpInfo.his_compproto & 0xff);
+
+  ip = (struct ip *)MBUF_CTOP(bp);
+
+  if (cproto == PROTO_VJCOMP && ip->ip_p == IPPROTO_TCP) {
+    type = sl_compress_tcp(bp, ip, &cslc, IpcpInfo.his_compproto & 0xff);
 
 #ifdef DEBUG
     logprintf("type = %x\n", type);
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199706012040.QAA15049>