Blob Blame History Raw
From 7d236cbb2ceea8881e57d9f2e2af091088c4f178 Mon Sep 17 00:00:00 2001
From: Ryan Wilson <ryantimwilson@meta4.com>
Date: Tue, 3 Dec 2024 14:46:54 -0800
Subject: [PATCH] networkctl: Make networkctl lldp output backwards compatible
 with 255

---
 src/network/networkctl.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/network/networkctl.c b/src/network/networkctl.c
index a447c39a64..8b15ba1fdf 100644
--- a/src/network/networkctl.c
+++ b/src/network/networkctl.c
@@ -2608,12 +2608,11 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
 
         table = table_new("index",
                           "link",
-                          "system-name",
-                          "system-description",
                           "chassis-id",
+                          "system-name",
+                          "caps",
                           "port-id",
-                          "port-description",
-                          "caps");
+                          "port-description");
         if (!table)
                 return log_oom();
 
@@ -2626,7 +2625,7 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
         table_hide_column_from_display(table, (size_t) 0);
 
         /* Make the capabilities not truncated */
-        assert_se(cell = table_get_cell(table, 0, 7));
+        assert_se(cell = table_get_cell(table, 0, 4));
         table_set_minimum_width(table, cell, 11);
 
         JsonVariant *i;
@@ -2655,12 +2654,11 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
                         r = table_add_many(table,
                                            TABLE_INT,    info.ifindex,
                                            TABLE_STRING, info.ifname,
-                                           TABLE_STRING, neighbor_info.system_name,
-                                           TABLE_STRING, neighbor_info.system_description,
                                            TABLE_STRING, neighbor_info.chassis_id,
+                                           TABLE_STRING, neighbor_info.system_name,
+                                           TABLE_STRING, cap_str,
                                            TABLE_STRING, neighbor_info.port_id,
-                                           TABLE_STRING, neighbor_info.port_description,
-                                           TABLE_STRING, cap_str);
+                                           TABLE_STRING, neighbor_info.port_description);
                         if (r < 0)
                                 return table_log_add_error(r);
 
-- 
2.43.5