]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
bridge: fdb: don't colorize the "dev" & "dst" keywords in "bridge -c fdb"
authorGokul Sivakumar <gokulkumar792@gmail.com>
Tue, 17 Aug 2021 17:28:06 +0000 (22:58 +0530)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 18 Aug 2021 21:04:53 +0000 (14:04 -0700)
To be consistent with the colorized output of "ip" command and to increase
readability, stop highlighting the "dev" & "dst" keywords in the colorized
output of "bridge -c fdb" cmd.

Example: in the following "bridge -c fdb" entry, only "00:00:00:00:00:00",
"vxlan100" and "2001:db8:2::1" fields should be highlighted in color.

00:00:00:00:00:00 dev vxlan100 dst 2001:db8:2::1 self permanent

Signed-off-by: Gokul Sivakumar <gokulkumar792@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
bridge/fdb.c

index 37465e460f08eff5b45e588159f8299ea1000b0a..8912f092ca15183e547c5c599498c49aaaf8ae9e 100644 (file)
@@ -192,10 +192,13 @@ int print_fdb(struct nlmsghdr *n, void *arg)
                                   "mac", "%s ", lladdr);
        }
 
-       if (!filter_index && r->ndm_ifindex)
+       if (!filter_index && r->ndm_ifindex) {
+               print_string(PRINT_FP, NULL, "dev ", NULL);
+
                print_color_string(PRINT_ANY, COLOR_IFNAME,
-                                  "ifname", "dev %s ",
+                                  "ifname", "%s ",
                                   ll_index_to_name(r->ndm_ifindex));
+       }
 
        if (tb[NDA_DST]) {
                int family = AF_INET;
@@ -208,9 +211,11 @@ int print_fdb(struct nlmsghdr *n, void *arg)
                                  RTA_PAYLOAD(tb[NDA_DST]),
                                  RTA_DATA(tb[NDA_DST]));
 
+               print_string(PRINT_FP, NULL, "dst ", NULL);
+
                print_color_string(PRINT_ANY,
                                   ifa_family_color(family),
-                                   "dst", "dst %s ", dst);
+                                  "dst", "%s ", dst);
        }
 
        if (vid)