The branch main has been updated by kbowling:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=eac761e967b34066aa7183474249df87d79a2f32

commit eac761e967b34066aa7183474249df87d79a2f32
Author:     Kevin Bowling <kbowl...@freebsd.org>
AuthorDate: 2023-08-15 21:37:43 +0000
Commit:     Kevin Bowling <kbowl...@freebsd.org>
CommitDate: 2023-08-15 21:39:35 +0000

    e1000: Fix off by one ipcse
    
    This has been off by one in the FreeBSD drivers as far back as I've
    looked.  Emperically HW and SW emulations I have available don't seem to
    mind.  Noticed while debugging other issues.
    
    MFC after:      3 days
---
 sys/dev/e1000/em_txrx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c
index b90ab21cd825..765458d621f9 100644
--- a/sys/dev/e1000/em_txrx.c
+++ b/sys/dev/e1000/em_txrx.c
@@ -290,7 +290,7 @@ em_transmit_checksum_setup(struct e1000_softc *sc, 
if_pkt_info_t pi,
            offsetof(struct ip, ip_sum);
        if (csum_flags & CSUM_IP) {
                *txd_upper |= E1000_TXD_POPTS_IXSM << 8;
-               TXD->lower_setup.ip_fields.ipcse = htole16(hdr_len);
+               TXD->lower_setup.ip_fields.ipcse = htole16(hdr_len - 1);
                cmd |= E1000_TXD_CMD_IP;
        } else if (csum_flags & (CSUM_IP6_TCP | CSUM_IP6_UDP))
                TXD->lower_setup.ip_fields.ipcse = htole16(0);

Reply via email to