1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

networkd: act on lease only if there is one

Interface could go down before acquiring a dhcp lease
This commit is contained in:
Umut Tezduyar Lindskog 2014-02-17 21:16:53 +01:00 committed by Tom Gundersen
parent acfbbf5c56
commit 17256461f5

View File

@ -626,10 +626,12 @@ static void dhcp_handler(sd_dhcp_client *client, int event, void *userdata) {
return;
}
r = dhcp_lease_lost(link);
if (r < 0) {
link_enter_failed(link);
return;
if (link->dhcp_lease) {
r = dhcp_lease_lost(link);
if (r < 0) {
link_enter_failed(link);
return;
}
}
if (event == DHCP_EVENT_IP_CHANGE) {