Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Apr 2011 20:41:35 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r220343 - stable/7/sys/dev/fxp
Message-ID:  <201104042041.p34KfZOp095173@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Mon Apr  4 20:41:35 2011
New Revision: 220343
URL: http://svn.freebsd.org/changeset/base/220343

Log:
  MFC r220103:
    Normally fxp(4) does not receive bad frames but promiscuous mode
    makes controller to receive bad frames and i82557 will also receive
    bad frames since fxp(4) have to receive VLAN oversized frames. If
    fxp(4) encounter DMA overrun error, the received frame size would
    be 0 so the actual frame size after checksum field extraction the
    length would be negative(-2). Due to signed/unsigned comparison
    used in driver, frame length check did not work for DMA overrun
    frames. Correct this by casting it to int.
    While I'm here explicitly check DMA overrun error and discard the
    frame regardless of result of received frame length check.
  
    Reported by:	n_hibma
    Tested by:	n_hibma

Modified:
  stable/7/sys/dev/fxp/if_fxp.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/fxp/if_fxp.c
==============================================================================
--- stable/7/sys/dev/fxp/if_fxp.c	Mon Apr  4 20:40:39 2011	(r220342)
+++ stable/7/sys/dev/fxp/if_fxp.c	Mon Apr  4 20:41:35 2011	(r220343)
@@ -1937,11 +1937,11 @@ fxp_intr_body(struct fxp_softc *sc, stru
 				/* Adjust for appended checksum bytes. */
 				total_len -= 2;
 			}
-			if (total_len < sizeof(struct ether_header) ||
+			if (total_len < (int)sizeof(struct ether_header) ||
 			    total_len > (MCLBYTES - RFA_ALIGNMENT_FUDGE -
 			    sc->rfa_size) ||
 			    status & (FXP_RFA_STATUS_CRC |
-			    FXP_RFA_STATUS_ALIGN)) {
+			    FXP_RFA_STATUS_ALIGN | FXP_RFA_STATUS_OVERRUN)) {
 				m_freem(m);
 				fxp_add_rfabuf(sc, rxp);
 				continue;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104042041.p34KfZOp095173>