]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkctl: Use bond util common functions 15165/head
authorSusant Sahani <ssahani@vmware.com>
Sun, 17 May 2020 04:17:25 +0000 (06:17 +0200)
committerSusant Sahani <ssahani@vmware.com>
Sun, 17 May 2020 08:02:03 +0000 (10:02 +0200)
src/network/networkctl.c

index 1a120970d953a5a4bfd5e67b7f0bfd9eb62ea9d4..91c1de1507b2edcbba50083e6724e939b3645cc4 100644 (file)
@@ -18,6 +18,7 @@
 #include "sd-network.h"
 
 #include "alloc-util.h"
+#include "bond-util.h"
 #include "bus-common-errors.h"
 #include "bus-error.h"
 #include "bus-util.h"
@@ -1531,22 +1532,10 @@ static int link_status_one(
                                            TABLE_STRING, bridge_state_to_string(info->port_state));
                 }
         } else if (streq_ptr(info->netdev_kind, "bond")) {
-                static const struct {
-                        const char *mode;
-                } mode_table[] = {
-                        { "balance-rr" },
-                        { "active-backup" },
-                        { "balance-xor" },
-                        { "broadcast" },
-                        { "802.3ad" },
-                        { "balance-tlb" },
-                        { "balance-alb" },
-                };
-
                 r = table_add_many(table,
                                    TABLE_EMPTY,
                                    TABLE_STRING, "Mode:",
-                                   TABLE_STRING, mode_table[info->mode],
+                                   TABLE_STRING,  bond_mode_to_string(info->mode),
                                    TABLE_EMPTY,
                                    TABLE_STRING, "Miimon:",
                                    TABLE_TIMESPAN_MSEC, jiffies_to_usec(info->miimon),