Skip site navigation (1)Skip section navigation (2)
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

[-- Attachment #1 --]
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 = 0, mask = 1; i < IDX_COUNT; i++, mask <<= 1)
  if (sp->lcp.protos & mask && ((cps[i])->flags & CP_LCP) == 0) {

My suggested lines:
 for (i = 0; i < IDX_COUNT; i++)
      if (((cps[i])->flags & CP_LCP) == 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



[-- Attachment #2 --]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1255" http-equiv=Content-Type>
<META content="MSHTML 5.00.2014.210" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;I am trying to use the sppp driver of the 
4.1FreeBSD to establish&nbsp;ip connection over ppp between two 
pc's.</FONT></DIV>
<DIV><FONT face="ARIAL (HEBREW)" size=2>&nbsp;It usually works, but in a small 
percentage of the cases one of the interfaces gets stack in the following 
state:</FONT></DIV>
<DIV><FONT face="ARIAL (HEBREW)" size=2>lcp is in state closed and ipcp is in 
state closed (I know that for sure from debug prints I added).</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face="ARIAL (HEBREW)" size=2>The real problem is that nothing seems 
to get the interface out of its "problematic" state. (I tried&nbsp;putting it 
down and up, transferring it to hdlc and back and more...)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face="ARIAL (HEBREW)" size=2>I think the following change in 
sppp_lcp_tld will enable the interface to recover using ifconfig down and 
up.</FONT></DIV>
<DIV><FONT face=Arial size=2>original lines:</FONT></DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face="ARIAL (HEBREW)" size=2>&nbsp;<FONT face=Arial>&nbsp;for (i = 0, 
mask = 1; i &lt; IDX_COUNT; i++, mask &lt;&lt;= 1)<BR>&nbsp;&nbsp;if 
(sp-&gt;lcp.protos &amp; mask &amp;&amp; ((cps[i])-&gt;flags &amp; CP_LCP) == 0) 
{</FONT></FONT></DIV>
<DIV>&nbsp;</DIV></FONT></DIV>
<DIV><FONT face="ARIAL (HEBREW)" size=2>My suggested lines:</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;for (i = 0; i &lt; IDX_COUNT; 
i++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (((cps[i])-&gt;flags &amp; CP_LCP) == 
0) {</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face="ARIAL (HEBREW)" size=2>The idea here is that since the ipcp is 
in closed state, its&nbsp;bit in the lcp.protos is not set, so it never receives 
the</FONT></DIV>
<DIV><FONT face="ARIAL (HEBREW)" size=2>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.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face="ARIAL (HEBREW)" size=2>If anyone has an idea why the interface 
gets stack in the first place, I'll be very glad to hear.</FONT></DIV>
<DIV><FONT face="ARIAL (HEBREW)" size=2>I also want to know if my&nbsp;code 
change seems reasonable.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face="ARIAL (HEBREW)" size=2>Thanks, Ido</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001c01c04716$7c710c50$9200a8c0>