Date: Sun, 5 Nov 2000 12:52:26 +0200 From: "Ido Barnea" <ido@cwnt.com> To: <hackers@FreeBSD.ORG> Subject: sppp driver bug? Message-ID: <001c01c04716$7c710c50$9200a8c0@ido>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. ------=_NextPart_000_0019_01C04727.3FF3C1D0 Content-Type: text/plain; charset="windows-1255" Content-Transfer-Encoding: quoted-printable Hi I am trying to use the sppp driver of the 4.1FreeBSD to establish ip = connection over ppp between two pc's. It usually works, but in a small percentage of the cases one of the = interfaces gets stack in the following state: lcp is in state closed and ipcp is in state closed (I know that for sure = from debug prints I added). The real problem is that nothing seems to get the interface out of its = "problematic" state. (I tried putting it down and up, transferring it to = hdlc and back and more...) I think the following change in sppp_lcp_tld will enable the interface = to recover using ifconfig down and up. original lines: for (i =3D 0, mask =3D 1; i < IDX_COUNT; i++, mask <<=3D 1) if (sp->lcp.protos & mask && ((cps[i])->flags & CP_LCP) =3D=3D 0) { My suggested lines: for (i =3D 0; i < IDX_COUNT; i++) if (((cps[i])->flags & CP_LCP) =3D=3D 0) { The idea here is that since the ipcp is in closed state, its bit in the = lcp.protos is not set, so it never receives the down and close event (inside the if). It also does not put the bit on = when getting open event (since it is in the stopped state), so it never = receives up event in sppp_lcp_tlu. If anyone has an idea why the interface gets stack in the first place, = I'll be very glad to hear. I also want to know if my code change seems reasonable. Thanks, Ido ------=_NextPart_000_0019_01C04727.3FF3C1D0 Content-Type: text/html; charset="windows-1255" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Dwindows-1255" = http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.2014.210" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>Hi</FONT></DIV> <DIV><FONT face=3DArial size=3D2> I am trying to use the sppp = driver of the=20 4.1FreeBSD to establish ip connection over ppp between two=20 pc's.</FONT></DIV> <DIV><FONT face=3D"ARIAL (HEBREW)" size=3D2> It usually works, but = in a small=20 percentage of the cases one of the interfaces gets stack in the = following=20 state:</FONT></DIV> <DIV><FONT face=3D"ARIAL (HEBREW)" size=3D2>lcp is in state closed and = ipcp is in=20 state closed (I know that for sure from debug prints I = added).</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3D"ARIAL (HEBREW)" size=3D2>The real problem is that = nothing seems=20 to get the interface out of its "problematic" state. (I = tried putting it=20 down and up, transferring it to hdlc and back and more...)</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3D"ARIAL (HEBREW)" size=3D2>I think the following change = in=20 sppp_lcp_tld will enable the interface to recover using ifconfig down = and=20 up.</FONT></DIV> <DIV><FONT face=3DArial size=3D2>original lines:</FONT></DIV> <DIV><FONT face=3DArial size=3D2> <DIV><FONT face=3D"ARIAL (HEBREW)" size=3D2> <FONT = face=3DArial> for (i =3D 0,=20 mask =3D 1; i < IDX_COUNT; i++, mask <<=3D 1)<BR> if = (sp->lcp.protos & mask && ((cps[i])->flags & = CP_LCP) =3D=3D 0)=20 {</FONT></FONT></DIV> <DIV> </DIV></FONT></DIV> <DIV><FONT face=3D"ARIAL (HEBREW)" size=3D2>My suggested = lines:</FONT></DIV> <DIV><FONT face=3DArial size=3D2> for (i =3D 0; i < IDX_COUNT;=20 i++)<BR> if (((cps[i])->flags & = CP_LCP) =3D=3D=20 0) {</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3D"ARIAL (HEBREW)" size=3D2>The idea here is that since = the ipcp is=20 in closed state, its bit in the lcp.protos is not set, so it never = receives=20 the</FONT></DIV> <DIV><FONT face=3D"ARIAL (HEBREW)" size=3D2>down and close event (inside = the if). It=20 also does not put the bit on when getting open event (since it is in the = stopped=20 state), so it never receives up event in sppp_lcp_tlu.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3D"ARIAL (HEBREW)" size=3D2>If anyone has an idea why = the interface=20 gets stack in the first place, I'll be very glad to hear.</FONT></DIV> <DIV><FONT face=3D"ARIAL (HEBREW)" size=3D2>I also want to know if = my code=20 change seems reasonable.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3D"ARIAL (HEBREW)" size=3D2>Thanks, Ido</FONT></DIV> <DIV> </DIV> <DIV> </DIV></BODY></HTML> ------=_NextPart_000_0019_01C04727.3FF3C1D0-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001c01c04716$7c710c50$9200a8c0>