From: Yu Watanabe Date: Tue, 20 Oct 2020 06:44:21 +0000 (+0900) Subject: network: call netlink in the last of route_configure() X-Git-Tag: v247-rc1~29^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0c54bfd698925c0449a85399bbf8d30b10295f7b;p=thirdparty%2Fsystemd.git network: call netlink in the last of route_configure() Otherwise, assertion will be hit when route_add() fails. --- diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 85d540c32ab..dd05e11067b 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -1119,13 +1119,6 @@ int route_configure( if (r < 0) return log_link_error_errno(link, r, "Could not append RTA_MULTIPATH attribute: %m"); - r = netlink_call_async(link->manager->rtnl, NULL, req, callback, - link_netlink_destroy_callback, link); - if (r < 0) - return log_link_error_errno(link, r, "Could not send rtnetlink message: %m"); - - link_ref(link); - if (ordered_set_isempty(route->multipath_routes)) { Route *nr; @@ -1147,6 +1140,13 @@ int route_configure( } } + r = netlink_call_async(link->manager->rtnl, NULL, req, callback, + link_netlink_destroy_callback, link); + if (r < 0) + return log_link_error_errno(link, r, "Could not send rtnetlink message: %m"); + + link_ref(link); + return 0; }