mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:58:12 +00:00
Kernel: Route all loopback traffic through the loopback adapter
This commit is contained in:
parent
04cbdb2e6f
commit
5ca7ae4585
2 changed files with 7 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
#include <Kernel/Net/LoopbackAdapter.h>
|
||||
#include <Kernel/Net/Routing.h>
|
||||
#include <Kernel/Thread.h>
|
||||
|
||||
|
@ -18,6 +19,9 @@ bool RoutingDecision::is_zero() const
|
|||
|
||||
RoutingDecision route_to(const IPv4Address& target, const IPv4Address& source)
|
||||
{
|
||||
if (target[0] == 127)
|
||||
return { LoopbackAdapter::the().make_weak_ptr(), {} };
|
||||
|
||||
auto target_addr = target.to_u32();
|
||||
auto source_addr = source.to_u32();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue