mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 09:37:34 +00:00
Kernel: Fix up the ICMP implementation to generate correct Echo replies.
Serenity now responds to ping. :^)
This commit is contained in:
parent
75e0ddd46a
commit
9858be636f
5 changed files with 66 additions and 28 deletions
|
@ -14,7 +14,7 @@ NetworkAdapter::~NetworkAdapter()
|
|||
|
||||
void NetworkAdapter::send(const MACAddress& destination, const ARPPacket& packet)
|
||||
{
|
||||
int size_in_bytes = sizeof(EthernetFrameHeader) + sizeof(ARPPacket) + sizeof(EthernetFrameCheckSequence);
|
||||
int size_in_bytes = sizeof(EthernetFrameHeader) + sizeof(ARPPacket);
|
||||
auto* eth = (EthernetFrameHeader*)kmalloc(size_in_bytes);
|
||||
eth->set_source(mac_address());
|
||||
eth->set_destination(destination);
|
||||
|
@ -26,7 +26,7 @@ void NetworkAdapter::send(const MACAddress& destination, const ARPPacket& packet
|
|||
|
||||
void NetworkAdapter::send_ipv4(const MACAddress& destination, const void* packet, size_t packet_size)
|
||||
{
|
||||
size_t size_in_bytes = sizeof(EthernetFrameHeader) + packet_size + sizeof(EthernetFrameCheckSequence);
|
||||
size_t size_in_bytes = sizeof(EthernetFrameHeader) + packet_size;
|
||||
auto* eth = (EthernetFrameHeader*)kmalloc(size_in_bytes);
|
||||
eth->set_source(mac_address());
|
||||
eth->set_destination(destination);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue