summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-08-12 20:00:34 +0200
committerTom Gundersen <teg@jklm.no>2014-08-12 20:42:59 +0200
commit54cba0b16cdc94d5c21e8d805a4ade1255d43bc9 (patch)
tree3fc9ab6e6d10b25f5aca724f0e836c31eb0507f3 /src/network/networkd-link.c
parent3c9b886068d99e5d3cbabcac32a4decf37244c54 (diff)
sd-network: split the operstate 'unknown' into 'down' and 'up'
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",