Subject: kern/13246: IP header checksum not counted in stats
To: None <gnats-bugs@gnats.netbsd.org>
From: None <witek@pd37.warszawa.sdi.tpnet.pl>
List: netbsd-bugs
Date: 06/19/2001 13:07:32
>Number:         13246
>Category:       kern
>Synopsis:       IP header checksum not counted in stats
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 19 04:06:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Witold J. Wnuk
>Release:        1.5W <NetBSD-current source date>
>Organization:
none
>Environment:
System: NetBSD grzyb.wnuk.eu.org 1.5W NetBSD 1.5W (GRZYB) #3: Mon Jun 11 16:01:20 CEST 2001 witek@tamjee.wnuk.eu.org:/usr/src/sys/arch/i386/compile/GRZYB i386
Architecture: i386
Machine: i386
>Description:
	Probably a mistake was made while adding HW checksum support.
	If software checksums are used, ips_badsum IP header
	checksum counter won't be updated.
>How-To-Repeat:
	Send IP packets with bad checksums to NetBSD host.
	netstat -s | grep "bad header checksums"
>Fix:

Index: ip_input.c
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet/ip_input.c,v
retrieving revision 1.135
diff -u -r1.135 ip_input.c
--- ip_input.c  2001/06/02 16:17:09     1.135
+++ ip_input.c  2001/06/19 11:04:49
@@ -474,7 +474,7 @@
                /* Must compute it ourselves. */
                INET_CSUM_COUNTER_INCR(&ip_swcsum);
                if (in_cksum(m, hlen) != 0)
-                       goto bad;
+                       goto badcsum;
                break;
        }

>Release-Note:
>Audit-Trail:
>Unformatted: