mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
wait-online: Support waiting for interfaces to disappear
This commit is contained in:
parent
75cd4a5d92
commit
5cbaf95ee3
@ -69,6 +69,12 @@
|
||||
|
||||
<para>The operational status is one of the following:
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>missing</term>
|
||||
<listitem>
|
||||
<para>the device is missing</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>off</term>
|
||||
<listitem>
|
||||
|
@ -26,6 +26,7 @@ bool network_is_online(void) {
|
||||
}
|
||||
|
||||
static const char* const link_operstate_table[_LINK_OPERSTATE_MAX] = {
|
||||
[LINK_OPERSTATE_MISSING] = "missing",
|
||||
[LINK_OPERSTATE_OFF] = "off",
|
||||
[LINK_OPERSTATE_NO_CARRIER] = "no-carrier",
|
||||
[LINK_OPERSTATE_DORMANT] = "dormant",
|
||||
@ -91,7 +92,7 @@ int parse_operational_state_range(const char *str, LinkOperationalStateRange *ou
|
||||
return -EINVAL;
|
||||
|
||||
if (range.min == _LINK_OPERSTATE_INVALID)
|
||||
range.min = LINK_OPERSTATE_OFF;
|
||||
range.min = LINK_OPERSTATE_MISSING;
|
||||
if (range.max == _LINK_OPERSTATE_INVALID)
|
||||
range.max = LINK_OPERSTATE_ROUTABLE;
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
bool network_is_online(void);
|
||||
|
||||
typedef enum LinkOperationalState {
|
||||
LINK_OPERSTATE_MISSING,
|
||||
LINK_OPERSTATE_OFF,
|
||||
LINK_OPERSTATE_NO_CARRIER,
|
||||
LINK_OPERSTATE_DORMANT,
|
||||
|
@ -78,6 +78,11 @@ bool manager_configured(Manager *m) {
|
||||
LinkOperationalStateRange *range = p;
|
||||
|
||||
l = hashmap_get(m->links_by_name, ifname);
|
||||
if (!l && range->min == LINK_OPERSTATE_MISSING) {
|
||||
one_ready = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!l) {
|
||||
log_debug("still waiting for %s", ifname);
|
||||
if (!m->any)
|
||||
|
Loading…
Reference in New Issue
Block a user