naccyde / rpms / iproute

Forked from rpms/iproute 8 months ago
Clone

Blame SOURCES/0016-bridge-mdb-fix-missing-new-line-when-show-bridge-mdb.patch

7e752c
From e77e552d5814bf34ec65b8342875990c7f085edc Mon Sep 17 00:00:00 2001
7e752c
From: Phil Sutter <psutter@redhat.com>
7e752c
Date: Wed, 19 Sep 2018 20:00:42 +0200
7e752c
Subject: [PATCH] bridge/mdb: fix missing new line when show bridge mdb
7e752c
7e752c
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1625500
7e752c
Upstream Status: iproute2.git commit 92bba4ed4016a
7e752c
7e752c
commit 92bba4ed4016af3ce7f7071d3c37f2cb34f240f5
7e752c
Author: Hangbin Liu <liuhangbin@gmail.com>
7e752c
Date:   Wed Sep 12 09:39:44 2018 +0800
7e752c
7e752c
    bridge/mdb: fix missing new line when show bridge mdb
7e752c
7e752c
    The bridge mdb show is broken on current iproute2. e.g.
7e752c
    ]# bridge mdb show
7e752c
    34: br0  veth0_br  224.1.1.2  temp 34: br0  veth0_br  224.1.1.1  temp
7e752c
7e752c
    After fix:
7e752c
    ]# bridge mdb show
7e752c
    34: br0  veth0_br  224.1.1.2  temp
7e752c
    34: br0  veth0_br  224.1.1.1  temp
7e752c
7e752c
    v2: Use json print lib as Stephen suggested.
7e752c
    v3: No need to use is_json_context() as print_string() could handle both cases.
7e752c
    v4: use new function print_nl() to print new line in non-json mode.
7e752c
7e752c
    Reported-by: Ying Xu <yinxu@redhat.com>
7e752c
    Fixes: c7c1a1ef51aea ("bridge: colorize output and use JSON print library")
7e752c
    Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
7e752c
    Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
7e752c
---
7e752c
 bridge/mdb.c | 6 ++++++
7e752c
 1 file changed, 6 insertions(+)
7e752c
7e752c
diff --git a/bridge/mdb.c b/bridge/mdb.c
7e752c
index f38dc67..a7b7979 100644
7e752c
--- a/bridge/mdb.c
7e752c
+++ b/bridge/mdb.c
7e752c
@@ -107,6 +107,10 @@ static void br_print_router_ports(FILE *f, struct rtattr *attr,
7e752c
 			fprintf(f, "%s ", port_ifname);
7e752c
 		}
7e752c
 	}
7e752c
+
7e752c
+	if (!show_stats)
7e752c
+		print_nl();
7e752c
+
7e752c
 	close_json_array(PRINT_JSON, NULL);
7e752c
 }
7e752c
 
7e752c
@@ -164,6 +168,8 @@ static void print_mdb_entry(FILE *f, int ifindex, const struct br_mdb_entry *e,
7e752c
 		print_string(PRINT_ANY, "timer", " %s",
7e752c
 			     format_timer(timer));
7e752c
 	}
7e752c
+
7e752c
+	print_nl();
7e752c
 	close_json_object();
7e752c
 }
7e752c
 
7e752c
-- 
7e752c
1.8.3.1
7e752c