summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-07-29 12:45:27 +0000
committerNeale Ranns <nranns@cisco.com>2019-07-31 10:08:50 +0000
commit5672495dc096f165714c5ce3a321059c35b545f1 (patch)
tree0cf1ec4869c193f35eeedf2992921f3a44a38844 /src/vnet
parentd95a226047437af47e046feb93ceba9204a37940 (diff)
fib: Add some path-list flags to its key
Type: fix Ticket: 1729 The flags that are permanently set on a path-list should form part of its key in the path-list DB. Otherwise, if shared, they will not behave as expected. Change-Id: I0aa7c7c5d270c97b08014e4a47ddbdcee2358706 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit 80d1ef96f92c15f4fd357af9845a0a3c602c2ffe)
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/fib/fib_path_list.c5
-rw-r--r--src/vnet/fib/fib_path_list.h7
2 files changed, 11 insertions, 1 deletions
diff --git a/src/vnet/fib/fib_path_list.c b/src/vnet/fib/fib_path_list.c
index f1d54430d66..5ab22b25064 100644
--- a/src/vnet/fib/fib_path_list.c
+++ b/src/vnet/fib/fib_path_list.c
@@ -180,7 +180,10 @@ fib_path_list_hash (fib_path_list_t *path_list)
ASSERT(path_list);
- new_path_list_hash = old_path_list_hash = vec_len(path_list->fpl_paths);
+ new_path_list_hash =
+ old_path_list_hash =
+ (vec_len(path_list->fpl_paths) << 16 |
+ (path_list->fpl_flags & FIB_PATH_LIST_KEY_FLAGS));
vec_foreach (path_index, path_list->fpl_paths)
{
diff --git a/src/vnet/fib/fib_path_list.h b/src/vnet/fib/fib_path_list.h
index 380eb1a6864..98664eba58b 100644
--- a/src/vnet/fib/fib_path_list.h
+++ b/src/vnet/fib/fib_path_list.h
@@ -104,6 +104,13 @@ typedef enum fib_path_list_flags_t_ {
_item <= FIB_PATH_LIST_ATTRIBUTE_LAST; \
_item++)
+/**
+ * The flags on a path-list that contribute to its key in the DB.
+ * So path-lists with these flags different are not conisdered the
+ * same.
+ */
+#define FIB_PATH_LIST_KEY_FLAGS (FIB_PATH_LIST_FLAG_NO_URPF)
+
extern fib_node_index_t fib_path_list_create(fib_path_list_flags_t flags,
const fib_route_path_t *paths);
extern fib_node_index_t fib_path_list_create_special(dpo_proto_t nh_proto,