From owner-freebsd-bugs Sun Jun 1 13:50:04 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id NAA04527 for bugs-outgoing; Sun, 1 Jun 1997 13:50:04 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.5/8.8.5) id NAA04521; Sun, 1 Jun 1997 13:50:02 -0700 (PDT) Resent-Date: Sun, 1 Jun 1997 13:50:02 -0700 (PDT) Resent-Message-Id: <199706012050.NAA04521@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, jc@irbs.com 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 ; 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 Reply-To: jc@irbs.com To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/3743: Only TCP packets should be VJ compressed Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >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: