From nobody Mon Mar 2 08:33:51 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF16A2EB856; Mon, 23 Feb 2026 15:31:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771860682; cv=none; b=TQuWYnFNg9aYk7Dv1cXbvg8qbrwPY4yMNpp7GV2DNUjS4KQIuzRbVa0DLsUJfMjZqgSlhnSY7DxVI+J2YITBwh+4dU/KgLj2dFMXTX3CohCvzOLT+TH+2wusBc36dZ8Y4YNJZu851D5nVDHdH0UWYkI/X3lK8s+Hvwfg9OocBYc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771860682; c=relaxed/simple; bh=asIr6HoAWgEgFuiqGCFTBNTg4dHGyiVNQ+Sg3mqF0j4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LM2i6/qSV8BpDexBsk8mdyj8/9iHkMzlsPDUGhvoDIYMH/hddGOIWvoebqNpkCrYCVh4RF+l/4Q4vsfjFYWcIj1DEbCwVstaDEr83+mxAGpfMqVkwvWtFVe1IvqBoZuCIRg/At6klczNTlKHCi6X6v24qlCdZSCWDaXwU5D+32s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NGRmqmhn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NGRmqmhn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E605C19423; Mon, 23 Feb 2026 15:31:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771860682; bh=asIr6HoAWgEgFuiqGCFTBNTg4dHGyiVNQ+Sg3mqF0j4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NGRmqmhnOOdD80BaRp/I4lfutkLHmXko8tJNjSySshSpNIrfUbYviQ4FYVNdumi5C JaC48nMQ+FneQeeozs0gj3EprvwFmIh4tSIwpF2tME7XkXBB6FCVro2Ox62qfTcnYz o7ymu5gVUO6bU8oQ55idBSG32zLbxpCF5bqFqiKgcSGPYzN/8ebE4Aik1VNUof4Yox bcu8c1mz4JvA6gkg+eqhV9z++zlH2OV4xANtWuLlJbIpsL1iEV5zaiuIukupN/RhYf 5TEFjD559d2lnH0rQ+/6yOdRbEGZS/WOR1yBB8xQ94fNHJwVAcweSh3mHxgZJy4L1x C0NzBM96p2K6Q== From: "Matthieu Baerts (NGI0)" Date: Mon, 23 Feb 2026 16:28:38 +0100 Subject: [PATCH iproute2-next v2 1/3] mptcp: uniform stream closure Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260223-ipr-monitor-json-v2-1-f91fccccf917@kernel.org> References: <20260223-ipr-monitor-json-v2-0-f91fccccf917@kernel.org> In-Reply-To: <20260223-ipr-monitor-json-v2-0-f91fccccf917@kernel.org> To: Stephen Hemminger , David Ahern Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1131; i=matttbe@kernel.org; h=from:subject:message-id; bh=asIr6HoAWgEgFuiqGCFTBNTg4dHGyiVNQ+Sg3mqF0j4=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDLnFB3rmHxjvscM2U72CbMvFPMJBy65ZWuS/eynqpX2q +TC5XH2HaUsDGJcDLJiiizSbZH5M59X8ZZ4+VnAzGFlAhnCwMUpABN5W8TwP0Lm96dr95/H7rsV f/ZU7Bzpa58+M5/+/iBPvWT/w/7t7/YxMiy/zKdUVfPyZpMc+0tfIdcDM89JTrlyxacjdWrJrWN TkzgB X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Use print_nl() instead of print_string(), close the json object, then flush the stream to flush the end of the JSON object ASAP. Note that in print_mptcp_limit(), the flush should have been done before closing the JSON object, but because there is only one object and the closure was done just before exiting, there was no visual impact. Signed-off-by: Matthieu Baerts (NGI0) --- ip/ipmptcp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ip/ipmptcp.c b/ip/ipmptcp.c index ec9ef62a..18ec05a8 100644 --- a/ip/ipmptcp.c +++ b/ip/ipmptcp.c @@ -273,8 +273,8 @@ static int print_mptcp_addrinfo(struct rtattr *addrinfo) } } =20 + print_nl(); close_json_object(); - print_string(PRINT_FP, NULL, "\n", NULL); fflush(stdout); =20 return 0; @@ -426,9 +426,11 @@ static int print_mptcp_limit(struct nlmsghdr *n, void = *arg) =20 print_uint(PRINT_ANY, "subflows", "subflows %d ", val); } - print_string(PRINT_FP, NULL, "%s", "\n"); - fflush(stdout); + + print_nl(); close_json_object(); + fflush(stdout); + return 0; } =20 --=20 2.51.0