Przeglądaj źródła

NetworkServer: Enable DHCP on interfaces that are not listed in config

Maciej 3 lat temu
rodzic
commit
65307cf5cc

+ 0 - 3
Base/etc/Network.ini

@@ -1,5 +1,2 @@
 [ep1s0]
 [ep1s0]
 Enabled=false
 Enabled=false
-
-[ep0s8]
-DHCP=true

+ 2 - 1
Userland/Services/NetworkServer/main.cpp

@@ -54,7 +54,8 @@ ErrorOr<int> serenity_main(Main::Arguments)
 
 
         InterfaceConfig config;
         InterfaceConfig config;
         if (!groups.contains_slow(ifname)) {
         if (!groups.contains_slow(ifname)) {
-            dbgln("Config for interface {} doesn't exist, not enabling it", ifname);
+            dbgln("Config for interface {} doesn't exist, enabling DHCP for it", ifname);
+            interfaces_with_dhcp_enabled.append(ifname);
         } else {
         } else {
             config.enabled = config_file->read_bool_entry(ifname, "Enabled", true);
             config.enabled = config_file->read_bool_entry(ifname, "Enabled", true);
             config.dhcp_enabled = config_file->read_bool_entry(ifname, "DHCP", false);
             config.dhcp_enabled = config_file->read_bool_entry(ifname, "DHCP", false);