* [PATCH iproute2] ss: show extra info when '--processes' is not used
@ 2024-01-13 17:10 Matthieu Baerts (NGI0)
2024-01-15 17:07 ` Stephen Hemminger
2024-01-17 17:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-01-13 17:10 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, Quentin Deslandes, Matthieu Baerts (NGI0)
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>
---
Notes:
Note that this issue has quite an annoying impact on our side with
the MPTCP subsystem: because '-p' is not used with 'ss', this commit
broke 2 selftests (13 subtests). Also, 'ss' is used in case of
errors to help better understanding issues, and it is not so useful
if it is missing the most important bits: MPTCP info.
I know that typically there is no bug-fix version with IPRoute2, but
could you please consider one in this case? That would avoid
troubles for those relying on 'ss' for the monitoring or the
reporting when this specific version of IPRoute2 is used.
In our case, it means we have to patch our selftests in 20+ places
to support this "broken" version. Plus making sure this is
backported correctly, resolving conflicts if needed, etc. It would
be really nice if we could avoid that by making a v6.7.1 version
including this fix :)
---
misc/ss.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/misc/ss.c b/misc/ss.c
index 900fefa4..5296cabe 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)
---
base-commit: 05a4fc72587fed4ad5a0a93c59394b3e39f30381
change-id: 20240113-ss-fix-ext-col-disabled-3f489367a5e7
Best regards,
--
Matthieu Baerts (NGI0) <matttbe@kernel.org>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2] ss: show extra info when '--processes' is not used
2024-01-13 17:10 [PATCH iproute2] ss: show extra info when '--processes' is not used Matthieu Baerts (NGI0)
@ 2024-01-15 17:07 ` Stephen Hemminger
2024-01-17 17:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2024-01-15 17:07 UTC (permalink / raw)
To: Matthieu Baerts (NGI0); +Cc: netdev, Quentin Deslandes
On Sat, 13 Jan 2024 18:10:21 +0100
"Matthieu Baerts (NGI0)" <matttbe@kernel.org> wrote:
> 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>
> ---
This needs more review and testing before being merged.
"once burned, twice shy"
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2] ss: show extra info when '--processes' is not used
2024-01-13 17:10 [PATCH iproute2] ss: show extra info when '--processes' is not used Matthieu Baerts (NGI0)
2024-01-15 17:07 ` Stephen Hemminger
@ 2024-01-17 17:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-01-17 17:20 UTC (permalink / raw)
To: Matthieu Baerts; +Cc: stephen, netdev, qde
Hello:
This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:
On Sat, 13 Jan 2024 18:10:21 +0100 you wrote:
> 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.
>
> [...]
Here is the summary with links:
- [iproute2] ss: show extra info when '--processes' is not used
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=87d804ca0854
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-01-17 17:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-13 17:10 [PATCH iproute2] ss: show extra info when '--processes' is not used Matthieu Baerts (NGI0)
2024-01-15 17:07 ` Stephen Hemminger
2024-01-17 17:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox