From a424dd1b2e345bd8ebc5088fcd42d721a2ac00d7 Mon Sep 17 00:00:00 2001 From: Nathan Skrzypczak Date: Fri, 20 Aug 2021 15:53:43 +0200 Subject: ip: unlock_fib on if delete On interface delete we were not removing the lock taken by a previous ip_table_bind() call thus preventing the VRFs to be removed. Type: fix Change-Id: I11abbb51a09b45cd3390b23d5d601d029c5ea485 Signed-off-by: Nathan Skrzypczak --- src/vnet/ip/ip4_forward.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/vnet/ip/ip4_forward.c') diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c index 58af706e2b2..de8e8e8538f 100644 --- a/src/vnet/ip/ip4_forward.c +++ b/src/vnet/ip/ip4_forward.c @@ -1090,6 +1090,15 @@ ip4_sw_interface_add_del (vnet_main_t * vnm, u32 sw_if_index, u32 is_add) })); /* *INDENT-ON* */ ip4_mfib_interface_enable_disable (sw_if_index, 0); + + if (0 != im4->fib_index_by_sw_if_index[sw_if_index]) + fib_table_bind (FIB_PROTOCOL_IP4, sw_if_index, 0); + if (0 != im4->mfib_index_by_sw_if_index[sw_if_index]) + mfib_table_bind (FIB_PROTOCOL_IP4, sw_if_index, 0); + + /* Erase the lookup tables just in case */ + im4->fib_index_by_sw_if_index[sw_if_index] = ~0; + im4->mfib_index_by_sw_if_index[sw_if_index] = ~0; } vnet_feature_enable_disable ("ip4-unicast", "ip4-not-enabled", sw_if_index, -- cgit 1.2.3-korg