1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:37:37 +00:00

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.
This commit is contained in:
Gunnar Beutner 2021-05-26 07:26:07 +02:00 committed by Ali Mohammad Pur
parent 2952c86f38
commit c73116b2e2
3 changed files with 30 additions and 42 deletions

View file

@ -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");