diff options
author | Neale Ranns <nranns@cisco.com> | 2017-07-15 07:37:25 -0700 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2017-07-18 20:46:29 +0000 |
commit | 57b5860f013953ce161d05302e05370db9cd6ee2 (patch) | |
tree | 2d4cdbbc631848be4c43c599698019b2121e000b /src/vnet/fib/fib_path_list.c | |
parent | 51822bf07a3f0fe72834ea94659faf6e262475ba (diff) |
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 <nranns@cisco.com>
Diffstat (limited to 'src/vnet/fib/fib_path_list.c')
-rw-r--r-- | src/vnet/fib/fib_path_list.c | 10 |
1 files changed, 10 insertions, 0 deletions
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); + } } /* |