Skip to contentSkip to conversation

bridge: fdb: Fix for missing keywords in non-JSON output

PATCH In review Phil Sutter 2 participants 2 messages Oct 9, 2018 – Oct 16, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bridge: fdb: Fix for missing keywords in non-JSON output

While migrating to JSON print library, some keywords were dropped from standard output by accident. Add them back to unbreak output parsers.

Fixes c7c1a1ef51aea ("bridge: colorize output and use JSON print library")
---
 bridge/fdb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
bridge/fdb.c +3 -3
index 4dbc894ceab93..6487fac579c20 100644
@@ -182,7 +182,7 @@ int print_fdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 		if (!is_json_context())
 			fprintf(fp, "dev ");
 		print_color_string(PRINT_ANY, COLOR_IFNAME,
-				   "ifname", "%s ",
+				   "ifname", "dev %s ",
 				   ll_index_to_name(r->ndm_ifindex));
 	}
 
@@ -199,7 +199,7 @@ int print_fdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 
 		print_color_string(PRINT_ANY,
 				   ifa_family_color(family),
-				    "dst", "%s ", dst);
+				    "dst", "dst %s ", dst);
 	}
 
 	if (vid)
@@ -246,7 +246,7 @@ int print_fdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 
 
 	if (tb[NDA_MASTER])
-		print_string(PRINT_ANY, "master", "%s ",
+		print_string(PRINT_ANY, "master", "master %s ",
 			     ll_index_to_name(rta_getattr_u32(tb[NDA_MASTER])));
 
 	print_string(PRINT_ANY, "state", "%s\n",
Signature · 1 line
2.19.0
#1 lore raw
Quoted 5 lines · On Tue, 9 Oct 2018 14:44:08 +0200 Phil Sutter <[email protected]> wrote:

While migrating to JSON print library, some keywords were dropped from standard output by accident. Add them back to unbreak output parsers.

Fixes c7c1a1ef51aea ("bridge: colorize output and use JSON print library")

Good catch. Applied.