diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2015-09-04 21:16:35 +0200 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2015-09-04 21:22:44 +0200 |
commit | 397d15fd397060a19a90969b6aa283965c40fb27 (patch) | |
tree | e8405d264ecb418044a6cb07bcf02072ecb45691 /src/network/networkd-dhcp4.c | |
parent | 794ec1eb8b29674e93f8ef20673b0f8e42903733 (diff) |
networkd: adjust error codes for nonexisting DHCP data
Commit 0339cd770 changed libsystemd-network's error code for missing DHCP lease
data from ENOENT to ENODATA. Adjust networkd accordingly.
This fixes interfaces being stuck in "degraded/configuring" mode forever.
https://github.com/systemd/systemd/issues/1147
Diffstat (limited to 'src/network/networkd-dhcp4.c')
-rw-r--r-- | src/network/networkd-dhcp4.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index 36601367bf..4ffb01382f 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -60,7 +60,7 @@ static int link_set_dhcp_routes(Link *link) { assert(link->dhcp_lease); r = sd_dhcp_lease_get_router(link->dhcp_lease, &gateway); - if (r < 0 && r != -ENOENT) + if (r < 0 && r != -ENODATA) return log_link_warning_errno(link, r, "DHCP error: could not get gateway: %m"); if (r >= 0) { @@ -112,7 +112,7 @@ static int link_set_dhcp_routes(Link *link) { } n = sd_dhcp_lease_get_routes(link->dhcp_lease, &static_routes); - if (n == -ENOENT) + if (n == -ENODATA) return 0; if (n < 0) return log_link_warning_errno(link, n, "DHCP error: could not get routes: %m"); @@ -378,7 +378,7 @@ static int dhcp_lease_acquired(sd_dhcp_client *client, Link *link) { prefixlen = in_addr_netmask_to_prefixlen(&netmask); r = sd_dhcp_lease_get_router(lease, &gateway); - if (r < 0 && r != -ENOENT) + if (r < 0 && r != -ENODATA) return log_link_error_errno(link, r, "DHCP error: Could not get gateway: %m"); if (r >= 0) |