summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2020-08-18 19:21:25 +0900
committerLennart Poettering <lennart@poettering.net>2020-08-18 20:33:58 +0200
commit46b875fb803ce8ee9bcb6a23ad6339db4f735d3a (patch)
tree2f35f0402f4c9ed03cb2924ddf0dc0963fe6f67f
parentf9536e679331c0e637655397e12ad9c37f21d3b0 (diff)
downloadsystemd-46b875fb803ce8ee9bcb6a23ad6339db4f735d3a.tar.gz
network: do not fail if UseMTU=yes on DHCP lease lost
This fixes a bug introduced by 6906794dd1698954b349ec3ec84f1494ecd63cd3. Fixes #16768.
-rw-r--r--src/network/networkd-dhcp4.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
index 722e0d213b..d28c3e3806 100644
--- a/src/network/networkd-dhcp4.c
+++ b/src/network/networkd-dhcp4.c
@@ -429,18 +429,17 @@ static int dhcp_reset_mtu(Link *link) {
return 0;
r = sd_dhcp_lease_get_mtu(link->dhcp_lease, &mtu);
+ if (r == -ENODATA)
+ return 0;
if (r < 0)
- return r;
+ return log_link_error_errno(link, r, "DHCP error: failed to get MTU from lease: %m");
if (link->original_mtu == mtu)
return 0;
r = link_set_mtu(link, link->original_mtu);
- if (r < 0) {
- log_link_error_errno(link, r, "DHCP error: could not reset MTU: %m");
- link_enter_failed(link);
- return r;
- }
+ if (r < 0)
+ return log_link_error_errno(link, r, "DHCP error: could not reset MTU: %m");
return 0;
}