set receive characteristics when we send an ack
authorPaul Mackerras <paulus@samba.org>
Fri, 16 Sep 1994 02:15:37 +0000 (02:15 +0000)
committerPaul Mackerras <paulus@samba.org>
Fri, 16 Sep 1994 02:15:37 +0000 (02:15 +0000)
so we don't miss stuff immediately following their ack

pppd/lcp.c

index eb5f1c51741075947fc3b5b5eaaf06d35dd6ce04..f215a76d822d4771154d58a5b990f3656f9585fe 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: lcp.c,v 1.12 1994/09/01 00:24:14 paulus Exp $";
+static char rcsid[] = "$Id: lcp.c,v 1.13 1994/09/16 02:15:37 paulus Exp $";
 #endif
 
 /*
@@ -252,7 +252,23 @@ lcp_input(unit, p, len)
     u_char *p;
     int len;
 {
-    fsm_input(&lcp_fsm[unit], p, len);
+    int oldstate;
+    fsm *f = &lcp_fsm[unit];
+    lcp_options *go = &lcp_gotoptions[f->unit];
+
+    oldstate = f->state;
+    fsm_input(f, p, len);
+    if (oldstate == REQSENT && f->state == ACKSENT) {
+       /*
+        * The peer will probably send us an ack soon and then
+        * immediately start sending packets with the negotiated
+        * options.  So as to be ready when that happens, we set
+        * our receive side to accept packets as negotiated now.
+        */
+       ppp_recv_config(f->unit, MTU,
+                       go->neg_asyncmap? go->asyncmap: 0x00000000,
+                       go->neg_pcompression, go->neg_accompression);
+    }
 }