summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-05 12:21:20 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-05 12:21:20 +0200
commit33ce5f6a0bf21ed74e33076f500db01a1520972a (patch)
tree944cac6b716afade6f4e54b5fffc1b7fa720edb8
parentf4906a277b533a9d51b16b3fcc8a651f21e3a3b8 (diff)
parent397d15fd397060a19a90969b6aa283965c40fb27 (diff)
Merge pull request #1149 from martinpitt/fix-dhcp-error-codes
networkd: adjust error codes for nonexisting DHCP data
-rw-r--r--src/network/networkd-dhcp4.c6
-rw-r--r--src/network/networkd-manager.c6
2 files changed, 6 insertions, 6 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)
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
index 16f732f244..92b607297d 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
@@ -757,7 +757,7 @@ int manager_save(Manager *m) {
r = set_put_in_addrv(dns, addresses, r);
if (r < 0)
return r;
- } else if (r < 0 && r != -ENOENT)
+ } else if (r < 0 && r != -ENODATA)
return r;
}
@@ -769,7 +769,7 @@ int manager_save(Manager *m) {
r = set_put_in_addrv(ntp, addresses, r);
if (r < 0)
return r;
- } else if (r < 0 && r != -ENOENT)
+ } else if (r < 0 && r != -ENODATA)
return r;
}
@@ -781,7 +781,7 @@ int manager_save(Manager *m) {
r = set_put_strdup(domains, domainname);
if (r < 0)
return r;
- } else if (r != -ENOENT)
+ } else if (r != -ENODATA)
return r;
}
}