]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[virtio] Set MTU for both modern and legacy devices
authorMichael Brown <mcb30@ipxe.org>
Thu, 23 Apr 2026 13:12:00 +0000 (14:12 +0100)
committerMichael Brown <mcb30@ipxe.org>
Thu, 23 Apr 2026 13:12:53 +0000 (14:12 +0100)
Commit b9d68b9 ("[ethernet] Use standard 1500 byte MTU unless
explicitly overridden") added code to explicitly set the MTU for
virtio-net devices, but only on the legacy probe path.

Make the behaviour consistent by setting the MTU on both legacy and
modern probe paths.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/net/virtio-net.c

index 0c454192477959507ac371cf3c97833f8883958b..cb55ea0419e550223cdc8e12c6098d9df0a828c6 100644 (file)
@@ -623,6 +623,7 @@ static int virtnet_probe_modern ( struct pci_device *pci, int *found_dev ) {
                        DBGC ( virtnet, "VIRTIO-NET %p mtu=%d\n", virtnet,
                               mtu );
                        netdev->max_pkt_len = ( mtu + ETH_HLEN );
+                       netdev->mtu = mtu;
                }
        }