From jonny@jonny.eng.br  Mon Jun 29 11:03:26 1998
Received: from roma.coe.ufrj.br (jonny@roma.coe.ufrj.br [146.164.53.65])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA02857
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 29 Jun 1998 11:03:11 -0700 (PDT)
          (envelope-from jonny@jonny.eng.br)
Received: (from jonny@localhost)
	by roma.coe.ufrj.br (8.8.8/8.8.8) id PAA12811;
	Mon, 29 Jun 1998 15:02:53 -0300 (EST)
	(envelope-from jonny)
Message-Id: <199806291802.PAA12811@roma.coe.ufrj.br>
Date: Mon, 29 Jun 1998 15:02:53 -0300 (EST)
From: Joao Carlos Mendes Luis <jonny@jonny.eng.br>
Reply-To: jonny@jonny.eng.br
To: FreeBSD-gnats-submit@freebsd.org
Subject: bug in kernel vif byte count
X-Send-Pr-Version: 3.2

>Number:         7115
>Category:       kern
>Synopsis:       vif statistics show wrong byte count
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 29 11:10:00 PDT 1998
>Closed-Date:    Tue Jun 30 03:56:40 PDT 1998
>Last-Modified:  Tue Jun 30 03:57:12 PDT 1998
>Originator:     Joao Carlos Mendes Luis
>Release:        FreeBSD 2.2.6-STABLE i386
>Organization:
COPPE/UFRJ
>Environment:

	Any multicast routing machine.  My environment is 2.2-stable,
	but the bug seems to exist both in 2.1 and 3.0-current.

>Description:

	Byte count statistics of multicast vifs are invalid.
	The problem is caused by a wrong endianess in the sum.

>How-To-Repeat:


>Fix:
	
	Apply this patch:

--- /sys/netinet/ip_mroute.c	Sat Jul 19 17:09:09 1997
+++ ip_mroute.c.new	Mon Jun 29 14:23:17 1998
@@ -1394,7 +1394,7 @@
     register struct ip  *ip = mtod(m, struct ip *);
     register vifi_t vifi;
     register struct vif *vifp;
-    register int plen = ntohs(ip->ip_len);
+    register int plen = ip->ip_len;
 
 /*
  * Macro to send packet on vif.  Since RSVP packets don't get counted on

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Tue Jun 30 03:56:40 PDT 1998 
State-Changed-Why:  
committed to current, thanks. 
>Unformatted:
