summaryrefslogtreecommitdiffstats
path: root/src/vnet/fib
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-04-13 00:44:52 -0700
committerNeale Ranns <nranns@cisco.com>2017-04-13 02:44:51 -0700
commita0558307187ef2317f31e3e876a1a5e1faa2541c (patch)
tree8cbc80b4be18c812d976c0fbe4671e2d16f98577 /src/vnet/fib
parent2151191e064e7a1fa37df436c0f771ee46fce3b0 (diff)
Remove unsed parameter from fib_table_entry_special_add() (only used in FIB tests). The DPO was incorrectly initialised with FIB_PROTO_MAX
Change-Id: I962df9e162e4dfb6837a5ce79ea795d5ff2d7315 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/fib')
-rw-r--r--src/vnet/fib/fib_bfd.c3
-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
7 files changed, 21 insertions, 39 deletions
diff --git a/src/vnet/fib/fib_bfd.c b/src/vnet/fib/fib_bfd.c
index e5affb8de49..734ee8cc91c 100644
--- a/src/vnet/fib/fib_bfd.c
+++ b/src/vnet/fib/fib_bfd.c
@@ -109,8 +109,7 @@ fib_bfd_notify (bfd_listen_event_e event,
fei = fib_table_entry_special_add(key->fib_index,
&pfx,
FIB_SOURCE_RR,
- FIB_ENTRY_FLAG_NONE,
- ADJ_INDEX_INVALID);
+ FIB_ENTRY_FLAG_NONE);
fib_entry_lock(fei);
fed = fib_entry_delegate_find_or_add(fib_entry_get(fei),
diff --git a/src/vnet/fib/fib_path.c b/src/vnet/fib/fib_path.c
index cd7d927879a..70c8790579a 100644
--- a/src/vnet/fib/fib_path.c
+++ b/src/vnet/fib/fib_path.c
@@ -1621,8 +1621,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 b31f35e3520..0938ce9bd2f 100644
--- a/src/vnet/fib/fib_table.c
+++ b/src/vnet/fib/fib_table.c
@@ -371,23 +371,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 b310aea611d..f24d28b7711 100644
--- a/src/vnet/fib/fib_table.h
+++ b/src/vnet/fib/fib_table.h
@@ -126,14 +126,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
@@ -145,17 +147,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 e4a8a70e0d0..c58dc5a1f5b 100644
--- a/src/vnet/fib/fib_test.c
+++ b/src/vnet/fib/fib_test.c
@@ -1378,8 +1378,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,
@@ -1393,11 +1393,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,
@@ -3675,8 +3676,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 b03186e82d0..8e92d851b45 100644
--- a/src/vnet/fib/ip4_fib.c
+++ b/src/vnet/fib/ip4_fib.c
@@ -149,8 +149,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 002971400fe..d00f4c558b2 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