]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
ipneigh: print dst for AF_BRIDGE
authorTobias Jungel <tobias.jungel@bisdn.de>
Sat, 5 Jan 2019 12:36:43 +0000 (13:36 +0100)
committerStephen Hemminger <sthemmin@microsoft.com>
Mon, 7 Jan 2019 18:22:03 +0000 (10:22 -0800)
In case a neighbour message is of family AF_BRIDE the NDA_DST attribute
was not printed so far. With this patch the family is evaluated to pass
the correct family to format_host_rta.

Signed-off-by: Tobias Jungel <tobias.jungel@bisdn.de>
ip/ipneigh.c

index 6041c467749c35bc25794a9bdc20a409e8a4af74..070b1acd7c5fec259a71042d0d76dcfe7cae2213 100644 (file)
@@ -318,10 +318,18 @@ int print_neigh(struct nlmsghdr *n, void *arg)
 
        if (tb[NDA_DST]) {
                const char *dst;
+               int family = r->ndm_family;
 
-               dst = format_host_rta(r->ndm_family, tb[NDA_DST]);
+               if (family == AF_BRIDGE) {
+                       if (RTA_PAYLOAD(tb[NDA_DST]) == sizeof(struct in6_addr))
+                               family = AF_INET6;
+                       else
+                               family = AF_INET;
+               }
+
+               dst = format_host_rta(family, tb[NDA_DST]);
                print_color_string(PRINT_ANY,
-                                  ifa_family_color(r->ndm_family),
+                                  ifa_family_color(family),
                                   "dst", "%s ", dst);
        }