aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/fib
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/fib')
-rw-r--r--src/vnet/fib/fib_path.c3
-rw-r--r--src/vnet/fib/fib_table.c15
-rw-r--r--src/vnet/fib/fib_table.h14
-rw-r--r--src/vnet/fib/fib_test.c16
-rw-r--r--src/vnet/fib/ip4_fib.c3
-rw-r--r--src/vnet/fib/ip6_fib.c6
6 files changed, 20 insertions, 37 deletions
diff --git a/src/vnet/fib/fib_path.c b/src/vnet/fib/fib_path.c
index 3ed309f328b..e7338a8c56c 100644
--- a/src/vnet/fib/fib_path.c
+++ b/src/vnet/fib/fib_path.c
@@ -1557,8 +1557,7 @@ fib_path_resolve (fib_node_index_t path_index)
fei = fib_table_entry_special_add(path->recursive.fp_tbl_id,
&pfx,
FIB_SOURCE_RR,
- FIB_ENTRY_FLAG_NONE,
- ADJ_INDEX_INVALID);
+ FIB_ENTRY_FLAG_NONE);
path = fib_path_get(path_index);
path->fp_via_fib = fei;
diff --git a/src/vnet/fib/fib_table.c b/src/vnet/fib/fib_table.c
index 7818d02e05d..58f225f5b4b 100644
--- a/src/vnet/fib/fib_table.c
+++ b/src/vnet/fib/fib_table.c
@@ -369,23 +369,12 @@ fib_node_index_t
fib_table_entry_special_add (u32 fib_index,
const fib_prefix_t *prefix,
fib_source_t source,
- fib_entry_flag_t flags,
- adj_index_t adj_index)
+ fib_entry_flag_t flags)
{
fib_node_index_t fib_entry_index;
dpo_id_t tmp_dpo = DPO_INVALID;
- if (ADJ_INDEX_INVALID != adj_index)
- {
- dpo_set(&tmp_dpo,
- DPO_ADJACENCY,
- FIB_PROTOCOL_MAX,
- adj_index);
- }
- else
- {
- dpo_copy(&tmp_dpo, drop_dpo_get(fib_proto_to_dpo(prefix->fp_proto)));
- }
+ dpo_copy(&tmp_dpo, drop_dpo_get(fib_proto_to_dpo(prefix->fp_proto)));
fib_entry_index = fib_table_entry_special_dpo_add(fib_index, prefix, source,
flags, &tmp_dpo);
diff --git a/src/vnet/fib/fib_table.h b/src/vnet/fib/fib_table.h
index e7e66acb773..994bc4eec1e 100644
--- a/src/vnet/fib/fib_table.h
+++ b/src/vnet/fib/fib_table.h
@@ -138,14 +138,16 @@ extern fib_node_index_t fib_table_get_less_specific(u32 fib_index,
/**
* @brief
- * Add a 'special' entry to the FIB that links to the adj passed
+ * Add a 'special' entry to the FIB.
* A special entry is an entry that the FIB is not expect to resolve
* via the usual mechanisms (i.e. recurisve or neighbour adj DB lookup).
- * Instead the client/source provides the adj to link to.
+ * Instead the will link to a DPO valid for the source and/or the flags.
* This add is reference counting per-source. So n 'removes' are required
* for n 'adds', if the entry is no longer required.
+ * If the source needs to provide non-default forwarding use:
+ * fib_table_entry_special_dpo_add()
*
- * @param fib_index
+ * @param fib_index
* The index of the FIB
*
* @param prefix
@@ -157,17 +159,13 @@ extern fib_node_index_t fib_table_get_less_specific(u32 fib_index,
* @param flags
* Flags for the entry.
*
- * @param adj_index
- * The adjacency to link to.
- *
* @return
* the index of the fib_entry_t that is created (or exists already).
*/
extern fib_node_index_t fib_table_entry_special_add(u32 fib_index,
const fib_prefix_t *prefix,
fib_source_t source,
- fib_entry_flag_t flags,
- adj_index_t adj_index);
+ fib_entry_flag_t flags);
/**
* @brief
diff --git a/src/vnet/fib/fib_test.c b/src/vnet/fib/fib_test.c
index 1a9cce241d5..eb6fe1617e7 100644
--- a/src/vnet/fib/fib_test.c
+++ b/src/vnet/fib/fib_test.c
@@ -1246,8 +1246,8 @@ fib_test_v4 (void)
fib_entry_pool_size());
/*
- * An EXCLUSIVE route; one where the user (me) provides the exclusive
- * adjacency through which the route will resovle
+ * An special route; one where the user (me) provides the
+ * adjacency through which the route will resovle by setting the flags
*/
fib_prefix_t ex_pfx = {
.fp_len = 32,
@@ -1261,11 +1261,12 @@ fib_test_v4 (void)
fib_table_entry_special_add(fib_index,
&ex_pfx,
FIB_SOURCE_SPECIAL,
- FIB_ENTRY_FLAG_EXCLUSIVE,
- locked_ai);
+ FIB_ENTRY_FLAG_LOCAL);
fei = fib_table_lookup_exact_match(fib_index, &ex_pfx);
- FIB_TEST((ai == fib_entry_get_adj(fei)),
- "Exclusive route links to user adj");
+ dpo = fib_entry_contribute_ip_forwarding(fei);
+ dpo = load_balance_get_bucket(dpo->dpoi_index, 0);
+ FIB_TEST((DPO_RECEIVE == dpo->dpoi_type),
+ "local interface adj is local");
fib_table_entry_special_remove(fib_index,
&ex_pfx,
@@ -3543,8 +3544,7 @@ fib_test_v4 (void)
fei = fib_table_entry_special_add(fib_index,
&pfx_4_1_1_1_s_32,
FIB_SOURCE_URPF_EXEMPT,
- FIB_ENTRY_FLAG_DROP,
- ADJ_INDEX_INVALID);
+ FIB_ENTRY_FLAG_DROP);
dpo = fib_entry_contribute_ip_forwarding(fei);
FIB_TEST(load_balance_is_drop(dpo),
"uRPF exempt 4.1.1.1/32 DROP");
diff --git a/src/vnet/fib/ip4_fib.c b/src/vnet/fib/ip4_fib.c
index e8211c80d20..d0106541615 100644
--- a/src/vnet/fib/ip4_fib.c
+++ b/src/vnet/fib/ip4_fib.c
@@ -143,8 +143,7 @@ ip4_create_fib_with_table_id (u32 table_id)
fib_table_entry_special_add(fib_table->ft_index,
&prefix,
ip4_specials[ii].ift_source,
- ip4_specials[ii].ift_flag,
- ADJ_INDEX_INVALID);
+ ip4_specials[ii].ift_flag);
}
return (fib_table->ft_index);
diff --git a/src/vnet/fib/ip6_fib.c b/src/vnet/fib/ip6_fib.c
index 343ff55e80a..55acc694c9c 100644
--- a/src/vnet/fib/ip6_fib.c
+++ b/src/vnet/fib/ip6_fib.c
@@ -35,8 +35,7 @@ vnet_ip6_fib_init (u32 fib_index)
fib_table_entry_special_add(fib_index,
&pfx,
FIB_SOURCE_DEFAULT_ROUTE,
- FIB_ENTRY_FLAG_DROP,
- ADJ_INDEX_INVALID);
+ FIB_ENTRY_FLAG_DROP);
/*
* all link local for us
@@ -47,8 +46,7 @@ vnet_ip6_fib_init (u32 fib_index)
fib_table_entry_special_add(fib_index,
&pfx,
FIB_SOURCE_SPECIAL,
- FIB_ENTRY_FLAG_LOCAL,
- ADJ_INDEX_INVALID);
+ FIB_ENTRY_FLAG_LOCAL);
}
static u32