Skip to content

Commit 75837f0

Browse files
committed
net: Make MTU consistent with packet_len
1 parent 9168e2d commit 75837f0

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/drivers/virtionet.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class VirtioNet : Virtio, public net::Link_layer<net::Ethernet> {
133133
{ return 1500; }
134134

135135
uint16_t packet_len() const noexcept {
136-
return Link::Protocol::header_size() + MTU();
136+
return sizeof(net::ethernet::Header) + MTU();
137137
}
138138

139139
net::Packet_ptr create_packet(int) override;

src/drivers/vmxnet3.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ class vmxnet3 : public net::Link_layer<net::Ethernet>
5252
}
5353

5454
uint16_t packet_len() const noexcept
55-
{ // ethernet + vlan + fcs
56-
return ETH_FRAME_LEN + 4 + 4;
55+
{
56+
return sizeof(net::ethernet::Header) + MTU();
5757
}
5858

5959
net::downstream create_physical_downstream()

0 commit comments

Comments
 (0)