From eac761e967b34066aa7183474249df87d79a2f32 Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Tue, 15 Aug 2023 14:37:43 -0700 Subject: [PATCH] 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 b90ab21cd82..765458d621f 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);