bridge: fix reporting of IPv6 addresses

Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com>
This commit is contained in:
Mike Rapoport 2014-03-20 13:06:10 +02:00 committed by Stephen Hemminger
parent 577e5a53fc
commit 9e763fa5d3
1 changed files with 6 additions and 1 deletions

View File

@ -103,8 +103,13 @@ int print_fdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
if (tb[NDA_DST]) {
SPRINT_BUF(abuf);
int family = AF_INET;
if (RTA_PAYLOAD(tb[NDA_DST]) == sizeof(struct in6_addr))
family = AF_INET6;
fprintf(fp, "dst %s ",
format_host(AF_INET,
format_host(family,
RTA_PAYLOAD(tb[NDA_DST]),
RTA_DATA(tb[NDA_DST]),
abuf, sizeof(abuf)));