diff options
author | wpaul <wpaul@FreeBSD.org> | 2001-05-29 22:14:03 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2001-05-29 22:14:03 +0000 |
commit | 9a3cecd14f95397d8c188493122ba6cc81c2de49 (patch) | |
tree | 74ae387757b4cd99d4227995dd016894bd5bdd56 /sys/dev/nge | |
parent | 3d714c94f9489a7ea7bd8b0770344e12a901d415 (diff) | |
download | FreeBSD-src-9a3cecd14f95397d8c188493122ba6cc81c2de49.zip FreeBSD-src-9a3cecd14f95397d8c188493122ba6cc81c2de49.tar.gz |
Per jlemon: add code to nge_rxeof() to allow verification of TCP and
UDP checksums too, not just IP. The chip only tells us if the checksum
is ok, it does not give us a copy of the partial checksum for later
processing. We have to deal with this the right way, but we can deal
with it.
Diffstat (limited to 'sys/dev/nge')
-rw-r--r-- | sys/dev/nge/if_nge.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/nge/if_nge.c b/sys/dev/nge/if_nge.c index bbab6e9..f5fb23e 100644 --- a/sys/dev/nge/if_nge.c +++ b/sys/dev/nge/if_nge.c @@ -1293,6 +1293,14 @@ static void nge_rxeof(sc) m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; if (!(extsts & NGE_RXEXTSTS_IPCSUMERR)) m->m_pkthdr.csum_flags |= CSUM_IP_VALID; + if ((extsts & NGE_RXEXTSTS_TCPPKT && + !(extsts & NGE_RXEXTSTS_TCPCSUMERR)) || + (extsts & NGE_RXEXTSTS_UDPPKT && + !(extsts & NGE_RXEXTSTS_UDPCSUMERR))) { + m->m_pkthdr.csum_flags |= + CSUM_DATA_VALID|CSUM_PSEUDO_HDR; + m->m_pkthdr.csum_data = 0; + } } #if NVLAN > 0 |