]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/network/networkd-route.c
network: make address/route_configure optionally return created Address/Route object
[thirdparty/systemd.git] / src / network / networkd-route.c
index 62a9b8b9b3d7cba36e472f7de69af011d78b81dc..d8739b767928c3c656f0038d7438297272bd09f8 100644 (file)
@@ -597,7 +597,8 @@ static int append_nexthops(Route *route, sd_netlink_message *req) {
 int route_configure(
                 Route *route,
                 Link *link,
-                link_netlink_message_handler_t callback) {
+                link_netlink_message_handler_t callback,
+                Route **ret) {
 
         _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL;
         _cleanup_(sd_event_source_unrefp) sd_event_source *expire = NULL;
@@ -803,6 +804,9 @@ int route_configure(
         sd_event_source_unref(route->expire);
         route->expire = TAKE_PTR(expire);
 
+        if (ret)
+                *ret = route;
+
         return 1;
 }