public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2] l2tp: no need to export session offsets in JSON output
@ 2018-04-05 17:24 Guillaume Nault
  2018-04-05 19:44 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Guillaume Nault @ 2018-04-05 17:24 UTC (permalink / raw)
  To: netdev; +Cc: James Chapman, Stephen Hemminger

The offset and peer_offset parameters are only printed to avoid
confusing external scripts that may parse "ip l2tp show session"
output. There's no reason to keep them in JSON.

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
---
 ip/ipl2tp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ip/ipl2tp.c b/ip/ipl2tp.c
index 427e0249..05e96387 100644
--- a/ip/ipl2tp.c
+++ b/ip/ipl2tp.c
@@ -306,8 +306,9 @@ static void print_session(struct l2tp_data *data)
 		print_string(PRINT_FP, NULL, "%s", _SL_);
 	}
 
-	print_uint(PRINT_ANY, "offset", "  offset %u,", 0);
-	print_uint(PRINT_ANY, "peer_offset", " peer offset %u\n", 0);
+	/* Show offsets only for plain console output (for legacy scripts) */
+	print_uint(PRINT_FP, "offset", "  offset %u,", 0);
+	print_uint(PRINT_FP, "peer_offset", " peer offset %u\n", 0);
 
 	if (p->cookie_len > 0)
 		print_cookie("cookie", "cookie",
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH iproute2] l2tp: no need to export session offsets in JSON output
  2018-04-05 17:24 [PATCH iproute2] l2tp: no need to export session offsets in JSON output Guillaume Nault
@ 2018-04-05 19:44 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2018-04-05 19:44 UTC (permalink / raw)
  To: Guillaume Nault; +Cc: netdev, James Chapman

On Thu, 5 Apr 2018 19:24:17 +0200
Guillaume Nault <g.nault@alphalink.fr> wrote:

> The offset and peer_offset parameters are only printed to avoid
> confusing external scripts that may parse "ip l2tp show session"
> output. There's no reason to keep them in JSON.
> 
> Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
> ---

Applied thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-05 19:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-05 17:24 [PATCH iproute2] l2tp: no need to export session offsets in JSON output Guillaume Nault
2018-04-05 19:44 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox