+int link_initialized(Link *link, struct udev_device *device) {
+ _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL;
+ int r;
+
+ assert(link);
+ assert(link->manager);
+ assert(link->manager->rtnl);
+ assert(device);
+
+ if (link->state != LINK_STATE_INITIALIZING)
+ return 0;
+
+ log_debug_link(link, "udev initialized link");
+
+ link->udev_device = udev_device_ref(device);
+
+ /* udev has initialized the link, but we don't know if we have yet processed
+ the NEWLINK messages with the latest state. Do a GETLINK, when it returns
+ we know that the pending NEWLINKs have already been processed and that we
+ are up-to-date */
+
+ r = sd_rtnl_message_new_link(link->manager->rtnl, &req, RTM_GETLINK, link->ifindex);
+ if (r < 0)
+ return r;
+
+ r = sd_rtnl_call_async(link->manager->rtnl, req, link_initialized_and_synced, link, 0, NULL);
+ if (r < 0)
+ return r;
+
+ return 0;
+}
+