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
 
 

Reply via email to