From d63fbd8a9a612d038aa385e79a57198785d409ca Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Tue, 24 Aug 2021 00:52:26 +0200 Subject: [PATCH] Allow NO_SUCH_ENTRY to count as successful 'removal' of neighbors. When an address is removed, VPP will invalidate the neighbor cache. This change allows the subsequent gratutious neigh deletion from Linux to be harmless. --- lcpng_nl_sync.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lcpng_nl_sync.c b/lcpng_nl_sync.c index 5df2241..52b28c7 100644 --- a/lcpng_nl_sync.c +++ b/lcpng_nl_sync.c @@ -272,16 +272,16 @@ lcp_nl_neigh_del (struct rtnl_neigh *rn) lcp_nl_mk_ip_addr (rtnl_neigh_get_dst (rn), &nh); rv = ip_neighbor_del (&nh, lip->lip_phy_sw_if_index); - if (rv) - { - NL_ERROR ("neigh_del: Failed %U iface %U", format_ip_address, &nh, - format_vnet_sw_if_index_name, vnet_get_main (), - lip->lip_phy_sw_if_index); - } - else + if (rv == 0 || rv == VNET_API_ERROR_NO_SUCH_ENTRY) { NL_NOTICE ("neigh_del: Deleted %U iface %U", format_ip_address, &nh, format_vnet_sw_if_index_name, vnet_get_main (), lip->lip_phy_sw_if_index); } + else + { + NL_ERROR ("neigh_del: Failed %U iface %U", format_ip_address, &nh, + format_vnet_sw_if_index_name, vnet_get_main (), + lip->lip_phy_sw_if_index); + } }