From nobody  Wed Jul 16 09:14:29 1997
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.5/8.8.5) id JAA19742;
          Wed, 16 Jul 1997 09:14:29 -0700 (PDT)
Message-Id: <199707161614.JAA19742@hub.freebsd.org>
Date: Wed, 16 Jul 1997 09:14:29 -0700 (PDT)
From: unger@raindrop.seaslug.org
To: freebsd-gnats-submit@freebsd.org
Subject: User level ppp stops communicating - source code patch included.
X-Send-Pr-Version: www-1.0

>Number:         4102
>Category:       bin
>Synopsis:       User level ppp stops communicating - source code patch included.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 16 09:20:01 PDT 1997
>Closed-Date:    Sun Aug 17 13:53:22 PDT 1997
>Last-Modified:  Sun Aug 17 13:55:06 PDT 1997
>Originator:     Tom Unger
>Release:        2.2.1
>Organization:
Wet Weather Consulting
>Environment:
FreeBSD raindrop.seaslug.org 2.2.1-RELEASE FreeBSD 2.2.1-RELEASE #0: Mon Jun 23 11:13:15 PDT 1997     rootz@raindrop.seaslug.org:/usr/src/sys/compile/RAINDROP  i386

>Description:

When I first set up user level ppp to auto dial my ISP I found that it
would run OK for a day or two then just stop working.  Sometimes a failure
to connect to my ISP would cause my PPP process to go into a STOPPED
state.  Finally I tracked it down to something in fsm.c, changed the state
transition so that ppp would go back to its initial state.  This fixed the
problem.  ppp will now run for weeks in auto mode, plugging away at
connection after connection.
        
I've applied the same fix to the new version of ppp distributed with
freeBSD 2.2.1.  Please consider incorporating it into your source code.

I've also sent this to the authors of ppp.
        
                                                      ooooo
 -- Tom Unger                                       oo\    oo
    Wet Weather Consulting                         o   \     o
    (206)325-7403                                 o  B I\V I  o
                                                   o     \   o
                                                    oo    \oo
                                                      ooooo

>How-To-Repeat:

>Fix:
diff -c ppp2.2/fsm.c ppp2.2-local/fsm.c
*** ppp2.2/fsm.c        Wed Jul 16 08:59:40 1997
--- ppp2.2-local/fsm.c  Wed Jul 16 09:00:57 1997
***************
*** 292,299 ****
        NewState(fp, ST_STOPPED);
        (fp->LayerFinish)(fp);
        break;
-     case ST_REQSENT:          /* XXX: 3p */
      case ST_ACKSENT:
      case ST_ACKRCVD:
        NewState(fp, ST_STOPPED);
        (fp->LayerFinish)(fp);
--- 292,308 ----
        NewState(fp, ST_STOPPED);
        (fp->LayerFinish)(fp);
        break;
      case ST_ACKSENT:
+       /* 7/1997, unger:  ST_ACKSENT was combined with the following states
+        * in going to ST_STOPPED.  A common error condition with my ISP
+        * would bring it to here which stopped all furhter communication.
+        * I've changed this state to go to ST_INITIAL instead. */
+       LogPrintf(LOG_LCP, "%s: TIMEOUT, goto initial, not stoped\n",
+           fp->name);
+       NewState(fp, ST_INITIAL);
+       (fp->LayerFinish)(fp);
+       break;
+     case ST_REQSENT:          /* XXX: 3p */
      case ST_ACKRCVD:
        NewState(fp, ST_STOPPED);
        (fp->LayerFinish)(fp);

>Release-Note:
>Audit-Trail:

From: j@uriah.heep.sax.de (J Wunsch)
To: unger@raindrop.seaslug.org
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: bin/4102: User level ppp stops communicating - source code patch included.
Date: Thu, 17 Jul 1997 08:45:05 +0200

 As unger@raindrop.seaslug.org wrote:
 
 >       case ST_ACKSENT:
 > +       /* 7/1997, unger:  ST_ACKSENT was combined with the following states
 > +        * in going to ST_STOPPED.  A common error condition with my ISP
 > +        * would bring it to here which stopped all furhter communication.
 > +        * I've changed this state to go to ST_INITIAL instead. */
 > +       LogPrintf(LOG_LCP, "%s: TIMEOUT, goto initial, not stoped\n",
 > +           fp->name);
 > +       NewState(fp, ST_INITIAL);
 > +       (fp->LayerFinish)(fp);
 > +       break;
 > +     case ST_REQSENT:          /* XXX: 3p */
 
 This hack violates RFC 1661.  Note that the PPP protocol state
 machines are dictated by this RFC, their state transitions are not
 left open to the implementator.
 
 Going to `initial' state is entirely wrong.  This would, by
 definition, require to get `Close' _and_ `Down' events before, in any
 case.
 
 I suggest rejecting this PR, but leave the final decision to Brian,
 maybe he's got another idea how to handle your situation.
 
 -- 
 cheers, J"org
 
 joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
 Never trust an operating system you don't have sources for. ;-)

From: Thomas Unger <unger@raindrop.seaslug.org>
To: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: bin/4102: User level ppp stops communicating - source code patch included.
Date: Thu, 17 Jul 1997 09:21:57 -0700 (PDT)

 On Thu, 17 Jul 1997, J Wunsch wrote:
 
 > Date: Thu, 17 Jul 1997 08:45:05 +0200
 > From: J Wunsch <j@uriah.heep.sax.de>
 > Reply-To: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
 > To: unger@raindrop.seaslug.org
 > Cc: freebsd-gnats-submit@FreeBSD.ORG
 > Subject: Re: bin/4102: User level ppp stops communicating - source code patch included.
 > 
 > As unger@raindrop.seaslug.org wrote:
 > 
 > >       case ST_ACKSENT:
 > > +       /* 7/1997, unger:  ST_ACKSENT was combined with the following states
 > > +        * in going to ST_STOPPED.  A common error condition with my ISP
 > > +        * would bring it to here which stopped all furhter communication.
 > > +        * I've changed this state to go to ST_INITIAL instead. */
 > > +       LogPrintf(LOG_LCP, "%s: TIMEOUT, goto initial, not stoped\n",
 > > +           fp->name);
 > > +       NewState(fp, ST_INITIAL);
 > > +       (fp->LayerFinish)(fp);
 > > +       break;
 > > +     case ST_REQSENT:          /* XXX: 3p */
 > 
 > This hack violates RFC 1661.  Note that the PPP protocol state
 > machines are dictated by this RFC, their state transitions are not
 > left open to the implementator.
 > 
 > Going to `initial' state is entirely wrong.  This would, by
 > definition, require to get `Close' _and_ `Down' events before, in any
 > case.
 > 
 > I suggest rejecting this PR, but leave the final decision to Brian,
 > maybe he's got another idea how to handle your situation.
 
 
 OK, I didn't know that.  
 
 The behavior that I see is that the call fails to negociate a full PPP
 connection then terminates.  My PPP process would go into this stopped
 state and NOT MAKE ANY MORE CALLS.  Since I leave it running in -auto mode
 I would have to 1. notice that it has stopped functioning and 2. kill and
 restart the process. 
 
 There should be a way to change the ppp source code that does not violate
 the RFC but also always restores ppp to a state where it is ready to start
 another call.
 
 Thanks,
 
 Tom.
 
 
State-Changed-From-To: open->closed 
State-Changed-By: brian 
State-Changed-When: Sun Aug 17 13:53:22 PDT 1997 
State-Changed-Why:  
This is now fixable with the "set stopped" directive 
committed to -current today.  This is also available as 
a tarball at http://www.freebsd.org/~brian. 
>Unformatted:
