]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
bridge: fix reporting of IPv6 addresses
authorMike Rapoport <mike.rapoport@ravellosystems.com>
Thu, 20 Mar 2014 11:06:10 +0000 (13:06 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 21 Mar 2014 21:23:05 +0000 (14:23 -0700)
Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com>
bridge/fdb.c

index e2e53f1feffbceaa2d4914b83418deee9cde0144..9b720e30fb1efc1c77b3708c91e7c246e2f5cf3e 100644 (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)));