Skip to content

Commit

Permalink
Net: Short-circuit routing to the IPv4 address of a local adapter
Browse files Browse the repository at this point in the history
This makes it possible to open https://localhost:8000/ in Browser. :^)
  • Loading branch information
awesomekling committed Feb 9, 2020
1 parent 80703ef commit db2ede9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Kernel/Net/Routing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit db2ede9

Please sign in to comment.