Skip to content
Snippets Groups Projects
Verified Commit 14cfd95e authored by Matthieu Baerts's avatar Matthieu Baerts
Browse files

debian: backport proper fix for ss' output


Instead of reverting the commit causing the issue, a new patch has just
been accepted upstream, properly fixing the issue without loosing the
new feature introduced in v6.7.0.

We can then drop the revert and replace it with the fix instead. That
will also ease the switch to newer versions of IPRoute2 later.

Fixes: 953d7ad6 ("debian: backport fix for ss' output")
Signed-off-by: Matthieu Baerts's avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
parent 1965a05c
No related branches found
No related tags found
1 merge request!7debian: backport proper fix for ss' output
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Sat, 13 Jan 2024 08:51:55 -0800
Subject: Revert "ss: prevent "Process" column from being printed unless
requested"
This reverts commit 1607bf531fd2f984438d227ea97312df80e7cf56.
This commit is being reverted because it breaks output of tcp info.
The order of the columns enum is order sensistive.
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=218372
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
(cherry picked from commit f22c49730c3691c25a1147081363eb35aa9d1048)
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
misc/ss.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/misc/ss.c b/misc/ss.c
index 09dc1f3..9438382 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -100,8 +100,8 @@ enum col_id {
COL_SERV,
COL_RADDR,
COL_RSERV,
- COL_PROC,
COL_EXT,
+ COL_PROC,
COL_MAX
};
@@ -5795,9 +5795,6 @@ int main(int argc, char *argv[])
if (ssfilter_parse(&current_filter.f, argc, argv, filter_fp))
usage();
- if (!show_processes)
- columns[COL_PROC].disabled = 1;
-
if (!(current_filter.dbs & (current_filter.dbs - 1)))
columns[COL_NETID].disabled = 1;
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Date: Sat, 13 Jan 2024 18:10:21 +0100
Subject: 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>
(cherry picked from commit 87d804ca0854b09c07872e9fd6036bf5d3e0cc85)
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
misc/ss.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/misc/ss.c b/misc/ss.c
index 09dc1f3..4ba8c3d 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -2422,6 +2422,8 @@ static void proc_ctx_print(struct sockstat *s)
free(buf);
}
}
+
+ field_next();
}
static void inet_stats_print(struct sockstat *s, bool v6only)
0001-Add-moo-feature.patch
0002-Revert-ss-prevent-Process-column-from-being-printed-.patch
0002-ss-show-extra-info-when-processes-is-not-used.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment