From bc91e86674d446e024a957318d42a3bbd3280bf1 Mon Sep 17 00:00:00 2001 From: Alexander Chernavin Date: Thu, 21 Oct 2021 08:29:11 +0000 Subject: linux-cp: ignore neighbors if ip addr is multicast Type: improvement When dump of neighbors is requested, the replies will also include neighbor entries for IPv6 multicast addresses: GigabitEthernet0/8/0 S ff02::16 33:33:00:00:00:16 GigabitEthernet0/8/0 S ff02::1:ff76:7135 33:33:ff:76:71:35 GigabitEthernet0/8/0 S ff02::2 33:33:00:00:00:02 Such entries are not reported in netlink notification messages and VPP is unlikely to use these. With this change, ignore neighbor entries when the IP address is a multicast address. Signed-off-by: Alexander Chernavin Change-Id: Ic712aa4904f1d559f31fd89ff4541268e2340f84 --- src/plugins/linux-cp/lcp_router.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/plugins/linux-cp/lcp_router.c') diff --git a/src/plugins/linux-cp/lcp_router.c b/src/plugins/linux-cp/lcp_router.c index 6392e2a16f4..7542aa06614 100644 --- a/src/plugins/linux-cp/lcp_router.c +++ b/src/plugins/linux-cp/lcp_router.c @@ -557,6 +557,14 @@ lcp_router_neigh_del (struct rtnl_neigh *rn) lcp_router_mk_addr (rtnl_neigh_get_dst (rn), &nh); + if (ip46_address_is_multicast (&ip_addr_46 (&nh))) + { + LCP_ROUTER_DBG ("ignore neighbor del: %U %U", format_ip_address, &nh, + format_vnet_sw_if_index_name, vnet_get_main (), + sw_if_index); + return; + } + rv = ip_neighbor_del (&nh, sw_if_index); if (rv) @@ -597,6 +605,15 @@ lcp_router_neigh_add (struct rtnl_neigh *rn) int state; lcp_router_mk_addr (rtnl_neigh_get_dst (rn), &nh); + + if (ip46_address_is_multicast (&ip_addr_46 (&nh))) + { + LCP_ROUTER_DBG ("ignore neighbor add: %U %U", format_ip_address, &nh, + format_vnet_sw_if_index_name, vnet_get_main (), + sw_if_index); + return; + } + ll = rtnl_neigh_get_lladdr (rn); state = rtnl_neigh_get_state (rn); -- cgit 1.2.3-korg