From 4349bf86b048a36b5e2c68ad3c2263b4d5b7e7e9 Mon Sep 17 00:00:00 2001 From: chuck Date: Fri, 24 Jan 1997 20:57:53 +0000 Subject: bug fix: - if aal5 frame has a CRC error then the length field in the aal5 trailer may not be valid, so we can not use it [and we must dump the frame] [Yuhang Sun & chuck@ccrc.wustl.edu] --- sys/dev/ic/midway.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys') diff --git a/sys/dev/ic/midway.c b/sys/dev/ic/midway.c index b9376231650..dac68671317 100644 --- a/sys/dev/ic/midway.c +++ b/sys/dev/ic/midway.c @@ -1,5 +1,5 @@ -/* $OpenBSD: midway.c,v 1.18 1996/11/21 20:53:04 chuck Exp $ */ -/* (sync'd to midway.c 1.64) */ +/* $OpenBSD: midway.c,v 1.19 1997/01/24 20:57:52 chuck Exp $ */ +/* (sync'd to midway.c 1.65) */ /* * @@ -2443,8 +2443,8 @@ defer: /* defer processing */ pdu -= (EN_RXSZ*1024); pdu = EN_READ(sc, pdu); /* READ swaps to proper byte order */ fill = tlen - MID_RBD_SIZE - MID_PDU_LEN(pdu); - if (fill < 0) { - printf("%s: invalid AAL5 PDU length detected, dropping frame\n", + if (fill < 0 || (rbd & MID_RBD_CRCERR) != 0) { + printf("%s: invalid AAL5 PDU length or CRC detected, dropping frame\n", sc->sc_dev.dv_xname); printf("%s: got %d cells (%d bytes), AAL5 len is %d bytes (pdu=0x%x)\n", sc->sc_dev.dv_xname, MID_RBD_CNT(rbd), tlen - MID_RBD_SIZE, -- cgit v1.2.3