From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B76B9C282DD for ; Tue, 23 Apr 2019 07:16:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 851472077C for ; Tue, 23 Apr 2019 07:16:33 +0000 (UTC) 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 Content-Transfer-Encoding: 8bit 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))); } } -- 2.20.1