]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - ip/ipneigh.c
ipneigh: Print neighbour offload indication
[mirror_iproute2.git] / ip / ipneigh.c
index 2d717d2d2aeb58cc0d4d3830a31258a29447ad22..27986ff7a6c9ba6355446032388303c7ca83fdfa 100644 (file)
@@ -335,10 +335,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);
        }
 
@@ -376,6 +384,9 @@ int print_neigh(struct nlmsghdr *n, void *arg)
        if (r->ndm_flags & NTF_EXT_LEARNED)
                print_null(PRINT_ANY, "extern_learn", " %s ", "extern_learn");
 
+       if (r->ndm_flags & NTF_OFFLOADED)
+               print_null(PRINT_ANY, "offload", " %s", "offload");
+
        if (show_stats) {
                if (tb[NDA_CACHEINFO])
                        print_cacheinfo(RTA_DATA(tb[NDA_CACHEINFO]));