summaryrefslogtreecommitdiff
path: root/Kernel/Net/UDPSocket.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-09-19 21:40:06 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-09-19 21:42:59 +0200
commit8cfb85936815a9de0fbfeeed1484f7f58ce8ea6d (patch)
treed1123e9b66a70eb1e593f8124198544f45ca01cd /Kernel/Net/UDPSocket.cpp
parent482d5295f1a490b76e3e888cdca9b393a26dda73 (diff)
downloadserenity-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/UDPSocket.cpp')
-rw-r--r--Kernel/Net/UDPSocket.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Net/UDPSocket.cpp b/Kernel/Net/UDPSocket.cpp
index da6f6d140f..103c824226 100644
--- a/Kernel/Net/UDPSocket.cpp
+++ b/Kernel/Net/UDPSocket.cpp
@@ -77,7 +77,7 @@ int UDPSocket::protocol_send(const void* data, int data_length)
local_port(),
peer_address().to_string().characters(),
peer_port());
- routing_decision.adapter->send_ipv4(routing_decision.next_hop, peer_address(), IPv4Protocol::UDP, buffer.data(), buffer.size());
+ routing_decision.adapter->send_ipv4(routing_decision.next_hop, peer_address(), IPv4Protocol::UDP, buffer.data(), buffer.size(), ttl());
return data_length;
}