mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +00:00
Kernel+LibC: Add support for the IPv4 TOS field via the IP_TOS sockopt
This commit is contained in:
parent
20c7fcfedf
commit
adc9939a7b
Notes:
sideshowbarker
2024-07-18 01:49:28 +09:00
Author: https://github.com/IdanHo
Commit: adc9939a7b
Pull-request: https://github.com/SerenityOS/serenity/pull/10664
9 changed files with 37 additions and 8 deletions
|
@ -258,7 +258,7 @@ void handle_icmp(EthernetFrameHeader const& eth, IPv4Packet const& ipv4_packet,
|
|||
dbgln("Could not allocate packet buffer while sending ICMP packet");
|
||||
return;
|
||||
}
|
||||
adapter->fill_in_ipv4_header(*packet, adapter->ipv4_address(), eth.source(), ipv4_packet.source(), IPv4Protocol::ICMP, icmp_packet_size, 64);
|
||||
adapter->fill_in_ipv4_header(*packet, adapter->ipv4_address(), eth.source(), ipv4_packet.source(), IPv4Protocol::ICMP, icmp_packet_size, 0, 64);
|
||||
memset(packet->buffer->data() + ipv4_payload_offset, 0, sizeof(ICMPEchoPacket));
|
||||
auto& response = *(ICMPEchoPacket*)(packet->buffer->data() + ipv4_payload_offset);
|
||||
response.header.set_type(ICMPType::EchoReply);
|
||||
|
@ -351,7 +351,7 @@ void send_tcp_rst(IPv4Packet const& ipv4_packet, TCPPacket const& tcp_packet, Re
|
|||
return;
|
||||
routing_decision.adapter->fill_in_ipv4_header(*packet, ipv4_packet.destination(),
|
||||
routing_decision.next_hop, ipv4_packet.source(), IPv4Protocol::TCP,
|
||||
buffer_size - ipv4_payload_offset, 64);
|
||||
buffer_size - ipv4_payload_offset, 0, 64);
|
||||
|
||||
auto& rst_packet = *(TCPPacket*)(packet->buffer->data() + ipv4_payload_offset);
|
||||
rst_packet = {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue