diff options
author | Susant Sahani <ssahani@vmware.com> | 2020-03-24 12:23:35 +0100 |
---|---|---|
committer | Susant Sahani <ssahani@vmware.com> | 2020-03-24 14:22:59 +0100 |
commit | a8389a33079e114569165def29b0dbbfbf3d0d8a (patch) | |
tree | e1759cade0f365573cc89c823fef16a9bcb34f40 | |
parent | shared: Introduce bridge util (diff) | |
download | systemd-a8389a33079e114569165def29b0dbbfbf3d0d8a.tar.xz systemd-a8389a33079e114569165def29b0dbbfbf3d0d8a.zip |
networkctl: Use string table for bridge state
-rw-r--r-- | src/network/networkctl.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/network/networkctl.c b/src/network/networkctl.c index fe511b0c35..ee50fdad8c 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -21,6 +21,7 @@ #include "bus-common-errors.h" #include "bus-error.h" #include "bus-util.h" +#include "bridge-util.h" #include "device-util.h" #include "escape.h" #include "ether-addr-util.h" @@ -1487,20 +1488,10 @@ static int link_status_one( return table_log_add_error(r); if (info->port_state <= BR_STATE_BLOCKING) { - static const struct { - const char *state; - } state_table[] = { - { "disabled" }, - { "listening" }, - { "learning" }, - { "forwarding" }, - { "blocking" }, - }; - r = table_add_many(table, TABLE_EMPTY, TABLE_STRING, "Port State:", - TABLE_STRING, state_table[info->port_state]); + TABLE_STRING, bridge_state_to_string(info->port_state)); } } else if (streq_ptr(info->netdev_kind, "bond")) { static const struct { |