From: Mercury Date: Fri, 24 Dec 2021 03:58:27 +0000 (+0800) Subject: tcp: set sw_if_index in tcp src-address cli X-Git-Tag: v22.06-rc0~92 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=89618da2f719cc6b566a7e8f428f12917aeaaea5;p=vpp.git 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 Change-Id: Ie01c31f3575e14187c6380ebcfff96fcb6098cde --- diff --git a/src/vnet/tcp/tcp_cli.c b/src/vnet/tcp/tcp_cli.c index c9d6c6facd6..f7d26ff79d0 100644 --- a/src/vnet/tcp/tcp_cli.c +++ b/src/vnet/tcp/tcp_cli.c @@ -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,