From: Yu Watanabe Date: Fri, 7 Jun 2019 05:18:55 +0000 (+0900) Subject: network: make all failures in route configuration fatal X-Git-Tag: v243-rc1~300^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1590dfa4a0b9d659a905818711256004ed2984bb;p=thirdparty%2Fsystemd.git network: make all failures in route configuration fatal --- diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index 88a72e39a98..ed196c446a1 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -114,7 +114,7 @@ static int link_set_dhcp_routes(Link *link) { r = route_configure(route, link, dhcp4_route_handler); if (r < 0) - return log_link_warning_errno(link, r, "Could not set host route: %m"); + return log_link_error_errno(link, r, "Could not set host route: %m"); link->dhcp4_messages++; } @@ -153,7 +153,7 @@ static int link_set_dhcp_routes(Link *link) { r = route_configure(route_gw, link, dhcp4_route_handler); if (r < 0) - return log_link_warning_errno(link, r, "Could not set host route: %m"); + return log_link_error_errno(link, r, "Could not set host route: %m"); link->dhcp4_messages++; @@ -169,11 +169,8 @@ static int link_set_dhcp_routes(Link *link) { route->table = table; r = route_configure(route, link, dhcp4_route_handler); - if (r < 0) { - log_link_warning_errno(link, r, "Could not set routes: %m"); - link_enter_failed(link); - return r; - } + if (r < 0) + return log_link_error_errno(link, r, "Could not set routes: %m"); link->dhcp4_messages++; } @@ -389,7 +386,11 @@ static int dhcp4_address_handler(sd_netlink *rtnl, sd_netlink_message *m, Link * } else if (r >= 0) manager_rtnl_process_address(rtnl, m, link->manager); - link_set_dhcp_routes(link); + r = link_set_dhcp_routes(link); + if (r < 0) { + link_enter_failed(link); + return 1; + } /* Add back static routes since kernel removes while DHCPv4 address is removed from when lease expires */ link_request_set_routes(link);