Date: Mon, 9 Jun 1997 00:49:34 +0000 () From: "Lenzi, Sergio" <lenzi@bsi.com.br> To: freebsd-hackers@freebsd.org Subject: pppd & natd problem turnaround.. Message-ID: <Pine.BSF.3.91.970609004516.1188A-100000@sergio>
next in thread | raw e-mail | index | archive | help
Hello all. I have seen some messages dealing with pppd & natd panicing FreeBSD 2.2 systems. The problem arises when a negative m->m_len value is reveived in function pppfcs in module sys/net/ppp_tty.c A turnaround is to replace m_len to ZERO whenever is less then zero. I know it is not the best, but it works for now. Here is the patch. --- ppp_tty.old Sat Jun 7 18:10:32 1997 +++ ppp_tty.c Sun Jun 8 21:51:26 1997 @@ -573,7 +573,7 @@ register u_char *cp; register int len; { - while (len--) + while (len-- > 0) fcs = PPP_FCS(fcs, *cp++); return (fcs); } @@ -775,6 +775,8 @@ sc->sc_if.if_obytes = sc->sc_bytessent; break; } + if (m->m_len < 0) + m->m_len=0; sc->sc_outfcs = pppfcs(sc->sc_outfcs, mtod(m, u_char *), m->m_len); } Sergio Lenzi. Unix consult.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.970609004516.1188A-100000>