From: Thomas Haller <thaller@redhat.com>
To: netdev@vger.kernel.org
Cc: stephen@networkplumber.org, Thomas Haller <thaller@redhat.com>
Subject: [PATCH 2/4] iprule: avoid trailing space in print_rule() after printing protocol
Date: Tue, 23 Apr 2019 09:16:13 +0200 [thread overview]
Message-ID: <20190423071615.19729-2-thaller@redhat.com> (raw)
In-Reply-To: <20190423071615.19729-1-thaller@redhat.com>
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 <thaller@redhat.com>
---
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
next prev parent reply other threads:[~2019-04-23 7:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-23 7:16 [PATCH 1/4] iprule: avoid printing extra space after gateway for nat action Thomas Haller
2019-04-23 7:16 ` Thomas Haller [this message]
2019-04-23 7:16 ` [PATCH 3/4] iprule: refactor print_rule() to use leading space before printing attribute Thomas Haller
2019-04-23 7:16 ` [PATCH 4/4] iprule: always print realms keyword for rule Thomas Haller
2019-04-24 22:14 ` [PATCH 1/4] iprule: avoid printing extra space after gateway for nat action Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190423071615.19729-2-thaller@redhat.com \
--to=thaller@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).