network: call netlink in the last of route_configure()

Otherwise, assertion will be hit when route_add() fails.
This commit is contained in:
Yu Watanabe 2020-10-20 15:44:21 +09:00
parent 40075951dc
commit 0c54bfd698
1 changed files with 7 additions and 7 deletions

View File

@ -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;
}