]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/rt_netlink.c
Merge pull request #12811 from Avineus/frr_neighlog_5884
[mirror_frr.git] / zebra / rt_netlink.c
index 900c6520d30155121a25775c8ece7049c593547f..e4ddbd95d7767a4ce38872296b69102e519f2b66 100644 (file)
@@ -2006,6 +2006,25 @@ static int netlink_neigh_update(int cmd, int ifindex, void *addr, char *lla,
        if (lla)
                nl_attr_put(&req.n, sizeof(req), NDA_LLADDR, lla, llalen);
 
+       if (IS_ZEBRA_DEBUG_KERNEL) {
+               char ip_str[INET6_ADDRSTRLEN + 8];
+               struct interface *ifp = if_lookup_by_index_per_ns(
+                       zebra_ns_lookup(ns_id), ifindex);
+               if (ifp) {
+                       if (family == AF_INET6)
+                               snprintfrr(ip_str, sizeof(ip_str), "ipv6 %pI6",
+                                          (struct in6_addr *)addr);
+                       else
+                               snprintfrr(ip_str, sizeof(ip_str), "ipv4 %pI4",
+                                          (in_addr_t *)addr);
+                       zlog_debug(
+                               "%s: %s ifname %s ifindex %u addr %s mac %pEA vrf %s(%u)",
+                               __func__, nl_msg_type_to_str(cmd), ifp->name,
+                               ifindex, ip_str, (struct ethaddr *)lla,
+                               vrf_id_to_name(ifp->vrf->vrf_id),
+                               ifp->vrf->vrf_id);
+               }
+       }
        return netlink_talk(netlink_talk_filter, &req.n, &zns->netlink_cmd, zns,
                            false);
 }