Date: Mon, 29 Sep 2003 14:26:01 +0200 From: Jacques Fourie <jf@trispen.com> To: freebsd-hackers@freebsd.org Subject: Bug in if_spppsubr.c ? Message-ID: <20030929142601.A71290@trispen.com>
next in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030929142601.A71290>