summaryrefslogtreecommitdiff
path: root/Kernel/Net
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-01-26 14:43:08 +0100
committerAndreas Kling <kling@serenityos.org>2020-01-26 14:43:08 +0100
commit2ce9a705e362e787e9b04fb62e1361eb8e4e2e9a (patch)
tree9dd6315364eb819ec4dd99c3c2cf81d8f8016bd8 /Kernel/Net
parent388d40d755428848980016057c1e64fac253256f (diff)
downloadserenity-2ce9a705e362e787e9b04fb62e1361eb8e4e2e9a.zip
IPv4: Mark UDP sockets as connected immediately upon connect()
This makes it possible to write() to a blocking UDPSocket. Previously this was not possible since can_write() depends on is_connected().
Diffstat (limited to 'Kernel/Net')
-rw-r--r--Kernel/Net/UDPSocket.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/Kernel/Net/UDPSocket.cpp b/Kernel/Net/UDPSocket.cpp
index 53dabad1f6..060e3fddf2 100644
--- a/Kernel/Net/UDPSocket.cpp
+++ b/Kernel/Net/UDPSocket.cpp
@@ -111,6 +111,7 @@ int UDPSocket::protocol_send(const void* data, int data_length)
KResult UDPSocket::protocol_connect(FileDescription&, ShouldBlock)
{
m_role = Role::Connected;
+ set_connected(true);
return KSuccess;
}