summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2022-04-05 22:51:19 +0000
committerEd Maste <emaste@FreeBSD.org>2022-04-06 01:56:21 +0000
commit5a28d8befda032e52bf8ad160992e3499f5bbdff (patch)
tree258d36a3ec2aa08a614bb7c2582e2709d33f2115 /usr.sbin
parent871bfac8b260273ea79838f9b49a4c4b8a8df866 (diff)
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bhyve/pci_e82545.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/bhyve/pci_e82545.c b/usr.sbin/bhyve/pci_e82545.c
index d0b4fb9e466f..76f2839fba31 100644
--- a/usr.sbin/bhyve/pci_e82545.c
+++ b/usr.sbin/bhyve/pci_e82545.c
@@ -1278,9 +1278,7 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head, uint16_t tail,
goto done;
}
if (sc->esc_txctx.cmd_and_length & E1000_TXD_CMD_TCP) {
- if (hdrlen < ckinfo[1].ck_start + 14 ||
- (ckinfo[1].ck_valid &&
- hdrlen < ckinfo[1].ck_off + 2)) {
+ if (hdrlen < ckinfo[1].ck_start + 14) {
WPRINTF("TSO hdrlen too small for TCP fields "
"(%d) -- dropped", hdrlen);
goto done;
@@ -1292,6 +1290,11 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head, uint16_t tail,
goto done;
}
}
+ if (ckinfo[1].ck_valid && hdrlen < ckinfo[1].ck_off + 2) {
+ WPRINTF("TSO hdrlen too small for TCP/UDP fields "
+ "(%d) -- dropped", hdrlen);
+ goto done;
+ }
}
/* Allocate, fill and prepend writable header vector. */