mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
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:
parent
80703ef7d9
commit
db2ede9427
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue