- return;
- }
- x = isopen? x | SC_CCP_OPEN: x &~ SC_CCP_OPEN;
- x = isup? x | SC_CCP_UP: x &~ SC_CCP_UP;
- if (ioctl(fd, PPPIOCSFLAGS, (caddr_t) &x) < 0)
- syslog(LOG_ERR, "ioctl(PPPIOCSFLAGS): %m");
-}
+ }
+ else
+ {
+ x = isopen? x | SC_CCP_OPEN : x &~ SC_CCP_OPEN;
+ x = isup? x | SC_CCP_UP : x &~ SC_CCP_UP;
+
+ if (ioctl(fd, PPPIOCSFLAGS, (caddr_t) &x) < 0)
+ {
+ syslog(LOG_ERR, "ioctl(PPPIOCSFLAGS): %m");
+ }
+ }
+ }
+
+/*
+ * ccp_fatal_error - returns 1 if decompression was disabled as a
+ * result of an error detected after decompression of a packet,
+ * 0 otherwise. This is necessary because of patent nonsense.
+ */
+
+int ccp_fatal_error (int unit)
+ {
+ int x;
+
+ if (ioctl(fd, PPPIOCGFLAGS, (caddr_t) &x) < 0)
+ {
+ syslog(LOG_ERR, "ioctl(PPPIOCGFLAGS): %m");
+ return 0;
+ }
+ return x & SC_DC_FERROR;
+ }