diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-09-19 21:40:06 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-19 21:42:59 +0200 |
commit | 8cfb85936815a9de0fbfeeed1484f7f58ce8ea6d (patch) | |
tree | d1123e9b66a70eb1e593f8124198544f45ca01cd /Kernel/Net/Socket.h | |
parent | 482d5295f1a490b76e3e888cdca9b393a26dda73 (diff) | |
download | serenity-8cfb85936815a9de0fbfeeed1484f7f58ce8ea6d.zip |
IPv4: Support overriding the default TTL (64)
Made getsockopt() and setsockopt() virtual so we can handle them in the
various Socket subclasses. The subclasses map kinda nicely to "levels".
This will allow us to implement things like "traceroute", although..
I spent some time trying to do that, but then hit a wall when it turned
out that the user-mode networking in QEMU doesn't preserve TTL in the
ICMP packets passing through.
Diffstat (limited to 'Kernel/Net/Socket.h')
-rw-r--r-- | Kernel/Net/Socket.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Net/Socket.h b/Kernel/Net/Socket.h index 98a3d221f5..c297aa8e7b 100644 --- a/Kernel/Net/Socket.h +++ b/Kernel/Net/Socket.h @@ -76,8 +76,8 @@ public: virtual ssize_t sendto(FileDescription&, const void*, size_t, int flags, const sockaddr*, socklen_t) = 0; virtual ssize_t recvfrom(FileDescription&, void*, size_t, int flags, sockaddr*, socklen_t*) = 0; - KResult setsockopt(int level, int option, const void*, socklen_t); - KResult getsockopt(int level, int option, void*, socklen_t*); + virtual KResult setsockopt(int level, int option, const void*, socklen_t); + virtual KResult getsockopt(int level, int option, void*, socklen_t*); pid_t origin_pid() const { return m_origin_pid; } pid_t acceptor_pid() const { return m_acceptor_pid; } |