summaryrefslogtreecommitdiff
path: root/Kernel/Net/LocalSocket.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-07 23:42:28 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-07 23:43:32 +0100
commitd04fcccc90dfa99031e5e16c2b2be7a31e613520 (patch)
treebdcc5a39f8150129303fe529cfa2481ffd4a5876 /Kernel/Net/LocalSocket.h
parentd34ad44f90fbfc9f4166d8326994aa86458a18d5 (diff)
downloadserenity-d04fcccc90dfa99031e5e16c2b2be7a31e613520.zip
Kernel: Truncate addresses stored by getsockname() and getpeername()
If there's not enough space in the output buffer for the whole sockaddr we now simply truncate the address instead of returning EINVAL. This patch also makes getpeername() actually return the peer address rather than the local address.. :^)
Diffstat (limited to 'Kernel/Net/LocalSocket.h')
-rw-r--r--Kernel/Net/LocalSocket.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Net/LocalSocket.h b/Kernel/Net/LocalSocket.h
index 21b04f6463..e989884cc2 100644
--- a/Kernel/Net/LocalSocket.h
+++ b/Kernel/Net/LocalSocket.h
@@ -47,8 +47,8 @@ public:
virtual KResult bind(const sockaddr*, socklen_t) override;
virtual KResult connect(FileDescription&, const sockaddr*, socklen_t, ShouldBlock = ShouldBlock::Yes) override;
virtual KResult listen(int) override;
- virtual bool get_local_address(sockaddr*, socklen_t*) override;
- virtual bool get_peer_address(sockaddr*, socklen_t*) override;
+ virtual void get_local_address(sockaddr*, socklen_t*) override;
+ virtual void get_peer_address(sockaddr*, socklen_t*) override;
virtual void attach(FileDescription&) override;
virtual void detach(FileDescription&) override;
virtual bool can_read(const FileDescription&) const override;