aboutsummaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2016-11-27 22:33:01 -0800
committerFlorin Coras <fcoras@cisco.com>2016-11-27 22:44:36 -0800
commitfeeebfe0197912a233acab7d3359dc3fc29bc1f9 (patch)
treee217a2c2581cb0edc8169be76a158eaa2681217d /vnet
parentdc5252b17ad929725101d6436e040b8c2bc68aa3 (diff)
Unlock LISP source FIB if only default left
If when removing a source route the LISP source FIB contains only the default, remove the whole source FIB. Defaults are added when FIBs are created so no forwarding entry depends on them. Change-Id: I0dd5dc31d128d834ac3b92c962c4c68577aa7429 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/lisp-gpe/lisp_gpe_fwd_entry.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/vnet/vnet/lisp-gpe/lisp_gpe_fwd_entry.c b/vnet/vnet/lisp-gpe/lisp_gpe_fwd_entry.c
index c7aafc6a9ca..cae2eb91363 100644
--- a/vnet/vnet/lisp-gpe/lisp_gpe_fwd_entry.c
+++ b/vnet/vnet/lisp-gpe/lisp_gpe_fwd_entry.c
@@ -150,12 +150,22 @@ ip_src_dst_fib_del_route (u32 src_fib_index,
fib_table_entry_delete (src_fib_index, &src_fib_prefix, FIB_SOURCE_LISP);
- if (0 == fib_table_get_num_entries (src_fib_index,
+ /* check if only default left */
+ if (1 == fib_table_get_num_entries (src_fib_index,
src_fib_prefix.fp_proto,
FIB_SOURCE_LISP))
{
/*
- * there's nothing left, unlock the source FIB and the
+ * remove src FIB default route
+ */
+ fib_prefix_t prefix = {
+ .fp_proto = dst_fib_prefix.fp_proto,
+ };
+ fib_table_entry_special_remove (src_fib_index, &prefix,
+ FIB_SOURCE_LISP);
+
+ /*
+ * there's nothing left now, unlock the source FIB and the
* destination route
*/
fib_table_entry_special_remove (dst_fib_index,