From: Yu Watanabe Date: Fri, 5 Jul 2019 23:47:24 +0000 (+0900) Subject: network: route_configure() do nothing when it returns 0 X-Git-Tag: v243-rc1~145^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=661113a2a2ff67973a08a27f95a8ca40f3251309;p=thirdparty%2Fsystemd.git network: route_configure() do nothing when it returns 0 --- diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index c0d776f464b..153182e894b 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -153,8 +153,8 @@ static int link_set_dhcp_routes(Link *link) { r = route_configure(route, link, dhcp4_route_handler); if (r < 0) return log_link_error_errno(link, r, "Could not set host route: %m"); - - link->dhcp4_messages++; + if (r > 0) + link->dhcp4_messages++; } r = sd_dhcp_lease_get_router(link->dhcp_lease, &router); @@ -192,8 +192,8 @@ static int link_set_dhcp_routes(Link *link) { r = route_configure(route_gw, link, dhcp4_route_handler); if (r < 0) return log_link_error_errno(link, r, "Could not set host route: %m"); - - link->dhcp4_messages++; + if (r > 0) + link->dhcp4_messages++; r = route_new(&route); if (r < 0) @@ -209,8 +209,8 @@ static int link_set_dhcp_routes(Link *link) { r = route_configure(route, link, dhcp4_route_handler); if (r < 0) return log_link_error_errno(link, r, "Could not set routes: %m"); - - link->dhcp4_messages++; + if (r > 0) + link->dhcp4_messages++; } return 0;