diff --git a/Kernel/Net/NetworkAdapter.cpp b/Kernel/Net/NetworkAdapter.cpp index 5db9d5c286..3666f8f265 100644 --- a/Kernel/Net/NetworkAdapter.cpp +++ b/Kernel/Net/NetworkAdapter.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -29,6 +30,8 @@ WeakPtr NetworkAdapter::from_ipv4_address(const IPv4Address& add if (adapter->ipv4_address() == address) return adapter->make_weak_ptr(); } + if (address[0] == 127) + return LoopbackAdapter::the().make_weak_ptr(); return nullptr; } diff --git a/Kernel/Net/Routing.cpp b/Kernel/Net/Routing.cpp index befbaf7bb5..eaf5c40d3f 100644 --- a/Kernel/Net/Routing.cpp +++ b/Kernel/Net/Routing.cpp @@ -1,3 +1,4 @@ +#include #include #include @@ -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();