Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Jan 2009 11:17:46 +0000 (UTC)
From:      Stanislav Sedov <stas@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: r187383 - stable/7/sys/dev/ae
Message-ID:  <200901181117.n0IBHkRc071630@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: stas
Date: Sun Jan 18 11:17:46 2009
New Revision: 187383
URL: http://svn.freebsd.org/changeset/base/187383

Log:
  - MFC r185707:
    - Eliminate unused variable. [1]
    - Check for runt frames entering the stack. [2]
  
  Suggested by:	ganbold[1], yongari[2]

Modified:
  stable/7/sys/dev/ae/if_ae.c

Modified: stable/7/sys/dev/ae/if_ae.c
==============================================================================
--- stable/7/sys/dev/ae/if_ae.c	Sun Jan 18 09:44:33 2009	(r187382)
+++ stable/7/sys/dev/ae/if_ae.c	Sun Jan 18 11:17:46 2009	(r187383)
@@ -1103,12 +1103,9 @@ ae_dmamap_cb(void *arg, bus_dma_segment_
 static int
 ae_alloc_rings(ae_softc_t *sc)
 {
-	bus_dma_tag_t bustag;
 	bus_addr_t busaddr;
 	int error;
 
-	bustag = bus_get_dma_tag(sc->dev);
-
 	/*
 	 * Create parent DMA tag.
 	 */
@@ -1865,8 +1862,8 @@ ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd)
 	if_printf(ifp, "Rx interrupt occuried.\n");
 #endif
 	size = le16toh(rxd->len) - ETHER_CRC_LEN;
-	if (size < 0) {
-		if_printf(ifp, "Negative length packet received.");
+	if (size < (ETHER_MIN_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN)) {
+		if_printf(ifp, "Runt frame received.");
 		return (EIO);
 	}
 



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