From jc@irbs.com  Sun Jun  1 13:40:18 1997
Received: from irbs.irbs.com (jc@irbs.irbs.com [199.182.75.129])
          by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id NAA04276
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 1 Jun 1997 13:40:14 -0700 (PDT)
Received: (from jc@localhost)
	by irbs.irbs.com (8.8.5/8.8.5) id QAA15049;
	Sun, 1 Jun 1997 16:40:09 -0400 (EDT)
Message-Id: <199706012040.QAA15049@irbs.irbs.com>
Date: Sun, 1 Jun 1997 16:40:09 -0400 (EDT)
From: John Capo <jc@irbs.com>
Reply-To: jc@irbs.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: Only TCP packets should be VJ compressed
X-Send-Pr-Version: 3.2

>Number:         3743
>Category:       bin
>Synopsis:       Only TCP packets should be VJ compressed
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun  1 13:50:01 PDT 1997
>Closed-Date:    Sun Jun 1 16:55:23 PDT 1997
>Last-Modified:  Sun Jun  1 16:56:13 PDT 1997
>Originator:     John Capo
>Release:        FreeBSD-current
>Organization:
IRBS Engineering
>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);
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jmg 
State-Changed-When: Sun Jun 1 16:55:23 PDT 1997 
State-Changed-Why:  
submitter says this fix is already in 2.2 and -current 
>Unformatted:
