From root@fuzz.sysrap.cs.fujitsu.co.jp  Thu Nov 14 21:34:14 1996
Received: from fgwmail.fujitsu.co.jp (fgwmail.fujitsu.co.jp [164.71.1.133])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id VAA16005
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 14 Nov 1996 21:34:13 -0800 (PST)
Received: from fdmmail.fujitsu.co.jp by fgwmail.fujitsu.co.jp (8.7.6+2.6Wbeta7/3.3W5-MX961019-Fujitsu Mail Gateway)
	id OAA08205; Fri, 15 Nov 1996 14:34:11 +0900 (JST)
Received: from fuzz.sysrap.cs.fujitsu.co.jp by fdmmail.fujitsu.co.jp (8.6.12+2.5Wb4/3.3W9-MX961111-Fujitsu Domain Mail Master)
	id OAA16177; Fri, 15 Nov 1996 14:33:39 +0900
Received: (from root@localhost) by fuzz.sysrap.cs.fujitsu.co.jp (8.8.2/8.8.2) id OAA00358; Fri, 15 Nov 1996 14:30:01 +0900 (JST)
Message-Id: <199611150530.OAA00358@fuzz.sysrap.cs.fujitsu.co.jp>
Date: Fri, 15 Nov 1996 14:30:01 +0900 (JST)
From: seki@sysrap.cs.fujitsu.co.jp
Reply-To: seki@sysrap.cs.fujitsu.co.jp
To: FreeBSD-gnats-submit@freebsd.org
Cc: seki@sysrap.cs.fujitsu.co.jp
Subject: Wrong stats (SNMP Dot3 MIBs) in ed driver
X-Send-Pr-Version: 3.2

>Number:         2011
>Category:       i386
>Synopsis:       Ed driver puts wrong value in some of its SNMP Dot3 MIBs.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    wollman
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 14 21:40:01 PST 1996
>Closed-Date:    Fri Nov 15 08:07:31 PST 1996
>Last-Modified:  Fri Nov 15 08:09:34 PST 1996
>Originator:     Masahiro Sekiguchi
>Release:        FreeBSD 2.2-ALPHA i386
>Organization:
Fujitsu Limited
>Environment:

	2.2 ALPHA with any of ed compatible Ethernet cards.

>Description:

	Ed driver counts some collision-related events in SNMP Dot3 MIBs
	wrong way.

	RFC 1650 specifies that dot3StatsDeferredTRansmissions,
	dot3StatsSingleCollisionFrames, dot3StatsMultipleCollisionFrames,
	and dot3StatsExcessiveCollisions are exclusive; i.e., a frame
	may cause one of the above MIBs be incremented, but cannot
	cause two or more of the above.

	Ed driver in 2.2 ALPHA, however, increments two or more for a
	frame.  It conflicts with RFC 1650.

	For example, the definition of dot3StatsDeferredTransmissions
	in RFC 1650 says: "The count represented by an instance of this
	object does not include frames involved in collisions."  However,
	Ed in 2.2 ALPHA increments both DeferredTransmissions and
	SimgleCollisionsFrames for one single-collided frame.

    One more related note.

	RFC 1650 also says that error conditions are also exclusive.
	Currently, ed driver tests for some bits in a hardware register,
	and update error-related MIBs independently.  *If* two or more
	error bits in the register can be set for a frame, it causes
	another wrong stat.  I'm not sure it can be happen, or never
	happen due to the hardware specification.

>How-To-Repeat:

	Transmit an Ethernet frame through an ed compatible card, and
	make it collide.

>Fix:
	
	The following is a suggested patch to sys/i386/isa/if_ed.c.

	This patch fixes bugs on collision-related stats.  Handling of
	error related MIBs are not touched.

--- cut here ---

--- if_ed.c.orig	Thu Oct 17 22:42:13 1996
+++ if_ed.c	Fri Nov 15 13:58:29 1996
@@ -2410,7 +2410,6 @@
 					 * TSR_ABT is set.
 					 */
 					collisions = 16;
-					sc->mibdata.dot3StatsMultipleCollisionFrames++;
 					sc->mibdata.dot3StatsExcessiveCollisions++;
 					sc->mibdata.dot3StatsCollFrequencies[15]++;
 				}
@@ -2458,12 +2457,10 @@
 				break;
 			case 1:
 				sc->mibdata.dot3StatsSingleCollisionFrames++;
-				sc->mibdata.dot3StatsDeferredTransmissions++;
 				sc->mibdata.dot3StatsCollFrequencies[0]++;
 				break;
 			default:
 				sc->mibdata.dot3StatsMultipleCollisionFrames++;
-				sc->mibdata.dot3StatsDeferredTransmissions++;
 				sc->mibdata.
 					dot3StatsCollFrequencies[collisions-1]
 						++;
	MIBs 
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: wollman 
State-Changed-When: Fri Nov 15 08:07:31 PST 1996 
State-Changed-Why:  
Fixed in rev 1.108 of if_ed.c. 


Responsible-Changed-From-To: freebsd-bugs->wollman 
Responsible-Changed-By: wollman 
Responsible-Changed-When: Fri Nov 15 08:07:31 PST 1996 
Responsible-Changed-Why:  
I wrote the code. 
>Unformatted:
