summaryrefslogtreecommitdiffstats
path: root/src/vnet/srmpls
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/srmpls')
-rwxr-xr-xsrc/vnet/srmpls/sr_mpls_policy.c4
-rwxr-xr-xsrc/vnet/srmpls/sr_mpls_steering.c18
2 files changed, 10 insertions, 12 deletions
diff --git a/src/vnet/srmpls/sr_mpls_policy.c b/src/vnet/srmpls/sr_mpls_policy.c
index 4a563248ce0..7d336c17594 100755
--- a/src/vnet/srmpls/sr_mpls_policy.c
+++ b/src/vnet/srmpls/sr_mpls_policy.c
@@ -661,6 +661,10 @@ sr_mpls_policy_assign_endpoint_color (mpls_label_t bsid,
old_value =
mhash_get ((mhash_t *) endpoint_table, &sr_policy->endpoint);
+ /* CID 180995 This should never be NULL unless the two hash tables
+ * get out of sync */
+ ASSERT (old_value != NULL);
+
fib_prefix_t pfx = { 0 };
pfx.fp_proto = FIB_PROTOCOL_MPLS;
pfx.fp_len = 21;
diff --git a/src/vnet/srmpls/sr_mpls_steering.c b/src/vnet/srmpls/sr_mpls_steering.c
index 8bb072c8812..c5ddab73ce4 100755
--- a/src/vnet/srmpls/sr_mpls_steering.c
+++ b/src/vnet/srmpls/sr_mpls_steering.c
@@ -393,22 +393,16 @@ sr_mpls_steering_policy_add (mpls_label_t bsid, u32 table_id,
memset (&key, 0, sizeof (sr_mpls_steering_key_t));
- /* Compute the steer policy key */
- if (traffic_type == SR_STEER_IPV4 || traffic_type == SR_STEER_IPV6)
- {
- key.prefix.as_u64[0] = prefix->as_u64[0];
- key.prefix.as_u64[1] = prefix->as_u64[1];
- key.mask_width = mask_width;
- key.fib_table = (table_id != (u32) ~ 0 ? table_id : 0);
- }
- else
+ if (traffic_type != SR_STEER_IPV4 && traffic_type != SR_STEER_IPV6)
return -1;
+ /* Compute the steer policy key */
+ key.prefix.as_u64[0] = prefix->as_u64[0];
+ key.prefix.as_u64[1] = prefix->as_u64[1];
+ key.mask_width = mask_width;
+ key.fib_table = (table_id != (u32) ~ 0 ? table_id : 0);
key.traffic_type = traffic_type;
- if (traffic_type != SR_STEER_IPV4 && traffic_type != SR_STEER_IPV6)
- return -1;
-
/*
* Search for steering policy. If already exists we are adding a new
* color.