diff options
author | Tom Gundersen <teg@jklm.no> | 2013-11-14 16:22:51 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2013-11-17 23:12:27 +0100 |
commit | f882c247ad59776c3a7753bb963c1f8e2386cb79 (patch) | |
tree | fa042fb8ddef72319f7a66aa4c267fa8824c5995 /src/network/networkd-route.c | |
parent | 8cd11a0f0f4ca05199e1166f6a07472b296f7455 (diff) |
networkd: make all calls async
Diffstat (limited to 'src/network/networkd-route.c')
-rw-r--r-- | src/network/networkd-route.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 31586165c2..6ac5c52472 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -54,12 +54,14 @@ void route_free(Route *route) { free(route); } -int route_configure(Manager *manager, Route *route, Link *link) { +int route_configure(Route *route, Link *link, + sd_rtnl_message_handler_t callback) { _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *req = NULL; int r; - assert(manager); assert(link); + assert(link->manager); + assert(link->manager->rtnl); assert(link->ifindex > 0); assert(route->family == AF_INET || route->family == AF_INET6); @@ -83,13 +85,13 @@ int route_configure(Manager *manager, Route *route, Link *link) { return r; } - r = sd_rtnl_call(manager->rtnl, req, 0, NULL); + r = sd_rtnl_call_async(link->manager->rtnl, req, callback, link, 0, NULL); if (r < 0) { - log_error("Could not configure route: %s", strerror(-r)); + log_error("Could not send rtnetlink message: %s", strerror(-r)); return r; } - log_info("Configured route"); + link->rtnl_messages ++; return 0; } |