1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:07:44 +00:00

Kernel: Fix up the ICMP implementation to generate correct Echo replies.

Serenity now responds to ping. :^)
This commit is contained in:
Andreas Kling 2019-03-12 11:44:38 +01:00
parent 75e0ddd46a
commit 9858be636f
5 changed files with 66 additions and 28 deletions

View file

@ -23,7 +23,7 @@ public:
void set_code(byte b) { m_code = b; }
word checksum() const { return ntohs(m_checksum); }
void set_checksum(word w) { m_checksum = htons(w); }
void set_checksum(word w) { m_checksum = w; }
const void* payload() const { return this + 1; }
void* payload() { return this + 1; }
@ -31,7 +31,7 @@ public:
private:
byte m_type { 0 };
byte m_code { 0 };
word m_checksum { 0 };
NetworkOrdered<word> m_checksum { 0 };
// NOTE: The rest of the header is 4 bytes
};