Subject: Re: tcpdump reports invalid checksums when using ex(4) hardware checksums
To: Rui Paulo <phlox-netbsd-net@fnop.net>
From: Jonathan Stone <jonathan@dsg.stanford.edu>
List: tech-net
Date: 10/04/2004 16:10:57
In message <20041004221429.GA8633@pheisar.fnop.net>,
Rui Paulo writes:

>Greetings,
>
>When I enable ex(4) hardware checksums, tcpdump (and all programs that

>use bpfilter) will report bad checksums:
>23:07:59.772771 10.0.0.2 > 10.0.0.1: icmp: echo request seq 0 (ttl
>255, id 51117, len 84, bad cksum 0 (->ffff0721)!)
>                       ^^^^^^^^^
>23:07:59.773806 10.0.0.1 > 10.0.0.2: icmp: echo reply seq 0 (ttl 255,
>id 15820, len 84)
>
>I wonder, is this normal ? It should be normal if the hardware
>checksum routines performs checksum calculation after the layer
>bpfilter works on. But I just wanted to make sure. 

Yes, its normal, and for exactly the reasons you suggest.  It would be
... nice, if bpf/libpcap had a flag to indicate `no checksum on
outbound packet due to outboard checksumming'; but I dont know of such
a feature.

>BTW, is this ex(4) specific or every driver that performs hardware
>checksums has this minor problem ?

All of them, AFAIK.