summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/drivers/net/ena.c1
-rw-r--r--src/drivers/net/virtio-net.c1
-rw-r--r--src/net/ethernet.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/src/drivers/net/ena.c b/src/drivers/net/ena.c
index 8d29979b..0f25c0be 100644
--- a/src/drivers/net/ena.c
+++ b/src/drivers/net/ena.c
@@ -565,6 +565,7 @@ static int ena_get_device_attributes ( struct net_device *netdev ) {
feature = &rsp->get_feature.feature;
memcpy ( netdev->hw_addr, feature->device.mac, ETH_ALEN );
netdev->max_pkt_len = le32_to_cpu ( feature->device.mtu );
+ netdev->mtu = ( netdev->max_pkt_len - ETH_HLEN );
DBGC ( ena, "ENA %p MAC %s MTU %zd\n",
ena, eth_ntoa ( netdev->hw_addr ), netdev->max_pkt_len );
diff --git a/src/drivers/net/virtio-net.c b/src/drivers/net/virtio-net.c
index fe79a92c..78ec9ac4 100644
--- a/src/drivers/net/virtio-net.c
+++ b/src/drivers/net/virtio-net.c
@@ -493,6 +493,7 @@ static int virtnet_probe_legacy ( struct pci_device *pci ) {
&mtu, sizeof ( mtu ) );
DBGC ( virtnet, "VIRTIO-NET %p mtu=%d\n", virtnet, mtu );
netdev->max_pkt_len = ( mtu + ETH_HLEN );
+ netdev->mtu = mtu;
}
/* Register network device */
diff --git a/src/net/ethernet.c b/src/net/ethernet.c
index 26fdedea..707bdf90 100644
--- a/src/net/ethernet.c
+++ b/src/net/ethernet.c
@@ -269,6 +269,7 @@ struct net_device * alloc_etherdev ( size_t priv_size ) {
netdev->ll_protocol = &ethernet_protocol;
netdev->ll_broadcast = eth_broadcast;
netdev->max_pkt_len = ETH_FRAME_LEN;
+ netdev->mtu = ETH_MAX_MTU;
}
return netdev;
}