]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/ccp.c
use crtscts = -2 to indicate xon/xoff
[ppp.git] / pppd / ccp.c
index 0ecfc97e281233099182818c316621580f697732..ae6795228c64655c07e427ae6f944213631ce7b3 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: ccp.c,v 1.9 1995/05/19 03:17:09 paulus Exp $";
+static char rcsid[] = "$Id: ccp.c,v 1.11 1995/08/16 04:15:38 paulus Exp $";
 #endif
 
 #include <syslog.h>
@@ -109,6 +109,7 @@ ccp_init(unit)
     memset(&ccp_allowoptions[unit], 0, sizeof(ccp_options));
     memset(&ccp_hisoptions[unit],   0, sizeof(ccp_options));
 
+    ccp_wantoptions[0].bsd_compress = 1;
     ccp_wantoptions[0].bsd_bits = 12;  /* default value */
 
     ccp_allowoptions[0].bsd_compress = 1;
@@ -181,6 +182,14 @@ ccp_input(unit, p, len)
     fsm_input(f, p, len);
     if (oldstate == OPENED && p[0] == TERMREQ && f->state != OPENED)
        syslog(LOG_NOTICE, "Compression disabled by peer.");
+
+    /*
+     * If we get a terminate-ack and we're not asking for compression,
+     * close CCP.
+     */
+    if (oldstate == REQSENT && p[0] == TERMACK
+       && !ANY_COMPRESS(ccp_gotoptions[unit]))
+       ccp_close(unit);
 }
 
 /*