aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-10-27 10:53:41 -0700
committerFlorin Coras <florin.coras@gmail.com>2021-10-27 17:55:42 +0000
commite2f3aa16e27857929c1a8fbd921426a51ecb5538 (patch)
tree5ebf6dd1aff666fda87f0aa76078d514b0f7fed9 /src/vnet
parentf62ed3f9c1ec3e8db36f63d6a54f46b7bea43723 (diff)
tcp: fix use of invalid local sw_if_index
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id58ac44d45fb8b8a0d803f02e0242ec6f4b3db05
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/tcp/tcp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index 4825bf62856..d4b1d77f556 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -837,7 +837,8 @@ tcp_session_open (transport_endpoint_cfg_t * rmt)
/* The other connection vars will be initialized after SYN ACK */
tcp_connection_timers_init (tc);
tc->mss = rmt->mss;
- tc->sw_if_index = rmt->peer.sw_if_index;
+ if (rmt->peer.sw_if_index != ENDPOINT_INVALID_INDEX)
+ tc->sw_if_index = rmt->peer.sw_if_index;
tc->next_node_index = rmt->next_node_index;
tc->next_node_opaque = rmt->next_node_opaque;