All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2] bridge/mdb: fix missing new line when show bridge mdb
@ 2018-09-05  3:33 Hangbin Liu
  2018-09-06 13:00 ` Stephen Hemminger
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Hangbin Liu @ 2018-09-05  3:33 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, David Ahern, Hangbin Liu

The bridge mdb show is broken on current iproute2. e.g.
]# bridge mdb show
34: br0  veth0_br  224.1.1.2  temp 34: br0  veth0_br  224.1.1.1  temp

After fix:
]# bridge mdb show
34: br0  veth0_br  224.1.1.2  temp
34: br0  veth0_br  224.1.1.1  temp

Reported-by: Ying Xu <yinxu@redhat.com>
Fixes: c7c1a1ef51aea ("bridge: colorize output and use JSON print library")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 bridge/mdb.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/bridge/mdb.c b/bridge/mdb.c
index f38dc67..d89c065 100644
--- a/bridge/mdb.c
+++ b/bridge/mdb.c
@@ -107,6 +107,10 @@ static void br_print_router_ports(FILE *f, struct rtattr *attr,
 			fprintf(f, "%s ", port_ifname);
 		}
 	}
+
+	if (!is_json_context() && !show_stats)
+		fprintf(f, "\n");
+
 	close_json_array(PRINT_JSON, NULL);
 }
 
@@ -164,6 +168,10 @@ static void print_mdb_entry(FILE *f, int ifindex, const struct br_mdb_entry *e,
 		print_string(PRINT_ANY, "timer", " %s",
 			     format_timer(timer));
 	}
+
+	if (!is_json_context())
+		fprintf(f, "\n");
+
 	close_json_object();
 }
 
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-09-12  6:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-05  3:33 [PATCH iproute2] bridge/mdb: fix missing new line when show bridge mdb Hangbin Liu
2018-09-06 13:00 ` Stephen Hemminger
2018-09-07  0:14   ` Hangbin Liu
2018-09-11  1:26 ` [PATCHv2 " Hangbin Liu
2018-09-11 11:01   ` Phil Sutter
2018-09-11 15:30   ` Stephen Hemminger
2018-09-11 14:04 ` [PATCHv3 " Hangbin Liu
2018-09-11 15:31   ` Stephen Hemminger
2018-09-12  1:39 ` [PATCHv4 " Hangbin Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.