]> git.ozlabs.org Git - ppp.git/commitdiff
Check which compressors are supported in the kernel before
authorPaul Mackerras <paulus@samba.org>
Thu, 4 Apr 1996 03:35:37 +0000 (03:35 +0000)
committerPaul Mackerras <paulus@samba.org>
Thu, 4 Apr 1996 03:35:37 +0000 (03:35 +0000)
deciding whether to open CCP in silent mode or not.

pppd/ccp.c

index 6f3c1ea52e5687cef1faf865f6a255842d112567..a0eb2ad0d2d3da113cb5cdc762b5aa3c59cbf5f8 100644 (file)
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: ccp.c,v 1.15 1996/01/18 03:20:25 paulus Exp $";
+static char rcsid[] = "$Id: ccp.c,v 1.16 1996/04/04 03:35:37 paulus Exp $";
 #endif
 
 #endif
 
+#include <string.h>
 #include <syslog.h>
 #include <sys/ioctl.h>
 #include <net/ppp-comp.h>
 #include <syslog.h>
 #include <sys/ioctl.h>
 #include <net/ppp-comp.h>
@@ -142,8 +143,15 @@ ccp_open(unit)
 
     if (f->state != OPENED)
        ccp_flags_set(unit, 1, 0);
 
     if (f->state != OPENED)
        ccp_flags_set(unit, 1, 0);
-    if (!ANY_COMPRESS(ccp_wantoptions[unit]))
+
+    /*
+     * Find out which compressors the kernel supports before
+     * deciding whether to open in silent mode.
+     */
+    ccp_resetci(f);
+    if (!ANY_COMPRESS(ccp_gotoptions[unit]))
        f->flags |= OPT_SILENT;
        f->flags |= OPT_SILENT;
+
     fsm_open(f);
 }
 
     fsm_open(f);
 }
 
@@ -259,7 +267,6 @@ static void
 ccp_resetci(f)
     fsm *f;
 {
 ccp_resetci(f)
     fsm *f;
 {
-    int ok;
     ccp_options *go = &ccp_gotoptions[f->unit];
     u_char opt_buf[16];
 
     ccp_options *go = &ccp_gotoptions[f->unit];
     u_char opt_buf[16];