diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-12-02 01:01:02 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-12-05 12:53:29 +0100 |
commit | 613ade9deca60a53235490de6e0d6281ea2ac295 (patch) | |
tree | fb6972502a6e86a16ad08e1858b6a8a6513c50a0 /Kernel/Net/IPv4Socket.cpp | |
parent | 641498954fd79772de365435ed24ef6c79cbee48 (diff) | |
download | serenity-613ade9deca60a53235490de6e0d6281ea2ac295.zip |
Kernel: Implement the SO_DONTROUTE SOL_SOCKET-level option
Diffstat (limited to 'Kernel/Net/IPv4Socket.cpp')
-rw-r--r-- | Kernel/Net/IPv4Socket.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Net/IPv4Socket.cpp b/Kernel/Net/IPv4Socket.cpp index 1b0445d94a..fb0a19052a 100644 --- a/Kernel/Net/IPv4Socket.cpp +++ b/Kernel/Net/IPv4Socket.cpp @@ -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); |