mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +00:00
Kernel: Add the SO_BINDTODEVICE socket option
This patch adds a way for a socket to ask to be routed through a specific interface. Currently, this option only applies to sending, however, it should also apply to receiving...somehow :^)
This commit is contained in:
parent
7d0bf9b5a9
commit
77191d82dc
Notes:
sideshowbarker
2024-07-19 07:54:48 +09:00
Author: https://github.com/alimpfard
Commit: 77191d82dc
Pull-request: https://github.com/SerenityOS/serenity/pull/1620
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bcoles
Reviewed-by: https://github.com/bugaevc
10 changed files with 186 additions and 13 deletions
|
@ -212,7 +212,7 @@ void TCPSocket::send_tcp_packet(u16 flags, const void* payload, size_t payload_s
|
|||
return;
|
||||
}
|
||||
|
||||
auto routing_decision = route_to(peer_address(), local_address());
|
||||
auto routing_decision = route_to(peer_address(), local_address(), bound_interface());
|
||||
ASSERT(!routing_decision.is_zero());
|
||||
|
||||
routing_decision.adapter->send_ipv4(
|
||||
|
@ -225,7 +225,7 @@ void TCPSocket::send_tcp_packet(u16 flags, const void* payload, size_t payload_s
|
|||
|
||||
void TCPSocket::send_outgoing_packets()
|
||||
{
|
||||
auto routing_decision = route_to(peer_address(), local_address());
|
||||
auto routing_decision = route_to(peer_address(), local_address(), bound_interface());
|
||||
ASSERT(!routing_decision.is_zero());
|
||||
|
||||
auto now = kgettimeofday();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue