link->n_ref = 1;
link->manager = manager;
- link->state = LINK_STATE_INITIALIZING;
+ link->state = LINK_STATE_PENDING;
link->ifindex = ifindex;
link->ifname = strdup(ifname);
if (!link->ifname)
assert(link);
assert(link->network);
- assert(link->state == LINK_STATE_INITIALIZING);
+ assert(link->state == LINK_STATE_PENDING);
link->state = LINK_STATE_ENSLAVING;
assert(link);
assert(link->network);
- assert(link->state == LINK_STATE_INITIALIZING);
+ assert(link->state == LINK_STATE_PENDING);
if (link->network->ipv4ll) {
r = ipv4ll_configure(link);
assert(link->ifname);
assert(link->manager);
- if (link->state != LINK_STATE_INITIALIZING)
+ if (link->state != LINK_STATE_PENDING)
return 1;
log_debug_link(link, "link state is up-to-date");
assert(link->manager->rtnl);
assert(device);
- if (link->state != LINK_STATE_INITIALIZING)
+ if (link->state != LINK_STATE_PENDING)
return 0;
if (link->udev_device)
if (udev_device_get_is_initialized(device) <= 0) {
/* not yet ready */
- log_debug_link(link, "udev initializing link...");
+ log_debug_link(link, "link pending udev initialization...");
return 0;
}
}
static const char* const link_state_table[_LINK_STATE_MAX] = {
- [LINK_STATE_INITIALIZING] = "initializing",
+ [LINK_STATE_PENDING] = "pending",
[LINK_STATE_ENSLAVING] = "configuring",
[LINK_STATE_SETTING_ADDRESSES] = "configuring",
[LINK_STATE_SETTING_ROUTES] = "configuring",
int sd_network_get_ntp(char ***addr);
/* Get state from ifindex.
- * Possible states: failed, configuring, configured, unmanaged
+ * Possible states:
+ * pending: udev is still processing the link, we don't yet know if we will manage it
+ * failed: networkd failed to manage the link
+ * configuring: in the process of retrieving configuration or configuring the link
+ * configured: link configured successfully
+ * unmanaged: networkd is not handling the link
+ * linger: the link is gone, but has not yet been dropped by networkd
* Possible return codes:
* -ENODATA: networkd is not aware of the link
- * -EBUSY: udev is still processing the link, networkd does not yet know if it will manage it
*/
int sd_network_get_link_state(int ifindex, char **state);