From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 29 05:26:06 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E3EFB16A4B3 for ; Mon, 29 Sep 2003 05:26:06 -0700 (PDT) Received: from brolloks.trispen.com (brolloks.trispen.com [196.7.146.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id A288B44005 for ; Mon, 29 Sep 2003 05:26:04 -0700 (PDT) (envelope-from jacques@trispen.com) Received: by brolloks.trispen.com (Postfix, from userid 1000) id A261122E40; Mon, 29 Sep 2003 14:26:01 +0200 (SAST) Date: Mon, 29 Sep 2003 14:26:01 +0200 From: Jacques Fourie To: freebsd-hackers@freebsd.org Message-ID: <20030929142601.A71290@trispen.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="k+w/mQv8wyuph6w0" X-Mailer: Mutt 1.0.1i Subject: Bug in if_spppsubr.c ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: jf@trispen.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2003 12:26:07 -0000 --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Hi, I've come across what I believe to be a bug in if_spppsubr.c. I have verified that it also exists in 4-STABLE. When using PPP encapsulation and header compression, m->m_pkthdr.len is never adjusted after the call to sl_compress_tcp(). Included is a patch against 4-STABLE that seems to fix the problem. regards, jacques --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ppp.patch" --- if_spppsubr.c.orig Mon Sep 29 14:12:17 2003 +++ if_spppsubr.c Mon Sep 29 14:17:31 2003 @@ -778,6 +778,7 @@ int s, rv = 0; int ipproto = PPP_IP; int debug = ifp->if_flags & IFF_DEBUG; + int uc_len; s = splimp(); @@ -864,7 +865,9 @@ * Do IP Header compression */ if (sp->pp_mode != IFF_CISCO && (sp->ipcp.flags & IPCP_VJ) && - ip->ip_p == IPPROTO_TCP) + ip->ip_p == IPPROTO_TCP) { + uc_len = m->m_len; + switch (sl_compress_tcp(m, ip, sp->pp_comp, sp->ipcp.compress_cid)) { case TYPE_COMPRESSED_TCP: @@ -881,6 +884,10 @@ splx(s); return (EINVAL); } + + if (m->m_flags & M_PKTHDR) + m->m_pkthdr.len += m->m_len - uc_len; + } } #endif --k+w/mQv8wyuph6w0--