/* Note: This is temporal. We don't know whether to follow this path or
take the ip address of a loopback interface or even the OIF */
+void
+sr_set_source (ip6_address_t * address)
+{
+ clib_memcpy (&sr_pr_encaps_src, address, sizeof (sr_pr_encaps_src));
+}
+
static clib_error_t *
set_sr_src_command_fn (vlib_main_t * vm, unformat_input_t * input,
vlib_cli_command_t * cmd)
/* Add FIB entry for BSID */
fhc = fib_table_get_flow_hash_config (sr_policy->fib_table,
- dpo_proto_to_fib (DPO_PROTO_IP6));
+ FIB_PROTOCOL_IP6);
dpo_set (&sr_policy->bsid_dpo, DPO_LOAD_BALANCE, DPO_PROTO_IP6,
load_balance_create (0, DPO_PROTO_IP6, fhc));
if (sm->fib_table_ip6 == (u32) ~ 0)
{
sm->fib_table_ip6 = fib_table_create_and_lock (FIB_PROTOCOL_IP6,
+ FIB_SOURCE_SR,
"SRv6 steering of IP6 prefixes through BSIDs");
sm->fib_table_ip4 = fib_table_create_and_lock (FIB_PROTOCOL_IP6,
+ FIB_SOURCE_SR,
"SRv6 steering of IP4 prefixes through BSIDs");
}
/* If FIB empty unlock it */
if (!pool_elts (sm->sr_policies) && !pool_elts (sm->steer_policies))
{
- fib_table_unlock (sm->fib_table_ip6, FIB_PROTOCOL_IP6);
- fib_table_unlock (sm->fib_table_ip4, FIB_PROTOCOL_IP6);
+ fib_table_unlock (sm->fib_table_ip6, FIB_PROTOCOL_IP6, FIB_SOURCE_SR);
+ fib_table_unlock (sm->fib_table_ip4, FIB_PROTOCOL_IP6, FIB_SOURCE_SR);
sm->fib_table_ip6 = (u32) ~ 0;
sm->fib_table_ip4 = (u32) ~ 0;
}