From 2aa0885220235c422ef7cd7a04517d102ad53370 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 2 Dec 2021 11:51:59 +0000 Subject: [PATCH] DHCP4Client: Cast unused Timer return values to void Timers attach themselves to the provided parent, so they are safely kept alive. --- Userland/Services/DHCPClient/DHCPv4Client.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Services/DHCPClient/DHCPv4Client.cpp b/Userland/Services/DHCPClient/DHCPv4Client.cpp index d17b6c5d0f..7de5097336 100644 --- a/Userland/Services/DHCPClient/DHCPv4Client.cpp +++ b/Userland/Services/DHCPClient/DHCPv4Client.cpp @@ -243,7 +243,7 @@ void DHCPv4Client::handle_ack(const DHCPv4Packet& packet, const ParsedDHCPv4Opti interface.current_ip_address = new_ip; auto lease_time = AK::convert_between_host_and_network_endian(options.get(DHCPOption::IPAddressLeaseTime).value_or(transaction->offered_lease_time)); // set a timer for the duration of the lease, we shall renew if needed - Core::Timer::create_single_shot( + (void)Core::Timer::create_single_shot( lease_time * 1000, [this, transaction, interface = InterfaceDescriptor { interface }] { transaction->accepted_offer = false; @@ -267,7 +267,7 @@ void DHCPv4Client::handle_nak(const DHCPv4Packet& packet, const ParsedDHCPv4Opti transaction->accepted_offer = false; transaction->has_ip = false; auto& iface = transaction->interface; - Core::Timer::create_single_shot( + (void)Core::Timer::create_single_shot( 10000, [this, iface = InterfaceDescriptor { iface }] { dhcp_discover(iface);