mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
Kernel: Implement the SO_DONTROUTE SOL_SOCKET-level option
This commit is contained in:
parent
641498954f
commit
613ade9dec
Notes:
sideshowbarker
2024-07-17 23:10:31 +09:00
Author: https://github.com/IdanHo
Commit: 613ade9dec
Pull-request: https://github.com/SerenityOS/serenity/pull/11152
Reviewed-by: https://github.com/awesomekling
4 changed files with 20 additions and 2 deletions
|
@ -210,7 +210,7 @@ ErrorOr<size_t> IPv4Socket::sendto(OpenFileDescription&, const UserOrKernelBuffe
|
|||
if (!is_connected() && m_peer_address.is_zero())
|
||||
return set_so_error(EPIPE);
|
||||
|
||||
auto allow_using_gateway = (flags & MSG_DONTROUTE) ? AllowUsingGateway::No : AllowUsingGateway::Yes;
|
||||
auto allow_using_gateway = ((flags & MSG_DONTROUTE) || m_routing_disabled) ? AllowUsingGateway::No : AllowUsingGateway::Yes;
|
||||
auto routing_decision = route_to(m_peer_address, m_local_address, bound_interface(), allow_using_gateway);
|
||||
if (routing_decision.is_zero())
|
||||
return set_so_error(EHOSTUNREACH);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue