From 57b5860f013953ce161d05302e05370db9cd6ee2 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Sat, 15 Jul 2017 07:37:25 -0700 Subject: FIB path preference Paths are given a preference, lowest value is 'best'. Only paths that are up are up contribute to fprwarding - that's unchanged. What's new is that of the path's that re up only those that have the best preference contribute. A poor man's primary and backup. It's not true primary/backup function because the FIB must converge before the lower preference paths are used. Change-Id: Ie4453c4a7b1094c6c2b51fe1594b8302103bb68e Signed-off-by: Neale Ranns --- src/vnet/fib/fib_path_list.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/vnet/fib/fib_path_list.c') diff --git a/src/vnet/fib/fib_path_list.c b/src/vnet/fib/fib_path_list.c index 3e4c3333a08..7a9c328ce83 100644 --- a/src/vnet/fib/fib_path_list.c +++ b/src/vnet/fib/fib_path_list.c @@ -680,6 +680,16 @@ fib_path_list_create (fib_path_list_flags_t flags, fib_path_create(path_list_index, &rpaths[i])); } + /* + * we sort the paths since the key for the path-list is + * the description of the paths it contains. The paths need to + * be sorted else this description will differ. + */ + if (vec_len(path_list->fpl_paths) > 1) + { + vec_sort_with_function(path_list->fpl_paths, + fib_path_cmp_for_sort); + } } /* -- cgit 1.2.3-korg