]> git.ozlabs.org Git - ppp.git/blobdiff - modules/ppp_ahdlc.c
define ULTRIX so we know where we are
[ppp.git] / modules / ppp_ahdlc.c
index ba4f41c126b6276c31b64fe844118d6b3797e59d..208f1d682756be77668d716e0a5f388b71ae9f12 100644 (file)
  * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
  * OR MODIFICATIONS.
  *
- * $Id: ppp_ahdlc.c,v 1.1 1995/12/11 05:06:42 paulus Exp $
+ * $Id: ppp_ahdlc.c,v 1.4 1996/09/14 05:19:18 paulus Exp $
  */
 
 /*
- * This file is used under Solaris 2, SVR4, SunOS 4, and OSF/1.
+ * This file is used under Solaris 2, SVR4, SunOS 4, and Digital UNIX.
  */
 #include <sys/types.h>
 #include <sys/param.h>
@@ -66,8 +66,9 @@ static int msg_byte __P((mblk_t *, unsigned int));
 /* Is this LCP packet one we have to transmit using LCP defaults? */
 #define LCP_USE_DFLT(mp)       (1 <= (code = MSG_BYTE((mp), 4)) && code <= 7)
 
+#define PPP_AHDL_ID 0x7d23
 static struct module_info minfo = {
-    0x7d23, "ppp_ahdl", 0, INFPSZ, 4096, 128
+    PPP_AHDL_ID, "ppp_ahdl", 0, INFPSZ, 4096, 128
 };
 
 static struct qinit rinit = {
@@ -78,6 +79,10 @@ static struct qinit winit = {
     ahdlc_wput, NULL, NULL, NULL, NULL, &minfo, NULL
 };
 
+#if defined(SVR4) && !defined(SOL2)
+int phdldevflag = 0;
+#define ppp_ahdlcinfo phdlinfo
+#endif
 struct streamtab ppp_ahdlcinfo = {
     &rinit, &winit, NULL, NULL
 };
@@ -215,7 +220,7 @@ ahdlc_wput(q, mp)
                break;
            bcopy((caddr_t)mp->b_cont->b_rptr, (caddr_t)state->xaccm,
                  iop->ioc_count);
-           state->xaccm[2] &= 0x40000000;      /* don't escape 0x5e */
+           state->xaccm[2] &= ~0x40000000;     /* don't escape 0x5e */
            state->xaccm[3] |= 0x60000000;      /* do escape 0x7d, 0x7e */
            iop->ioc_count = 0;
            error = 0;
@@ -623,10 +628,11 @@ unstuff_chars(q, mp)
                    putnext(q, om);             /* bombs away! */
                    continue;
                }
-               DPRINT1("ppp_ahdl: bad fcs %x\n", state->infcs);
+               DPRINT2("ppp%d: bad fcs (len=%d)\n", state->unit, len);
            }
            if (om != 0)
                freemsg(om);
+           state->flags &= ~(IFLUSH|ESCAPED);
            state->stats.ppp_ierrors++;
            putctl1(q->q_next, M_CTL, PPPCTL_IERROR);
            continue;
@@ -662,7 +668,8 @@ unstuff_chars(q, mp)
                 */
                if (state->inlen >= state->mru + PPP_HDRLEN + PPP_FCSLEN) {
                    state->flags |= IFLUSH;
-                   DPRINT1("ppp_ahdl: frame too long (%d)\n", state->inlen);
+                   DPRINT2("ppp%d: frame too long (%d)\n",
+                           state->unit, state->inlen);
                    continue;
                }
                om = allocb(IFRAME_BSIZE, BPRI_MED);