🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by "Matthieu Baerts (NGI0)" Mon, 09 Nov 2026 11:47
[PATCH iproute2-net v2] mptcp: limits: fix JSON support
#13151
Author: "Matthieu Baerts (NGI0)"
Date: Mon, 09 Nov 2026 11:47
61 lines
10246 bytes
print_mptcp_limit() was trying to open a JSON sub-object and closing it,
but no JSON object was actually created before.

Because of that, JSON support was not working with the MPTCP limits:

  $ ip -j -p mptcp limits show
  add_addr_accepted 0 subflows 2

Create a "plain" object before calling print_mptcp_limit: the MPTCP
limits are different from what is usually seen in IP commands. Indeed,
this object doesn't list multiple items with different attributes, but
only a bunch of attributes. With this _plain() helpers, an extra array
is not going to be added: it is not needed and doesn't make sense here.

After this modification, we now have:

  $ ip -j -p mptcp limits show
  {
      "add_addr_accepted": 0,
      "subflows": 2
  }

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Changes in v2:
- Explain why _plain() is used here. (Stephen's LLM review)
- Add missing 'not' in the commit message. (Stephen's LLM review)
- (No code change.)
- Link to v1: https://patch.msgid.link/20261029-mptcp-limits-json-v1-1-7ac73cdab054@kernel.org
---
 ip/ipmptcp.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ip/ipmptcp.c b/ip/ipmptcp.c
index 02cf72ce..54976c08 100644
--- a/ip/ipmptcp.c
+++ b/ip/ipmptcp.c
@@ -446,7 +446,14 @@ static int mptcp_limit_get_set(int argc, char **argv, int cmd)
 
 	ret = 0;
 	if (do_get) {
+		/* This object is different from what is usually seen in IP
+		 * commands: it doesn't list multiple items with different
+		 * attributes, but only a bunch of attributes. Use _plain()
+		 * because an array is not needed and doesn't make sense here.
+		 */
+		new_json_obj_plain(json);
 		ret = print_mptcp_limit(answer, stdout);
+		delete_json_obj_plain();
 		free(answer);
 	}
 

---
base-commit: d95f66508b32fb2c51e70a9127dffd1db8623614
change-id: 20261029-mptcp-limits-json-f60c82b687fa

Best regards,
--  
Matthieu Baerts (NGI0) <matttbe@kernel.org>
Re: [PATCH iproute2-net v2] mptcp: limits: fix JSON support
#14336
Author: patchwork-bot+netdevbpf
Date: Wed, 11 Nov 2026 00:10
25 lines
8558 bytes
Hello:

This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:

On Mon, 09 Nov 2026 12:47:26 +0100 you wrote:
> print_mptcp_limit() was trying to open a JSON sub-object and closing it,
> but no JSON object was actually created before.
> 
> Because of that, JSON support was not working with the MPTCP limits:
> 
>   $ ip -j -p mptcp limits show
>   add_addr_accepted 0 subflows 2
> 
> [...]

Here is the summary with links:
  - [iproute2-net,v2] mptcp: limits: fix JSON support
    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=5525b4722604

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads