Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Dec 2008 14:23:45 +0000 (UTC)
From:      Stanislav Sedov <stas@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185707 - head/sys/dev/ae
Message-ID:  <200812061423.mB6ENjW4096783@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: stas
Date: Sat Dec  6 14:23:45 2008
New Revision: 185707
URL: http://svn.freebsd.org/changeset/base/185707

Log:
  - Eliminate unused variable. [1]
  - Check for runt frames entering the stack. [2]
  
  Suggested by:	ganbold[1], yongari[2]
  Approved by:	kib (mentor)
  MFC after:	2 weeks

Modified:
  head/sys/dev/ae/if_ae.c

Modified: head/sys/dev/ae/if_ae.c
==============================================================================
--- head/sys/dev/ae/if_ae.c	Sat Dec  6 14:20:04 2008	(r185706)
+++ head/sys/dev/ae/if_ae.c	Sat Dec  6 14:23:45 2008	(r185707)
@@ -1105,12 +1105,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.
 	 */
@@ -1903,8 +1900,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?200812061423.mB6ENjW4096783>