Here is a patch to clean up the interface between the tty-drivers, in
particular the com driver, and the sl# interfaces, this is not a work-around
but a genuine bug-fix.
Symptoms: after a number of "com#: silo overflow" SLIP ceases to work.
Overview of the problem: the slip interface will disregard any notice
from the tty-driver on problems (parity errors, framing errors or overruns),
which basicly means the one might as well throw the packet away right away.
Also overrun in the packetizing will go relatively unnotized.
AUTHOR: Poul-Henning Kamp (phk@data.fls.dk)
386BSD-Patchkit: patch00019
*
* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
* -------------------- ----- ----------------------
*
* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
* -------------------- ----- ----------------------
- * CURRENT PATCH LEVEL: 1 00018
+ * CURRENT PATCH LEVEL: 2 00019
* -------------------- ----- ----------------------
*
* -------------------- ----- ----------------------
*
+ * 30 Aug 92 Poul-Henning Kamp Stabilize SLIP on lossy lines/UARTS
* 09 Aug 92 Christoph Robitschko Correct minor number on com ports
*/
static char rcsid[] = "$Header: /usr/bill/working/sys/i386/isa/RCS/com.c,v 1.2 92/01/21 14:34:11 william Exp $";
* 09 Aug 92 Christoph Robitschko Correct minor number on com ports
*/
static char rcsid[] = "$Header: /usr/bill/working/sys/i386/isa/RCS/com.c,v 1.2 92/01/21 14:34:11 william Exp $";
c |= TTY_FE;
else if (stat & LSR_PE)
c |= TTY_PE;
c |= TTY_FE;
else if (stat & LSR_PE)
c |= TTY_PE;
- else if (stat & LSR_OE)
+ else if (stat & LSR_OE) { /* 30 Aug 92*/
+ c |= TTY_PE; /* Ought to have it's own define... */
log(LOG_WARNING, "com%d: silo overflow\n", unit);
log(LOG_WARNING, "com%d: silo overflow\n", unit);
(*linesw[tp->t_line].l_rint)(c, tp);
}
(*linesw[tp->t_line].l_rint)(c, tp);
}
* SUCH DAMAGE.
*
* @(#)if_sl.c 7.22 (Berkeley) 4/20/91
* SUCH DAMAGE.
*
* @(#)if_sl.c 7.22 (Berkeley) 4/20/91
+ *
+ * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
+ * -------------------- ----- ----------------------
+ * CURRENT PATCH LEVEL: 1 00019
+ * -------------------- ----- ----------------------
+ *
+ * 30 Aug 92 Poul-Henning Kamp Stabilize SLIP on lossy lines/UARTS
sc = (struct sl_softc *)tp->t_sc;
if (sc == NULL)
return;
sc = (struct sl_softc *)tp->t_sc;
if (sc == NULL)
return;
- if (!(tp->t_state&TS_CARR_ON)) /* XXX */
+ if (c > 255 || !(tp->t_state&TS_CARR_ON)) { /* XXX 30 Aug 92*/
+ sc->sc_flags |= SC_ERROR;
++sc->sc_bytesrcvd;
++sc->sc_if.if_ibytes;
++sc->sc_bytesrcvd;
++sc->sc_if.if_ibytes;
+ if(sc->sc_flags & SC_ERROR) { /* 30 Aug 92*/
+ sc->sc_flags &= ~SC_ERROR;
+ goto newpack;
+ }
len = sc->sc_mp - sc->sc_buf;
len = sc->sc_mp - sc->sc_buf;
if (len < 3)
/* less than min length packet - ignore */
goto newpack;
if (len < 3)
/* less than min length packet - ignore */
goto newpack;
sc->sc_escape = 0;
return;
}
sc->sc_escape = 0;
return;
}
+ sc->sc_flags |= SC_ERROR; /* 30 Aug 92*/
error:
sc->sc_if.if_ierrors++;
newpack:
error:
sc->sc_if.if_ierrors++;
newpack:
* @(#)if_slvar.h 7.7 (Berkeley) 5/7/91
*
* $Header: if_slvar.h,v 1.3 89/05/31 02:25:18 van Exp $
* @(#)if_slvar.h 7.7 (Berkeley) 5/7/91
*
* $Header: if_slvar.h,v 1.3 89/05/31 02:25:18 van Exp $
+ *
+ * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
+ * -------------------- ----- ----------------------
+ * CURRENT PATCH LEVEL: 1 00019
+ * -------------------- ----- ----------------------
+ *
+ * 30 Aug 92 Poul-Henning Kamp Stabilize SLIP on lossy lines/UARTS
#define SC_NOICMP 0x0004 /* supress ICMP traffic */
#define SC_AUTOCOMP 0x0008 /* auto-enable TCP compression */
/* internal flags (should be separate) */
#define SC_NOICMP 0x0004 /* supress ICMP traffic */
#define SC_AUTOCOMP 0x0008 /* auto-enable TCP compression */
/* internal flags (should be separate) */
+#define SC_ERROR 0x08000 /* had an input error - 30 Aug 92*/
#define SC_ABORT 0x10000 /* have been sent an abort request */
/* this stuff doesn't belong here... */
#define SC_ABORT 0x10000 /* have been sent an abort request */
/* this stuff doesn't belong here... */