diff options
author | Tetsuya Murakami <tetsuya.mrk@gmail.com> | 2021-01-31 16:38:56 -0800 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2021-02-05 11:50:44 +0000 |
commit | 6b354914c2acd58a1e9f8060cdcec28bf1be1bd1 (patch) | |
tree | 237e928761a4d2ee8c9f46fbfdc5fa296a35d691 | |
parent | d28196f007c19a4e6a27fd2fda0b2815913a4b37 (diff) |
sr: Fix the issue that L3VPN SRv6 encapsulated packets could not be forwarded.
Type: fix
Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com>
Change-Id: Ia12feee9e46d4951519d5c6f9d1a21d89701dc0f
Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com>
-rw-r--r-- | src/vnet/srv6/sr.h | 3 | ||||
-rw-r--r-- | src/vnet/srv6/sr_policy_rewrite.c | 17 | ||||
-rw-r--r-- | src/vnet/srv6/sr_steering.c | 2 |
3 files changed, 20 insertions, 2 deletions
diff --git a/src/vnet/srv6/sr.h b/src/vnet/srv6/sr.h index 7452b95b34d..98304b8bafd 100644 --- a/src/vnet/srv6/sr.h +++ b/src/vnet/srv6/sr.h @@ -76,6 +76,8 @@ typedef struct u8 *rewrite; /**< Precomputed rewrite header */ u8 *rewrite_bsid; /**< Precomputed rewrite header for bindingSID */ + u32 egress_fib_table; /**< Egress FIB table for encap packet */ + dpo_id_t bsid_dpo; /**< DPO for Encaps/Insert for BSID */ dpo_id_t ip6_dpo; /**< DPO for Encaps/Insert IPv6 */ dpo_id_t ip4_dpo; /**< DPO for Encaps IPv6 */ @@ -404,7 +406,6 @@ ip6_sr_compute_rewrite_string_insert (ip6_address_t * sl) return rs; } - #endif /* included_vnet_sr_h */ /* diff --git a/src/vnet/srv6/sr_policy_rewrite.c b/src/vnet/srv6/sr_policy_rewrite.c index c7ac44b591d..98fae3bd4a1 100644 --- a/src/vnet/srv6/sr_policy_rewrite.c +++ b/src/vnet/srv6/sr_policy_rewrite.c @@ -359,6 +359,9 @@ create_sl (ip6_sr_policy_t * sr_policy, ip6_address_t * sl, u32 weight, segment_list->segments = vec_dup (sl); + segment_list->egress_fib_table = + ip6_fib_index_from_table_id (sr_policy->fib_table); + if (is_encap) { segment_list->rewrite = compute_rewrite_encaps (sl); @@ -1375,6 +1378,11 @@ sr_policy_rewrite_encaps (vlib_main_t * vm, vlib_node_runtime_t * node, encaps_processing_v6 (node, b2, ip2, ip2_encap); encaps_processing_v6 (node, b3, ip3, ip3_encap); + vnet_buffer (b0)->sw_if_index[VLIB_TX] = sl0->egress_fib_table; + vnet_buffer (b1)->sw_if_index[VLIB_TX] = sl1->egress_fib_table; + vnet_buffer (b2)->sw_if_index[VLIB_TX] = sl2->egress_fib_table; + vnet_buffer (b3)->sw_if_index[VLIB_TX] = sl3->egress_fib_table; + if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE))) { if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED)) @@ -1457,6 +1465,8 @@ sr_policy_rewrite_encaps (vlib_main_t * vm, vlib_node_runtime_t * node, encaps_processing_v6 (node, b0, ip0, ip0_encap); + vnet_buffer (b0)->sw_if_index[VLIB_TX] = sl0->egress_fib_table; + if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE) && PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED)) { @@ -1660,6 +1670,11 @@ sr_policy_rewrite_encaps_v4 (vlib_main_t * vm, vlib_node_runtime_t * node, encaps_processing_v4 (node, b2, ip2, ip2_encap); encaps_processing_v4 (node, b3, ip3, ip3_encap); + vnet_buffer (b0)->sw_if_index[VLIB_TX] = sl0->egress_fib_table; + vnet_buffer (b1)->sw_if_index[VLIB_TX] = sl1->egress_fib_table; + vnet_buffer (b2)->sw_if_index[VLIB_TX] = sl2->egress_fib_table; + vnet_buffer (b3)->sw_if_index[VLIB_TX] = sl3->egress_fib_table; + if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE))) { if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED)) @@ -1743,6 +1758,8 @@ sr_policy_rewrite_encaps_v4 (vlib_main_t * vm, vlib_node_runtime_t * node, encaps_processing_v4 (node, b0, ip0, ip0_encap); + vnet_buffer (b0)->sw_if_index[VLIB_TX] = sl0->egress_fib_table; + if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE) && PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED)) { diff --git a/src/vnet/srv6/sr_steering.c b/src/vnet/srv6/sr_steering.c index 9db13900f97..cb1d81742eb 100644 --- a/src/vnet/srv6/sr_steering.c +++ b/src/vnet/srv6/sr_steering.c @@ -411,7 +411,7 @@ sr_steer_policy_command_fn (vlib_main_t * vm, unformat_input_t * input, if (!traffic_type) return clib_error_return (0, "No L2/L3 traffic specified"); - if (!sr_policy_set) + if (!is_del && !sr_policy_set) return clib_error_return (0, "No SR policy specified"); /* Make sure that the prefixes are clean */ |