return link_call_getlink(link, link_initialized_handler);
}
-static int link_check_initialized(Link *link) {
+int link_check_initialized(Link *link) {
_cleanup_(sd_device_unrefp) sd_device *device = NULL;
int r;
return 0;
}
+ /* Do not enter initialized state if we are enumerating. */
+ if (manager->enumerating)
+ return 0;
+
r = link_check_initialized(link);
if (r < 0) {
log_link_warning_errno(link, r, "Failed to check link is initialized: %m");
return 0;
}
+ /* Do not configure interface if we are enumerating. */
+ if (manager->enumerating)
+ return 0;
+
r = link_reconfigure_impl(link, /* force = */ false);
if (r < 0) {
log_link_warning_errno(link, r, "Failed to reconfigure interface: %m");
int link_reconfigure(Link *link, bool force);
int link_reconfigure_on_bus_method_reload(Link *link, sd_bus_message *message);
+int link_check_initialized(Link *link);
+
int manager_udev_process_link(Manager *m, sd_device *device, sd_device_action_t action);
int manager_rtnl_process_link(sd_netlink *rtnl, sd_netlink_message *message, Manager *m);
if (r < 0)
return log_error_errno(r, "Failed to initialize speed meter: %m");
+ HASHMAP_FOREACH(link, m->links_by_index) {
+ if (link->state != LINK_STATE_PENDING)
+ continue;
+
+ r = link_check_initialized(link);
+ if (r < 0) {
+ log_link_warning_errno(link, r, "Failed to check if link is initialized: %m");
+ link_enter_failed(link);
+ }
+ }
+
/* The dirty handler will deal with future serialization, but the first one
must be done explicitly. */