mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
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.
This commit is contained in:
@@ -170,7 +170,7 @@ void TCPSocket::send_tcp_packet(u16 flags, const void* payload, int payload_size
|
||||
|
||||
routing_decision.adapter->send_ipv4(
|
||||
routing_decision.next_hop, peer_address(), IPv4Protocol::TCP,
|
||||
buffer.data(), buffer.size());
|
||||
buffer.data(), buffer.size(), ttl());
|
||||
|
||||
m_packets_out++;
|
||||
m_bytes_out += buffer.size();
|
||||
@@ -210,7 +210,7 @@ void TCPSocket::send_outgoing_packets()
|
||||
#endif
|
||||
routing_decision.adapter->send_ipv4(
|
||||
routing_decision.next_hop, peer_address(), IPv4Protocol::TCP,
|
||||
packet.buffer.data(), packet.buffer.size());
|
||||
packet.buffer.data(), packet.buffer.size(), ttl());
|
||||
|
||||
m_packets_out++;
|
||||
m_bytes_out += packet.buffer.size();
|
||||
|
||||
Reference in New Issue
Block a user