summaryrefslogtreecommitdiffstats
path: root/src/vnet/fib/ip4_fib.c
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-07-30 08:04:40 -0700
committerNeale Ranns <neale.ranns@cisco.com>2018-07-30 08:04:40 -0700
commitc5d4317ad0425d01893dbb4afad9f16c2cde077d (patch)
tree2bbb6b86a5bf9f051cacc5065a6b6c58be7cbcb6 /src/vnet/fib/ip4_fib.c
parent1f895c9a40f446ca9f1b7803f350c70ebb3ad0fa (diff)
FIB: return entry prefix by const reference to avoid the copy
Change-Id: I09b8406168df4b6b28df3ede24ee839681be0195 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vnet/fib/ip4_fib.c')
-rw-r--r--src/vnet/fib/ip4_fib.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/vnet/fib/ip4_fib.c b/src/vnet/fib/ip4_fib.c
index 01f4a755ec2..d8d983dd9c1 100644
--- a/src/vnet/fib/ip4_fib.c
+++ b/src/vnet/fib/ip4_fib.c
@@ -391,9 +391,7 @@ ip4_fib_table_fwding_dpo_remove (ip4_fib_t *fib,
const dpo_id_t *dpo,
u32 cover_index)
{
- fib_prefix_t cover_prefix = {
- .fp_len = 0,
- };
+ const fib_prefix_t *cover_prefix;
const dpo_id_t *cover_dpo;
/*
@@ -401,12 +399,12 @@ ip4_fib_table_fwding_dpo_remove (ip4_fib_t *fib,
* covering prefix, so it can fill the plys with the correct replacement
* for the entry being removed
*/
- fib_entry_get_prefix(cover_index, &cover_prefix);
+ cover_prefix = fib_entry_get_prefix(cover_index);
cover_dpo = fib_entry_contribute_ip_forwarding(cover_index);
ip4_fib_mtrie_route_del(&fib->mtrie,
addr, len, dpo->dpoi_index,
- cover_prefix.fp_len,
+ cover_prefix->fp_len,
cover_dpo->dpoi_index);
}