]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/fsm.c
restored id keyword
[ppp.git] / pppd / fsm.c
index 23d6773307474a4277045a284a5066584904d784..902ad64cbbc2733132ef69b3571fb3de20e441f6 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: fsm.c,v 1.1 1993/11/11 03:54:25 paulus Exp $";
+static char rcsid[] = "$Id: fsm.c,v 1.3 1994/05/24 11:21:10 paulus Exp $";
 #endif
 
 /*
@@ -29,7 +29,6 @@ static char rcsid[] = "$Id: fsm.c,v 1.1 1993/11/11 03:54:25 paulus Exp $";
 
 #include <stdio.h>
 #include <sys/types.h>
-/*#include <malloc.h>*/
 #include <syslog.h>
 
 #include "ppp.h"
@@ -408,6 +407,8 @@ fsm_rconfreq(f, id, inp, len)
        code = (*f->callbacks->reqci)(f, inp, &len, reject_if_disagree);
     } else if (len)
        code = CONFREJ;                 /* Reject all CI */
+    else
+       code = CONFACK;
 
     /* send the Ack, Nak or Rej to the peer */
     fsm_sdata(f, code, id, inp, len);
@@ -453,6 +454,7 @@ fsm_rconfack(f, id, inp, len)
                  PROTO_NAME(f), len));
        return;
     }
+    f->reqid = -1;
 
     switch (f->state) {
     case CLOSED:
@@ -514,6 +516,7 @@ fsm_rconfnakrej(f, code, id, inp, len)
                  PROTO_NAME(f), (code==CONFNAK? "Nak": "reject"), len));
        return;
     }
+    f->reqid = -1;
 
     switch (f->state) {
     case CLOSED:
@@ -556,7 +559,6 @@ fsm_rtermreq(f, id)
     FSMDEBUG((LOG_INFO, "fsm_rtermreq(%s): Rcvd id %d.",
              PROTO_NAME(f), id));
 
-    fsm_sdata(f, TERMACK, id, NULL, 0);
     switch (f->state) {
     case ACKRCVD:
     case ACKSENT:
@@ -572,6 +574,8 @@ fsm_rtermreq(f, id)
        TIMEOUT(fsm_timeout, (caddr_t) f, f->timeouttime);
        break;
     }
+
+    fsm_sdata(f, TERMACK, id, NULL, 0);
 }
 
 
@@ -714,11 +718,11 @@ fsm_sconfreq(f, retransmit)
     /*
      * Make up the request packet
      */
+    outp = outpacket_buf + DLLHEADERLEN + HEADERLEN;
     if( f->callbacks->cilen && f->callbacks->addci ){
        cilen = (*f->callbacks->cilen)(f);
        if( cilen > peer_mru[f->unit] - HEADERLEN )
            cilen = peer_mru[f->unit] - HEADERLEN;
-       outp = outpacket_buf + DLLHEADERLEN + HEADERLEN;
        if (f->callbacks->addci)
            (*f->callbacks->addci)(f, outp, &cilen);
     } else