From patchwork Thu Apr 5 17:24:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Nault X-Patchwork-Id: 895469 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=alphalink.fr Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40H8p21DvLz9s0n for ; Fri, 6 Apr 2018 03:24:26 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751451AbeDERYX (ORCPT ); Thu, 5 Apr 2018 13:24:23 -0400 Received: from zimbra.alphalink.fr ([217.15.80.77]:58423 "EHLO zimbra.alphalink.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751259AbeDERYW (ORCPT ); Thu, 5 Apr 2018 13:24:22 -0400 Received: from localhost (localhost [127.0.0.1]) by mail-2-cbv2.admin.alphalink.fr (Postfix) with ESMTP id 583862B5209A; Thu, 5 Apr 2018 19:24:21 +0200 (CEST) Received: from zimbra.alphalink.fr ([127.0.0.1]) by localhost (mail-2-cbv2.admin.alphalink.fr [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id vL1H7ECOvOnN; Thu, 5 Apr 2018 19:24:18 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail-2-cbv2.admin.alphalink.fr (Postfix) with ESMTP id 457572B5209B; Thu, 5 Apr 2018 19:24:18 +0200 (CEST) X-Virus-Scanned: amavisd-new at mail-2-cbv2.admin.alphalink.fr Received: from zimbra.alphalink.fr ([127.0.0.1]) by localhost (mail-2-cbv2.admin.alphalink.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id U5ISBLDNQ3Jc; Thu, 5 Apr 2018 19:24:18 +0200 (CEST) Received: from c-dev-0.admin.alphalink.fr (94-84-15-217.reverse.alphalink.fr [217.15.84.94]) by mail-2-cbv2.admin.alphalink.fr (Postfix) with ESMTP id 1A4F42B5209A; Thu, 5 Apr 2018 19:24:18 +0200 (CEST) Received: by c-dev-0.admin.alphalink.fr (Postfix, from userid 1000) id E661360224; Thu, 5 Apr 2018 19:24:17 +0200 (CEST) Date: Thu, 5 Apr 2018 19:24:17 +0200 From: Guillaume Nault To: netdev@vger.kernel.org Cc: James Chapman , Stephen Hemminger Subject: [PATCH iproute2] l2tp: no need to export session offsets in JSON output Message-ID: <6e2c59a6757414fa22b5927f248749efe34825d5.1522948642.git.g.nault@alphalink.fr> MIME-Version: 1.0 Content-Disposition: inline X-Mutt-Fcc: =Sent User-Agent: Mutt/1.9.4 (2018-02-28) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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",