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
commit 271bc4b2f2
Notes: sideshowbarker 2024-07-19 09:30:59 +09:00

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();