Blame SOURCES/0015-ip-route-Prevent-some-double-spaces-in-output.patch

4aca6e
From 7913342bac7907f849ee6af7abeba2e30a1c0c46 Mon Sep 17 00:00:00 2001
4aca6e
From: Timothy Redaelli <tredaelli@redhat.com>
4aca6e
Date: Fri, 10 Feb 2017 12:20:19 +0100
4aca6e
Subject: [PATCH] ip-route: Prevent some double spaces in output
4aca6e
4aca6e
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1374446
4aca6e
Upstream Status: iproute2.git commit 7cc7cb8
4aca6e
Conflicts: Context changes due to missing commits
4aca6e
           bc23430, 7faf1588 and 56f5daac
4aca6e
4aca6e
commit 7cc7cb8a888bf50c4e118b6bce4c6926321d0689
4aca6e
Author: Phil Sutter <phil@nwl.cc>
4aca6e
Date:   Tue Aug 23 11:52:45 2016 +0200
4aca6e
4aca6e
    ip-route: Prevent some double spaces in output
4aca6e
4aca6e
    The code is a bit messy, as it starts with space after text and at some
4aca6e
    point switches to space before text. But either way, printing space
4aca6e
    before *and* after text almost certainly leads to printing more
4aca6e
    whitespace than necessary.
4aca6e
4aca6e
    Signed-off-by: Phil Sutter <phil@nwl.cc>
4aca6e
4aca6e
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
4aca6e
---
4aca6e
 ip/iproute.c | 14 +++++++-------
4aca6e
 1 file changed, 7 insertions(+), 7 deletions(-)
4aca6e
4aca6e
diff --git a/ip/iproute.c b/ip/iproute.c
4aca6e
index bb18bbe..8a706ea 100644
4aca6e
--- a/ip/iproute.c
4aca6e
+++ b/ip/iproute.c
4aca6e
@@ -414,24 +414,24 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
4aca6e
 
4aca6e
 	if (!(r->rtm_flags&RTM_F_CLONED)) {
4aca6e
 		if (table != RT_TABLE_MAIN && !filter.tb)
4aca6e
-			fprintf(fp, " table %s ", rtnl_rttable_n2a(table, b1, sizeof(b1)));
4aca6e
+			fprintf(fp, "table %s ", rtnl_rttable_n2a(table, b1, sizeof(b1)));
4aca6e
 		if (r->rtm_protocol != RTPROT_BOOT && filter.protocolmask != -1)
4aca6e
-			fprintf(fp, " proto %s ", rtnl_rtprot_n2a(r->rtm_protocol, b1, sizeof(b1)));
4aca6e
+			fprintf(fp, "proto %s ", rtnl_rtprot_n2a(r->rtm_protocol, b1, sizeof(b1)));
4aca6e
 		if (r->rtm_scope != RT_SCOPE_UNIVERSE && filter.scopemask != -1)
4aca6e
-			fprintf(fp, " scope %s ", rtnl_rtscope_n2a(r->rtm_scope, b1, sizeof(b1)));
4aca6e
+			fprintf(fp, "scope %s ", rtnl_rtscope_n2a(r->rtm_scope, b1, sizeof(b1)));
4aca6e
 	}
4aca6e
 	if (tb[RTA_PREFSRC] && filter.rprefsrc.bitlen != host_len) {
4aca6e
 		/* Do not use format_host(). It is our local addr
4aca6e
 		   and symbolic name will not be useful.
4aca6e
 		 */
4aca6e
-		fprintf(fp, " src %s ",
4aca6e
+		fprintf(fp, "src %s ",
4aca6e
 			rt_addr_n2a(r->rtm_family,
4aca6e
 				    RTA_PAYLOAD(tb[RTA_PREFSRC]),
4aca6e
 				    RTA_DATA(tb[RTA_PREFSRC]),
4aca6e
 				    abuf, sizeof(abuf)));
4aca6e
 	}
4aca6e
 	if (tb[RTA_PRIORITY])
4aca6e
-		fprintf(fp, " metric %u ", rta_getattr_u32(tb[RTA_PRIORITY]));
4aca6e
+		fprintf(fp, "metric %u ", rta_getattr_u32(tb[RTA_PRIORITY]));
4aca6e
 	if (r->rtm_flags & RTNH_F_DEAD)
4aca6e
 		fprintf(fp, "dead ");
4aca6e
 	if (r->rtm_flags & RTNH_F_ONLINK)
4aca6e
@@ -444,9 +444,9 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
4aca6e
 		unsigned int mark = *(unsigned int*)RTA_DATA(tb[RTA_MARK]);
4aca6e
 		if (mark) {
4aca6e
 			if (mark >= 16)
4aca6e
-				fprintf(fp, " mark 0x%x", mark);
4aca6e
+				fprintf(fp, "mark 0x%x", mark);
4aca6e
 			else
4aca6e
-				fprintf(fp, " mark %u", mark);
4aca6e
+				fprintf(fp, "mark %u", mark);
4aca6e
 		}
4aca6e
 	}
4aca6e
 
4aca6e
-- 
4aca6e
1.8.3.1
4aca6e