Date: Tue, 15 Feb 2005 00:30:21 GMT From: "Wojciech A. Koszek" <dunstan@freebsd.czest.pl> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/77111: After pppd establishes connection, if "options MAC" is enabled in the kernel, kernel panic happens. Message-ID: <200502150030.j1F0ULwb027203@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/77111; it has been noted by GNATS. From: "Wojciech A. Koszek" <dunstan@freebsd.czest.pl> To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/77111: After pppd establishes connection, if "options MAC" is enabled in the kernel, kernel panic happens. Date: Tue, 15 Feb 2005 00:32:24 +0000 --mYCpIKhGyMATD0i+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, I'm not able to test it in working environment right now, but attached patch should correct this problem. Needs testing. The problem is that mac_check_ifnet_transmit() needs to have packet header in passed mbuf. This function is called from: pppwrite() -- pppoutput() -- mac_check_ifnet_transmit(). Attached patch should correct this problem. -- * Wojciech A. Koszek && dunstan@FreeBSD.czest.pl --mYCpIKhGyMATD0i+ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="diff.0.ppp_tty.c" Patch against FreeBSD 5.3-STABLE, kern.osreldate: 503102. diff -upr /usr/src/sys/net/ppp_tty.c src/sys/net/ppp_tty.c --- /usr/src/sys/net/ppp_tty.c Sat Feb 12 09:36:38 2005 +++ src/sys/net/ppp_tty.c Tue Feb 15 00:29:38 2005 @@ -396,6 +396,16 @@ pppwrite(tp, uio, flag) splx(s); return (ENOBUFS); } + /* + * mbuf has to hold packet header in order to pass tests made by + * mac_check_ifnet_transmit() in pppoutput(), when MAC is present in + * the kernel. + */ + if (!(m->m_flags & M_PKTHDR)) { + m_free(m0); + splx(s); + return (EIO); + } m->m_len = 0; if (uio->uio_resid >= MCLBYTES / 2) MCLGET(m, M_DONTWAIT); --mYCpIKhGyMATD0i+--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200502150030.j1F0ULwb027203>