aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/bier/bier_disp_lookup_node.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-12-13 09:13:41 -0800
committerNeale Ranns <nranns@cisco.com>2017-12-14 09:25:31 +0000
commitceb4d05ba0fb9771069b0081b928a9e75401fc87 (patch)
treecf05e164bcd06abde9e75a72ff402837a0644a2c /src/vnet/bier/bier_disp_lookup_node.c
parentff6e7699a5e9921d73818970ecf3571080922ecc (diff)
BIER disposition default route
Change-Id: I7196ad8bf6afaf356674789c05e23ac000bc038e Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/bier/bier_disp_lookup_node.c')
-rw-r--r--src/vnet/bier/bier_disp_lookup_node.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/vnet/bier/bier_disp_lookup_node.c b/src/vnet/bier/bier_disp_lookup_node.c
index 15515f467ca..1e1ea99557f 100644
--- a/src/vnet/bier/bier_disp_lookup_node.c
+++ b/src/vnet/bier/bier_disp_lookup_node.c
@@ -63,6 +63,7 @@ bier_disp_lookup_inline (vlib_main_t * vm,
while (n_left_from > 0 && n_left_to_next > 0)
{
const bier_hdr_t *hdr0;
+ bier_hdr_src_id_t src0;
vlib_buffer_t * b0;
u32 bdei0, bdti0;
u32 next0, bi0;
@@ -82,15 +83,22 @@ bier_disp_lookup_inline (vlib_main_t * vm,
/*
* lookup - source is in network order.
*/
- bdei0 = bier_disp_table_lookup(bdti0, bier_hdr_get_src_id(hdr0));
+ src0 = bier_hdr_get_src_id(hdr0);
+ next0 = BIER_DISP_LOOKUP_NEXT_DISPATCH;
+
+ bdei0 = bier_disp_table_lookup(bdti0, src0);
if (PREDICT_FALSE(INDEX_INVALID == bdei0))
{
- next0 = BIER_DISP_LOOKUP_NEXT_DROP;
- }
- else
- {
- next0 = BIER_DISP_LOOKUP_NEXT_DISPATCH;
+ /*
+ * if a specific match misses, try the default
+ */
+ bdei0 = bier_disp_table_lookup(bdti0, 0);
+
+ if (PREDICT_FALSE(INDEX_INVALID == bdei0))
+ {
+ next0 = BIER_DISP_LOOKUP_NEXT_DROP;
+ }
}
vnet_buffer(b0)->ip.adj_index[VLIB_TX] = bdei0;