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

Kernel: Handle OOM when allocating IPv4Socket optional scratch buffer

This commit is contained in:
Brian Gianforcaro 2021-08-01 05:11:05 -07:00 committed by Andreas Kling
parent a6db2f985a
commit c1a0e379e6
5 changed files with 18 additions and 12 deletions

View file

@ -74,7 +74,7 @@ public:
BufferMode buffer_mode() const { return m_buffer_mode; }
protected:
IPv4Socket(int type, int protocol, NonnullOwnPtr<DoubleBuffer> receive_buffer);
IPv4Socket(int type, int protocol, NonnullOwnPtr<DoubleBuffer> receive_buffer, OwnPtr<KBuffer> optional_scratch_buffer);
virtual StringView class_name() const override { return "IPv4Socket"; }
PortAllocationResult allocate_local_port_if_needed();
@ -130,7 +130,7 @@ private:
BufferMode m_buffer_mode { BufferMode::Packets };
Optional<KBuffer> m_scratch_buffer;
OwnPtr<KBuffer> m_scratch_buffer;
};
}