ryantimwilson / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone
Ryan Wilson 9cbcc8
From 7d236cbb2ceea8881e57d9f2e2af091088c4f178 Mon Sep 17 00:00:00 2001
Ryan Wilson 9cbcc8
From: Ryan Wilson <ryantimwilson@meta4.com>
Ryan Wilson 9cbcc8
Date: Tue, 3 Dec 2024 14:46:54 -0800
Ryan Wilson 9cbcc8
Subject: [PATCH] networkctl: Make networkctl lldp output backwards compatible
Ryan Wilson 9cbcc8
 with 255
Ryan Wilson 9cbcc8
Ryan Wilson 9cbcc8
---
Ryan Wilson 9cbcc8
 src/network/networkctl.c | 16 +++++++---------
Ryan Wilson 9cbcc8
 1 file changed, 7 insertions(+), 9 deletions(-)
Ryan Wilson 9cbcc8
Ryan Wilson 9cbcc8
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
Ryan Wilson 9cbcc8
index a447c39a64..8b15ba1fdf 100644
Ryan Wilson 9cbcc8
--- a/src/network/networkctl.c
Ryan Wilson 9cbcc8
+++ b/src/network/networkctl.c
Ryan Wilson 9cbcc8
@@ -2608,12 +2608,11 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
Ryan Wilson 9cbcc8
 
Ryan Wilson 9cbcc8
         table = table_new("index",
Ryan Wilson 9cbcc8
                           "link",
Ryan Wilson 9cbcc8
-                          "system-name",
Ryan Wilson 9cbcc8
-                          "system-description",
Ryan Wilson 9cbcc8
                           "chassis-id",
Ryan Wilson 9cbcc8
+                          "system-name",
Ryan Wilson 9cbcc8
+                          "caps",
Ryan Wilson 9cbcc8
                           "port-id",
Ryan Wilson 9cbcc8
-                          "port-description",
Ryan Wilson 9cbcc8
-                          "caps");
Ryan Wilson 9cbcc8
+                          "port-description");
Ryan Wilson 9cbcc8
         if (!table)
Ryan Wilson 9cbcc8
                 return log_oom();
Ryan Wilson 9cbcc8
 
Ryan Wilson 9cbcc8
@@ -2626,7 +2625,7 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
Ryan Wilson 9cbcc8
         table_hide_column_from_display(table, (size_t) 0);
Ryan Wilson 9cbcc8
 
Ryan Wilson 9cbcc8
         /* Make the capabilities not truncated */
Ryan Wilson 9cbcc8
-        assert_se(cell = table_get_cell(table, 0, 7));
Ryan Wilson 9cbcc8
+        assert_se(cell = table_get_cell(table, 0, 4));
Ryan Wilson 9cbcc8
         table_set_minimum_width(table, cell, 11);
Ryan Wilson 9cbcc8
 
Ryan Wilson 9cbcc8
         JsonVariant *i;
Ryan Wilson 9cbcc8
@@ -2655,12 +2654,11 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
Ryan Wilson 9cbcc8
                         r = table_add_many(table,
Ryan Wilson 9cbcc8
                                            TABLE_INT,    info.ifindex,
Ryan Wilson 9cbcc8
                                            TABLE_STRING, info.ifname,
Ryan Wilson 9cbcc8
-                                           TABLE_STRING, neighbor_info.system_name,
Ryan Wilson 9cbcc8
-                                           TABLE_STRING, neighbor_info.system_description,
Ryan Wilson 9cbcc8
                                            TABLE_STRING, neighbor_info.chassis_id,
Ryan Wilson 9cbcc8
+                                           TABLE_STRING, neighbor_info.system_name,
Ryan Wilson 9cbcc8
+                                           TABLE_STRING, cap_str,
Ryan Wilson 9cbcc8
                                            TABLE_STRING, neighbor_info.port_id,
Ryan Wilson 9cbcc8
-                                           TABLE_STRING, neighbor_info.port_description,
Ryan Wilson 9cbcc8
-                                           TABLE_STRING, cap_str);
Ryan Wilson 9cbcc8
+                                           TABLE_STRING, neighbor_info.port_description);
Ryan Wilson 9cbcc8
                         if (r < 0)
Ryan Wilson 9cbcc8
                                 return table_log_add_error(r);
Ryan Wilson 9cbcc8
 
Ryan Wilson 9cbcc8
-- 
Ryan Wilson 9cbcc8
2.43.5
Ryan Wilson 9cbcc8