Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bda877800c |
2 changed files with 86 additions and 0 deletions
85
0001-ss-show-extra-info-when-processes-is-not-used.patch
Normal file
85
0001-ss-show-extra-info-when-processes-is-not-used.patch
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
From 87d804ca0854b09c07872e9fd6036bf5d3e0cc85 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <87d804ca0854b09c07872e9fd6036bf5d3e0cc85.1716984652.git.dcaratti@redhat.com>
|
||||
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
|
||||
Date: Sat, 13 Jan 2024 18:10:21 +0100
|
||||
Subject: [PATCH] ss: show extra info when '--processes' is not used
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2279920
|
||||
Upstream status:all mainline in iproute.git
|
||||
|
||||
commit 87d804ca0854b09c07872e9fd6036bf5d3e0cc85
|
||||
Author: Matthieu Baerts (NGI0) <matttbe@kernel.org>
|
||||
Date: Sat, 13 Jan 2024 18:10:21 +0100
|
||||
|
||||
ss: show extra info when '--processes' is not used
|
||||
|
||||
A recent modification broke "extra" options for all protocols showing
|
||||
info about the processes when '-p' / '--processes' option was not used
|
||||
as well. In other words, all the additional bits displayed at the end or
|
||||
at the next line were no longer printed if the user didn't ask to show
|
||||
info about processes as well.
|
||||
|
||||
The reason is that, the "current_field" pointer never switched to the
|
||||
"Ext" column. If the user didn't ask to display the processes, nothing
|
||||
happened when trying to print extra bits using the "out()" function,
|
||||
because the current field was still pointing to the "Process" one, now
|
||||
marked as disabled.
|
||||
|
||||
Before the commit mentioned below, it was not an issue not to switch to
|
||||
the "Ext" or "Process" columns because they were never marked as
|
||||
"disabled".
|
||||
|
||||
Here is a quick list of options that were no longer displayed if '-p' /
|
||||
'--processes' was not set:
|
||||
|
||||
- AF_INET(6):
|
||||
-o, --options
|
||||
-e, --extended
|
||||
--tos
|
||||
--cgroup
|
||||
--inet-sockopt
|
||||
-m, --memory
|
||||
-i, --info
|
||||
|
||||
- AF_PACKET:
|
||||
-e, --extended
|
||||
|
||||
- AF_XDP:
|
||||
-e, --extended
|
||||
|
||||
- AF_UNIX:
|
||||
-m, --memory
|
||||
-e, --extended
|
||||
|
||||
- TIPC:
|
||||
--tipcinfo
|
||||
|
||||
That was just by quickly reading the code, I probably missed some. But
|
||||
this shows that the impact can be quite important for all scripts using
|
||||
'ss' to monitor connections or to report info.
|
||||
|
||||
Fixes: 1607bf53 ("ss: prevent "Process" column from being printed unless requested")
|
||||
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
|
||||
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
|
||||
---
|
||||
misc/ss.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/misc/ss.c b/misc/ss.c
|
||||
index 900fefa42015..5296cabe9982 100644
|
||||
--- a/misc/ss.c
|
||||
+++ b/misc/ss.c
|
||||
@@ -2427,6 +2427,8 @@ static void proc_ctx_print(struct sockstat *s)
|
||||
free(buf);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ field_next();
|
||||
}
|
||||
|
||||
static void inet_stats_print(struct sockstat *s, bool v6only)
|
||||
--
|
||||
2.44.0
|
||||
|
||||
|
|
@ -5,6 +5,7 @@ Release: %autorelease
|
|||
URL: https://kernel.org/pub/linux/utils/net/%{name}2/
|
||||
Source0: https://kernel.org/pub/linux/utils/net/%{name}2/%{name}2-%{version}.tar.xz
|
||||
Patch0: 0001-iproute2-fix-build-failure-on-ppc64le.patch
|
||||
Patch1: 0001-ss-show-extra-info-when-processes-is-not-used.patch
|
||||
|
||||
License: GPL-2.0-or-later AND NIST-PD
|
||||
BuildRequires: bison
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue