From patchwork Tue Apr 23 07:16:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haller X-Patchwork-Id: 1089103 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=fail (p=none dis=none) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44pF9s4sqVz9sMx for ; Tue, 23 Apr 2019 17:16:33 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726330AbfDWHQc (ORCPT ); Tue, 23 Apr 2019 03:16:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60486 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725888AbfDWHQc (ORCPT ); Tue, 23 Apr 2019 03:16:32 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 201A4330279; Tue, 23 Apr 2019 07:16:32 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-94.ams2.redhat.com [10.36.116.94]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1B5471A90F; Tue, 23 Apr 2019 07:16:30 +0000 (UTC) From: Thomas Haller To: netdev@vger.kernel.org Cc: stephen@networkplumber.org, Thomas Haller Subject: [PATCH 2/4] iprule: avoid trailing space in print_rule() after printing protocol Date: Tue, 23 Apr 2019 09:16:13 +0200 Message-Id: <20190423071615.19729-2-thaller@redhat.com> In-Reply-To: <20190423071615.19729-1-thaller@redhat.com> References: <20190423071615.19729-1-thaller@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 23 Apr 2019 07:16:32 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org It seems print_rule() tries to avoid a trailing space at the end of the line. At least, when printing details about the actions, they no longer append the space. Probably expecting to be the last attribute that will be printed. Don't let the protocol add the trailing space. The space at the end of the line should be printed consistently (or not). Signed-off-by: Thomas Haller --- ip/iprule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ip/iprule.c b/ip/iprule.c index 2479c3ab..ce6b7cd3 100644 --- a/ip/iprule.c +++ b/ip/iprule.c @@ -468,7 +468,7 @@ int print_rule(struct nlmsghdr *n, void *arg) __u8 protocol = rta_getattr_u8(tb[FRA_PROTOCOL]); if ((protocol && protocol != RTPROT_KERNEL) || show_details > 0) { - print_string(PRINT_ANY, "protocol", " proto %s ", + print_string(PRINT_ANY, "protocol", " proto %s", rtnl_rtprot_n2a(protocol, b1, sizeof(b1))); } }