diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-07-06 08:47:24 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-07-11 22:37:00 +0900 |
commit | 661113a2a2ff67973a08a27f95a8ca40f3251309 (patch) | |
tree | 4aad0af9aa2cad2b8c71cd274e67841b1117a4f5 /src/network/networkd-dhcp4.c | |
parent | 10859c490295cf48f073b49b94eb07563424a2fc (diff) | |
download | systemd-661113a2a2ff67973a08a27f95a8ca40f3251309.tar.gz systemd-661113a2a2ff67973a08a27f95a8ca40f3251309.tar.bz2 systemd-661113a2a2ff67973a08a27f95a8ca40f3251309.zip |
network: route_configure() do nothing when it returns 0
Diffstat (limited to 'src/network/networkd-dhcp4.c')
-rw-r--r-- | src/network/networkd-dhcp4.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index c0d776f464..153182e894 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; |