Net: Short-circuit routing to the IPv4 address of a local adapter

This makes it possible to open http://localhost:8000/ in Browser. :^)
This commit is contained in:
Andreas Kling 2020-02-09 13:59:38 +01:00
parent 80703ef7d9
commit db2ede9427

View file

@ -68,6 +68,10 @@ RoutingDecision route_to(const IPv4Address& target, const IPv4Address& source)
gateway_adapter = adapter;
});
if (local_adapter && target == local_adapter->ipv4_address())
return { local_adapter, local_adapter->mac_address() };
if (!local_adapter && !gateway_adapter) {
#ifdef ROUTING_DEBUG
kprintf("Routing: Couldn't find a suitable adapter for route to %s\n",