summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index a62bdf9fa0..6a5fe59d49 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1656,8 +1656,10 @@ static void link_update_operstate(Link *link) {
else
/* no useful addresses found */
link->operstate = LINK_OPERSTATE_CARRIER;
- } else
- link->operstate = LINK_OPERSTATE_UNKNOWN;
+ } else if (link->flags & IFF_UP)
+ link->operstate = LINK_OPERSTATE_UP;
+ else
+ link->operstate = LINK_OPERSTATE_DOWN;
}
int link_save(Link *link) {
@@ -1791,7 +1793,8 @@ static const char* const link_state_table[_LINK_STATE_MAX] = {
DEFINE_STRING_TABLE_LOOKUP(link_state, LinkState);
static const char* const link_operstate_table[_LINK_OPERSTATE_MAX] = {
- [LINK_OPERSTATE_UNKNOWN] = "unknown",
+ [LINK_OPERSTATE_DOWN] = "down",
+ [LINK_OPERSTATE_UP] = "up",
[LINK_OPERSTATE_DORMANT] = "dormant",
[LINK_OPERSTATE_CARRIER] = "carrier",
[LINK_OPERSTATE_DEGRADED] = "degraded",