#25 networkctl: Make networkctl lldp output backwards compatible with 255
Merged 15 days ago by ryantimwilson. Opened 15 days ago by ryantimwilson.
rpms/ ryantimwilson/systemd networkctl-lldp-fb  into  c10s-sig-hyperscale

@@ -0,0 +1,58 @@ 

+ 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

+ 

file modified
+4 -1
@@ -44,7 +44,7 @@ 

  # Allow users to specify the version and release when building the rpm by 

  # setting the %%version_override and %%release_override macros.

  Version:        %{?version_override}%{!?version_override:256.7}

- Release:        %{?release_override}%{!?release_override:1.7}%{?dist}

+ Release:        %{?release_override}%{!?release_override:1.8}%{?dist}

  

  %global stable %(c="%version"; [ "$c" = "${c#*.*}" ]; echo $?)

  
@@ -154,6 +154,9 @@ 

  # pam_systemd: Make pam_systemd 256 backwards compatible to logind 255

  Patch0905: 0001-pam_systemd-Make-pam_systemd-256-backwards-compatibl.patch

  

+ # networkctl: Make networkctl lldp output backwards compatible with 255

+ Patch0906: 0001-networkctl-Make-networkctl-lldp-output-backwards-com.patch

+ 

  %endif

  

  %ifarch %{ix86} x86_64 aarch64 riscv64

This adds a Meta-specific path to ensure networkctl lldp output is backwards compatible with v255 as many systems depend on this output in a certain format.

Going forward, we will migrate to using --json=pretty which was fixed in 256.

rebased onto 10c3e1e

15 days ago

rebased onto 10c3e1e

15 days ago

rebased onto 10c3e1e

15 days ago

Pull-Request has been merged by ryantimwilson

15 days ago