From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 22:21:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 980381065757; Wed, 25 Mar 2009 22:21:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B5AA8FC3C; Wed, 25 Mar 2009 22:21:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PMLrUs091277; Wed, 25 Mar 2009 22:21:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PMLrXT091276; Wed, 25 Mar 2009 22:21:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903252221.n2PMLrXT091276@svn.freebsd.org> From: Warner Losh Date: Wed, 25 Mar 2009 22:21:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190431 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Mar 2009 22:21:54 -0000 Author: imp Date: Wed Mar 25 22:21:53 2009 New Revision: 190431 URL: http://svn.freebsd.org/changeset/base/190431 Log: Tweak comments. Modified: head/sys/dev/ed/if_ed.c Modified: head/sys/dev/ed/if_ed.c ============================================================================== --- head/sys/dev/ed/if_ed.c Wed Mar 25 22:21:38 2009 (r190430) +++ head/sys/dev/ed/if_ed.c Wed Mar 25 22:21:53 2009 (r190431) @@ -806,14 +806,15 @@ ed_rint(struct ed_softc *sc) /* * Length is a wild value. There's a good chance that * this was caused by the NIC being old and buggy. - * The bug is that the length low byte is duplicated in - * the high byte. Try to recalculate the length based on - * the pointer to the next packet. - */ - /* - * NOTE: sc->next_packet is pointing at the current packet. + * The bug is that the length low byte is duplicated + * in the high byte. Try to recalculate the length + * based on the pointer to the next packet. Also, + * need ot preserve offset into page. + * + * NOTE: sc->next_packet is pointing at the current + * packet. */ - len &= ED_PAGE_SIZE - 1; /* preserve offset into page */ + len &= ED_PAGE_SIZE - 1; if (packet_hdr.next_packet >= sc->next_packet) len += (packet_hdr.next_packet - sc->next_packet) * ED_PAGE_SIZE; @@ -834,14 +835,14 @@ ed_rint(struct ed_softc *sc) } /* - * Be fairly liberal about what we allow as a "reasonable" length - * so that a [crufty] packet will make it to BPF (and can thus - * be analyzed). Note that all that is really important is that - * we have a length that will fit into one mbuf cluster or less; - * the upper layer protocols can then figure out the length from - * their own length field(s). - * But make sure that we have at least a full ethernet header - * or we would be unable to call ether_input() later. + * Be fairly liberal about what we allow as a "reasonable" + * length so that a [crufty] packet will make it to BPF (and + * can thus be analyzed). Note that all that is really + * important is that we have a length that will fit into one + * mbuf cluster or less; the upper layer protocols can then + * figure out the length from their own length field(s). But + * make sure that we have at least a full ethernet header or + * we would be unable to call ether_input() later. */ if ((len >= sizeof(struct ed_ring) + ETHER_HDR_LEN) && (len <= MCLBYTES) &&