From: Donatas Abraitis Date: Wed, 1 Mar 2023 07:59:01 +0000 (+0200) Subject: Merge pull request #12811 from Avineus/frr_neighlog_5884 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=933282787cb2436b6aec4b77350cdd47bd80f1ee;hp=-c;p=mirror_frr.git Merge pull request #12811 from Avineus/frr_neighlog_5884 Fix for "Debugs For RFC 5549 Neighbor Creation #5884" --- 933282787cb2436b6aec4b77350cdd47bd80f1ee diff --combined zebra/rt_netlink.c index 900c6520d,201372543..e4ddbd95d --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@@ -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 @@@ -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); }