netlink: fix missing headers in text output
Subsystems (2)
Jakub Kicinski
maintainerPATCH 1/1 netlink: fix missing headers in text output
The commit under fixes added a NULL-check which prevents us from printing text headers. Conversions to add JSON support often use:
print_string(PRINT_FP, NULL, "some text:\n", NULL);
to print in plain text mode.
Correct output:
Channel parameters for vpn0:
Pre-set maximums:
RX: n/a
TX: n/a
Other: n/a
Combined: 1
Current hardware settings:
RX: n/a
TX: n/a
Other: n/a
Combined: 0
With the buggy patch:
Channel parameters for vpn0:
RX: n/a
TX: n/a
Other: n/a
Combined: 1
RX: n/a
TX: n/a
Other: n/a
Combined: 0
--- json_print.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
json_print.c +2 -1
@@ -143,10 +143,11 @@ void print_string(enum output_type type, }else if (_IS_FP_CONTEXT (type)) {if (value)fprintf (stdout, fmt, value); +else +fprintf (stdout, fmt); } } -/* * value's type is bool. When using this function in FP context you can't pass * a value to it, you will need to use "is_json_context()" to have different
Signature · 1 line
2.50.1
Jakub Kicinski
maintainerQuoted 2 lines · On Sat, 12 Jul 2025 07:51:05 -0700 Jakub Kicinski wrote:
The commit under fixes added a NULL-check which prevents us from printing text headers. Conversions to add JSON support often use:
Hi Michal!
Would you be able to apply this ASAP and cut a release? AFAICT this bug has made its way to Fedora, at least. And some scripts try to match on the section text..
Dne Tue, Jul 15, 2025 at 06:40:10AM GMT, Jakub Kicinski napsal:
Quoted 8 lines · On Sat, 12 Jul 2025 07:51:05 -0700 Jakub Kicinski wrote:
Quoted 2 lines
The commit under fixes added a NULL-check which prevents us from printing text headers. Conversions to add JSON support often use:
Hi Michal!
Would you be able to apply this ASAP and cut a release? AFAICT this bug has made its way to Fedora, at least. And some scripts try to match on the section text..
I'll see if I can do it in the evening. The problem is that I'm on family vacation (until Saturday) with very poor connectivity. At least SSH seems to be the only thing that works reasonably well...
Michal
This patch was applied to ethtool/ethtool.git (master) by Michal Kubecek <[email protected]>:
Hello:
This patch was applied to ethtool/ethtool.git (master) by Michal Kubecek <[email protected]>:
Quoted 8 lines · On Sat, 12 Jul 2025 07:51:05 -0700 you wrote:
The commit under fixes added a NULL-check which prevents us from printing text headers. Conversions to add JSON support often use:
print_string(PRINT_FP, NULL, "some text:\n", NULL);to print in plain text mode.
[...]
Here is the summary with links:
- [ethtool] netlink: fix missing headers in text output
https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=b70c92866102
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html