Blob Blame History Raw
From 32c326673c4c2a5513d52898ebab453ccbb178a2 Mon Sep 17 00:00:00 2001
From: Phil Sutter <psutter@redhat.com>
Date: Thu, 18 Oct 2018 10:52:09 +0200
Subject: [PATCH] bridge: fdb: Fix for missing keywords in non-JSON output

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1636532
Upstream Status: iproute2.git commit 4abb8c723a648

commit 4abb8c723a648ac9edc33741d2064e2507a6bae3
Author: Phil Sutter <phil@nwl.cc>
Date:   Tue Oct 9 14:44:08 2018 +0200

    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")
    Signed-off-by: Phil Sutter <phil@nwl.cc>
    Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 bridge/fdb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bridge/fdb.c b/bridge/fdb.c
index 4dbc894..6487fac 100644
--- a/bridge/fdb.c
+++ b/bridge/fdb.c
@@ -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",
-- 
1.8.3.1