From 2195de46d38e7d3938389408bf608b3671e12c68 Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Tue, 29 May 2001 22:14:03 +0000 Subject: [PATCH] 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. --- sys/dev/nge/if_nge.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/dev/nge/if_nge.c b/sys/dev/nge/if_nge.c index bbab6e94c79d..f5fb23e0ae22 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