summaryrefslogtreecommitdiff
path: root/Userland/Services/DHCPClient/main.cpp
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-05-26 07:26:07 +0200
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-05-27 15:53:49 +0430
commitc73116b2e212598d7fd52a8a8595ed383d8b2ff5 (patch)
treec8908aeaec04e375b471ef1878b36c24d3f4bb84 /Userland/Services/DHCPClient/main.cpp
parent2952c86f3859b579bdf53d1eb57c33775710d64b (diff)
downloadserenity-c73116b2e212598d7fd52a8a8595ed383d8b2ff5.zip
DHCPClient: Resend DHCP packets when we don't receive an answer
Previously we'd only only send one DHCP request for network interfaces which were up when DHCPClient started. If that packet was lost we'd never send another request for those interfaces. Also, if an interface were to appear after DHCPClient started (not that that is possible at the moment) we wouldn't send requests for that interface either.
Diffstat (limited to 'Userland/Services/DHCPClient/main.cpp')
-rw-r--r--Userland/Services/DHCPClient/main.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/Userland/Services/DHCPClient/main.cpp b/Userland/Services/DHCPClient/main.cpp
index a150b07e4a..6d55e675b1 100644
--- a/Userland/Services/DHCPClient/main.cpp
+++ b/Userland/Services/DHCPClient/main.cpp
@@ -34,14 +34,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
unveil(nullptr, nullptr);
- auto ifs_result = DHCPv4Client::get_discoverable_interfaces();
- if (ifs_result.is_error()) {
- warnln("Error: {}", ifs_result.error());
- return 1;
- }
-
- auto ifs = ifs_result.release_value();
- auto client = DHCPv4Client::construct(move(ifs.ready), move(ifs.not_ready));
+ auto client = DHCPv4Client::construct();
if (pledge("stdio inet cpath rpath", nullptr) < 0) {
perror("pledge");