mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 12:32:21 +00:00
Kernel: Stop including the ethernet header in LoopbackAdapter's mtu
The networking subsystem currently assumes all adapters are Ethernet adapters, including the LoopbackAdapter, so all packets are pre-pended with an Ethernet Frame header. Since the MTU must not include any overhead added by the data-link (Ethernet in this case) or physical layers, we need to subtract it from the MTU. This fixes a kernel panic which occurs when sending a packet that is at least 65523 bytes long through the loopback adapter, which results in the kernel "receiving" a packet which is larger than the support MTU out the other end. (As the actual final size was increased by the addition of the ethernet frame header)
This commit is contained in:
parent
16a53c811e
commit
743a9e9ebf
Notes:
sideshowbarker
2024-07-17 06:24:08 +09:00
Author: https://github.com/IdanHo
Commit: 743a9e9ebf
Pull-request: https://github.com/SerenityOS/serenity/pull/22055
Issue: https://github.com/SerenityOS/serenity/issues/21793
1 changed files with 4 additions and 1 deletions
|
@ -21,7 +21,10 @@ LoopbackAdapter::LoopbackAdapter(StringView interface_name)
|
|||
{
|
||||
VERIFY(!s_loopback_initialized);
|
||||
s_loopback_initialized = true;
|
||||
set_mtu(65536);
|
||||
// The networking subsystem currently assumes all adapters are Ethernet adapters, including the LoopbackAdapter,
|
||||
// so all packets are pre-pended with an Ethernet Frame header. Since the MTU must not include any overhead added
|
||||
// by the data-link (Ethernet in this case) or physical layers, we need to subtract it from the MTU.
|
||||
set_mtu(65536 - sizeof(EthernetFrameHeader));
|
||||
set_mac_address({ 19, 85, 2, 9, 0x55, 0xaa });
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue