ipneigh: print dst for AF_BRIDGE

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>
This commit is contained in:
Tobias Jungel 2019-01-05 13:36:43 +01:00 committed by Stephen Hemminger
parent f0cabaca38
commit c9159af51a
1 changed files with 10 additions and 2 deletions

View 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);
}