From 627cfe017c34ccd08a4a047a5548703b66d447cd Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Sat, 3 Apr 2021 01:42:32 +0000 Subject: Kernel: NetworkTask: Remove 10.0.2.x as default IP for NIC interfaces --- Kernel/Net/NetworkTask.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Kernel/Net/NetworkTask.cpp b/Kernel/Net/NetworkTask.cpp index 868997cc7f..6a325a8ee3 100644 --- a/Kernel/Net/NetworkTask.cpp +++ b/Kernel/Net/NetworkTask.cpp @@ -60,26 +60,16 @@ void NetworkTask::spawn() void NetworkTask_main(void*) { WaitQueue packet_wait_queue; - u8 octet = 15; int pending_packets = 0; NetworkAdapter::for_each([&](auto& adapter) { + dmesgln("NetworkTask: {} network adapter found: hw={}", adapter.class_name(), adapter.mac_address().to_string()); + if (String(adapter.class_name()) == "LoopbackAdapter") { adapter.set_ipv4_address({ 127, 0, 0, 1 }); adapter.set_ipv4_netmask({ 255, 0, 0, 0 }); adapter.set_ipv4_gateway({ 0, 0, 0, 0 }); - } else { - adapter.set_ipv4_address({ 10, 0, 2, octet++ }); - adapter.set_ipv4_netmask({ 255, 255, 255, 0 }); - adapter.set_ipv4_gateway({ 10, 0, 2, 2 }); } - dmesgln("NetworkTask: {} network adapter found: hw={}, ipv4_address={}, ipv4_netmask={}, ipv4_gateway={}", - adapter.class_name(), - adapter.mac_address().to_string(), - adapter.ipv4_address(), - adapter.ipv4_netmask(), - adapter.ipv4_gateway()); - adapter.on_receive = [&]() { pending_packets++; packet_wait_queue.wake_all(); -- cgit v1.2.3