1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:17:35 +00:00

Net: When routing to loopback, use the loopback adapter's MAC address

Otherwise the routing decision gets interpreted as "host unreachable."
This commit is contained in:
Andreas Kling 2020-02-09 12:03:53 +01:00
parent d8a30e2ad2
commit 271bc4b2f2

View file

@ -46,7 +46,7 @@ bool RoutingDecision::is_zero() const
RoutingDecision route_to(const IPv4Address& target, const IPv4Address& source)
{
if (target[0] == 127)
return { LoopbackAdapter::the(), {} };
return { LoopbackAdapter::the(), LoopbackAdapter::the().mac_address() };
auto target_addr = target.to_u32();
auto source_addr = source.to_u32();