tcp: set sw_if_index in tcp src-address cli

the receive dpo added by tcp src-address cli do not have a valid sw_if_index ,
ip4_local_check_src() and tcp_input_lookup_buffer() will set ~0 to vnet_buffer(b)->sw_if_index[VLIB_RX],
which will cause crash in tcp46_reset_inline,

Type: fix
Signed-off-by: Mercury <mercury124185@gmail.com>
Change-Id: Ie01c31f3575e14187c6380ebcfff96fcb6098cde
This commit is contained in:
Mercury
2021-12-24 11:58:27 +08:00
committed by Florin Coras
parent 9ff617c1ac
commit 89618da2f7

View File

@ -433,7 +433,7 @@ tcp_configure_v4_source_address_range (vlib_main_t * vm,
/* Add local adjacencies for the range */
receive_dpo_add_or_lock (DPO_PROTO_IP4, ~0 /* sw_if_index */ ,
receive_dpo_add_or_lock (DPO_PROTO_IP4, sw_if_index /* sw_if_index */,
NULL, &dpo);
prefix.fp_len = 32;
prefix.fp_proto = FIB_PROTOCOL_IP4;
@ -508,7 +508,7 @@ tcp_configure_v6_source_address_range (vlib_main_t * vm,
ip6_neighbor_proxy_add (sw_if_index, start);
/* Add a receive adjacency for this address */
receive_dpo_add_or_lock (DPO_PROTO_IP6, ~0 /* sw_if_index */ ,
receive_dpo_add_or_lock (DPO_PROTO_IP6, sw_if_index /* sw_if_index */,
NULL, &dpo);
fib_table_entry_special_dpo_update (fib_index,