Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Don't copy Rx packet to mbuf if it has invalid le...



details:   https://anonhg.NetBSD.org/src/rev/abfa314b8b44
branches:  trunk
changeset: 502090:abfa314b8b44
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Thu Jan 11 14:38:58 2001 +0000

description:
Don't copy Rx packet to mbuf if it has invalid length; just discard it.
Fixes kern/11877.

diffstat:

 sys/dev/ic/rtl81x9.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r bbb7276f2af8 -r abfa314b8b44 sys/dev/ic/rtl81x9.c
--- a/sys/dev/ic/rtl81x9.c      Thu Jan 11 14:25:27 2001 +0000
+++ b/sys/dev/ic/rtl81x9.c      Thu Jan 11 14:38:58 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtl81x9.c,v 1.26 2000/12/19 00:06:01 thorpej Exp $     */
+/*     $NetBSD: rtl81x9.c,v 1.27 2001/01/11 14:38:58 tsutsui Exp $     */
 
 /*
  * Copyright (c) 1997, 1998
@@ -1003,7 +1003,8 @@
                if (total_len == RTK_RXSTAT_UNFINISHED)
                        break;
 
-               if ((rxstat & RTK_RXSTAT_RXOK) == 0) {
+               if ((rxstat & RTK_RXSTAT_RXOK) == 0 ||
+                   total_len > ETHER_MAX_LEN) {
                        ifp->if_ierrors++;
 
                        /*



Home | Main Index | Thread Index | Old Index