+// 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>
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);
}