aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chernavin <achernavin@netgate.com>2021-10-21 08:29:11 +0000
committerMatthew Smith <mgsmith@netgate.com>2022-03-04 15:58:42 +0000
commitbc91e86674d446e024a957318d42a3bbd3280bf1 (patch)
treee38f274b50483096b8beab2a5605fa2de9d4c0d4
parent81e74d8e22365166043de40666f324df0533ccef (diff)
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 <achernavin@netgate.com> Change-Id: Ic712aa4904f1d559f31fd89ff4541268e2340f84
-rw-r--r--src/plugins/linux-cp/lcp_router.c17
1 files changed, 17 insertions, 0 deletions
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);