summaryrefslogtreecommitdiff
path: root/Kernel/Net
diff options
context:
space:
mode:
authorBrendan Coles <bcoles@gmail.com>2021-04-03 01:42:32 +0000
committerAndreas Kling <kling@serenityos.org>2021-04-03 11:25:18 +0200
commit627cfe017c34ccd08a4a047a5548703b66d447cd (patch)
treeaaf58da13f040491af265cc88b94133c5dbd345c /Kernel/Net
parentfa9ba8bce53e24c983e2cac53d205e0ed8882b82 (diff)
downloadserenity-627cfe017c34ccd08a4a047a5548703b66d447cd.zip
Kernel: NetworkTask: Remove 10.0.2.x as default IP for NIC interfaces
Diffstat (limited to 'Kernel/Net')
-rw-r--r--Kernel/Net/NetworkTask.cpp14
1 files 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();