mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-09 01:56:21 +00:00
Kernel: Use WeakPtr<NetworkAdapter> instead of NetworkAdapter* in net code
This commit is contained in:
committed by
Andreas Kling
parent
d6bce37756
commit
54ceabd48d
@@ -1,10 +1,10 @@
|
||||
#include <Kernel/Net/LoopbackAdapter.h>
|
||||
#include <Kernel/Net/Routing.h>
|
||||
|
||||
NetworkAdapter* adapter_for_route_to(const IPv4Address& ipv4_address)
|
||||
WeakPtr<NetworkAdapter> adapter_for_route_to(const IPv4Address& ipv4_address)
|
||||
{
|
||||
// FIXME: Have an actual routing table.
|
||||
if (ipv4_address == IPv4Address(127, 0, 0, 1))
|
||||
return &LoopbackAdapter::the();
|
||||
return LoopbackAdapter::the().make_weak_ptr();
|
||||
return NetworkAdapter::from_ipv4_address(IPv4Address(192, 168, 5, 2));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user