summaryrefslogtreecommitdiff
path: root/Kernel/Net/IPv4Socket.h
diff options
context:
space:
mode:
authorsin-ack <sin-ack@users.noreply.github.com>2021-09-11 19:38:05 +0000
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-12-16 22:21:35 +0330
commit3da0c072f40d1a93a295e07766355f9278941e13 (patch)
tree6a23f74ca2de815b0482ecd7fbdfe86c83ad085d /Kernel/Net/IPv4Socket.h
parente4a1bc154266afe45e34df7c2d22cdc97639303d (diff)
downloadserenity-3da0c072f40d1a93a295e07766355f9278941e13.zip
Kernel: Return the correct result for FIONREAD on datagram sockets
Before this commit, we only checked the receive buffer on the socket, which is unused on datagram streams. Now we return the actual size of the datagram without the protocol headers, which required the protocol to tell us what the size of the payload is.
Diffstat (limited to 'Kernel/Net/IPv4Socket.h')
-rw-r--r--Kernel/Net/IPv4Socket.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Kernel/Net/IPv4Socket.h b/Kernel/Net/IPv4Socket.h
index 6f1addbc2f..b9bcbf6821 100644
--- a/Kernel/Net/IPv4Socket.h
+++ b/Kernel/Net/IPv4Socket.h
@@ -84,6 +84,7 @@ protected:
virtual ErrorOr<size_t> protocol_send(const UserOrKernelBuffer&, size_t) { return ENOTIMPL; }
virtual ErrorOr<void> protocol_connect(OpenFileDescription&, ShouldBlock) { return {}; }
virtual ErrorOr<u16> protocol_allocate_local_port() { return ENOPROTOOPT; }
+ virtual ErrorOr<size_t> protocol_size(ReadonlyBytes /* raw_ipv4_packet */) { return ENOTIMPL; }
virtual bool protocol_is_disconnected() const { return false; }
virtual void shut_down_for_reading() override;