]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - bridge/fdb.c
iplink: Use ll_index_to_name() instead of if_indextoname()
[mirror_iproute2.git] / bridge / fdb.c
index 376713b64e233c5a3cb69dd8adbf05abbc46fe82..4d55fb04b009a23165f4ffdbb8005bbee28f0f99 100644 (file)
@@ -219,10 +219,9 @@ int print_fdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
                unsigned int ifindex = rta_getattr_u32(tb[NDA_IFINDEX]);
 
                if (ifindex) {
-                       char ifname[IF_NAMESIZE];
+                       if (!tb[NDA_LINK_NETNSID]) {
+                               const char *ifname = ll_index_to_name(ifindex);
 
-                       if (!tb[NDA_LINK_NETNSID] &&
-                           if_indextoname(ifindex, ifname)) {
                                if (jw_global)
                                        jsonw_string_field(jw_global, "viaIf",
                                                           ifname);