From 6d82975059272f0738192746d1083991817ef293 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 7 Apr 2026 00:37:00 +0100 Subject: [PATCH] [undi] Pad transmit buffer length to work around vendor driver bugs The workaround used for UEFI in commit 926816c ("[efi] Pad transmit buffer length to work around vendor driver bugs") is also applicable to the BIOS UNDI driver. Apply the same workaround of padding the transmit I/O buffers to the minimum Ethernet frame length before passing them to the underlying UNDI driver's transmit function. Reported-by: Alexander Patrakov Signed-off-by: Michael Brown --- src/arch/x86/drivers/net/undinet.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/arch/x86/drivers/net/undinet.c b/src/arch/x86/drivers/net/undinet.c index 6fdc568f3..204c4da05 100644 --- a/src/arch/x86/drivers/net/undinet.c +++ b/src/arch/x86/drivers/net/undinet.c @@ -493,6 +493,12 @@ static int undinet_transmit ( struct net_device *netdev, * transmit the next packet. */ + /* Pad to minimum Ethernet length, to work around underlying + * drivers that do not correctly handle frame padding + * themselves. + */ + iob_pad ( iobuf, ETH_ZLEN ); + /* Some PXE stacks are unable to cope with P_UNKNOWN, and will * always try to prepend a link-layer header. Work around * these stacks by stripping the existing link-layer header