aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/fib/fib_types.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-11-06 11:17:54 +0000
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-11-18 13:45:06 +0000
commitaa35702743f147aef85cf70960be253a410e9cb1 (patch)
tree45820587b0a8d20be7df94873ce28919490de638 /src/vnet/fib/fib_types.c
parent9a28d175d429473f87c31e62073596237e6be6fb (diff)
fib: Copy the prefix before use in case the underlying entry reallocs.
Type: fix all other uses of the fib_entry_get_preifx in the code base don't pass the prefix into recursive functions. Change-Id: Ic1c56acd406a733b215ee2fd98b6bed58b490a4f Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit 320dfcf2aa8f4617b51a2bb15f3d0f93ee62d4dc)
Diffstat (limited to 'src/vnet/fib/fib_types.c')
-rw-r--r--src/vnet/fib/fib_types.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vnet/fib/fib_types.c b/src/vnet/fib/fib_types.c
index 7b07fa976a4..3ac5c1d1183 100644
--- a/src/vnet/fib/fib_types.c
+++ b/src/vnet/fib/fib_types.c
@@ -102,6 +102,13 @@ fib_prefix_from_mpls_label (mpls_label_t label,
pfx->fp_eos = eos;
}
+void
+fib_prefix_copy (fib_prefix_t *dst,
+ const fib_prefix_t *src)
+{
+ memcpy(dst, src, sizeof(*dst));
+}
+
int
fib_prefix_cmp (const fib_prefix_t *p1,
const fib_prefix_t *p2)