From: Paul Mackerras Date: Fri, 16 Sep 1994 02:18:01 +0000 (+0000) Subject: added ccp_fatal_error X-Git-Tag: RELEASE_2_3_6~865 X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=3fc0348f0ba4f38c5aecd96b7dccef4684bd53aa added ccp_fatal_error --- diff --git a/pppd/sys-str.c b/pppd/sys-str.c index e34d547..aed7c8e 100644 --- a/pppd/sys-str.c +++ b/pppd/sys-str.c @@ -18,6 +18,10 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ +#ifndef lint +static char rcsid[] = "$Id: sys-str.c,v 1.12 1994/09/16 02:18:01 paulus Exp $"; +#endif + /* * TODO: */ @@ -653,6 +657,24 @@ ccp_flags_set(unit, isopen, isup) syslog(LOG_ERR, "ioctl (SIOCSIFCOMP): %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(unit) + int unit; +{ + int x; + + if (ioctl(fd, SIOCGIFCOMP, (caddr_t) &x) < 0) { + syslog(LOG_ERR, "ioctl(SIOCGIFCOMP): %m"); + return 0; + } + return x & CCP_FATALERROR; +} + /* * sifvjcomp - config tcp header compression */