]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #12811 from Avineus/frr_neighlog_5884
authorDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 1 Mar 2023 07:59:01 +0000 (09:59 +0200)
committerGitHub <noreply@github.com>
Wed, 1 Mar 2023 07:59:01 +0000 (09:59 +0200)
Fix for "Debugs For RFC 5549 Neighbor Creation #5884"

1  2 
zebra/rt_netlink.c

diff --combined zebra/rt_netlink.c
index 900c6520d30155121a25775c8ece7049c593547f,201372543691b36a068234edf31982dd3f002c2c..e4ddbd95d7767a4ce38872296b69102e519f2b66
@@@ -1,6 -1,21 +1,6 @@@
 +// SPDX-License-Identifier: GPL-2.0-or-later
  /* Kernel routing table updates using netlink over GNU/Linux system.
   * Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
 - *
 - * This file is part of GNU Zebra.
 - *
 - * GNU Zebra is free software; you can redistribute it and/or modify it
 - * under the terms of the GNU General Public License as published by the
 - * Free Software Foundation; either version 2, or (at your option) any
 - * later version.
 - *
 - * GNU Zebra is distributed in the hope that it will be useful, but
 - * WITHOUT ANY WARRANTY; without even the implied warranty of
 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 - * General Public License for more details.
 - *
 - * You should have received a copy of the GNU General Public License along
 - * with this program; see the file COPYING; if not, write to the Free Software
 - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
  #include <zebra.h>
@@@ -2006,6 -2021,25 +2006,25 @@@ static int netlink_neigh_update(int cmd
        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);
  }