cvs commit: src/sys/dev/netif/nfe if_nfe.c

Matthew Dillon dillon at apollo.backplane.com
Sat Aug 11 10:56:25 PDT 2007


:On 8/11/07, Matthew Dillon <dillon at apollo.backplane.com> wrote:
:>     Ok, I committed a fix to ip_input.c.  Basically the 1's complement
:>     checksum was not being properly calculated by the defragmenter.  This
:>     allows the csum_data to be set to 0xffff with CSUM_PSEUDO_HDR set
:>     on fragments and for the reassembled result to retain the correct
:>     csum_data.
:
:Good catch!!

     And it turns out FreeBSD made the same fix, too.  Good.

:Certain hardware, like bge(4), can will provide checksum for an
:individual fragment.  I have added another CSUM flag to indicate this
:to IP layer, so that hardware feature could be fully utilized.  I have
:checked em and re, at least at first glance they don't have this
:feature.  Please review following patch:
:http://leaf.dragonflybsd.org/~sephe/hw_frag_csum.diff
:
:Best Regards,
:sephe

    Hmm.  I'm not sure this is the correct approach.   I guess it depends
    on what the device is actually checksumming.

    If we know the IP checksum is correct we can actually calculate the
    checksum for the higher UDP/TCP layer by doing a 1's complement
    subtraction of the portion of the IP header that does not get included
    in the UDP/TCP layer.  That could be stored in csum_data, accumulated
    when the IP fragments are strung together, and either just tested against
    the UDP/TCP checksum or tested against -1 (since if the tcp/udp checksum
    is included the result should be all 1's).

					-Matt
					Matthew Dillon 
					<dillon at backplane.com>





More information about the Commits mailing list