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