aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-09-09 12:04:17 -0700
committerDamjan Marion <dmarion@me.com>2021-09-13 13:39:18 +0000
commit596c45b22211c9af243b624dc037f58c0aa1c302 (patch)
tree544b30c173bfe2297e41cc6f2ad7a545342d039c /src/vnet/session
parentdb79ac0502f3a2ecc20d4fa2e9f9be20bfb8e18c (diff)
tcp session: initialize sw_if_index at connect time
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id0e67a9ce9c5d8bca2cd7a30493f03a02a46dc46
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/transport.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/vnet/session/transport.c b/src/vnet/session/transport.c
index 526f1a2da15..4b263cd29b9 100644
--- a/src/vnet/session/transport.c
+++ b/src/vnet/session/transport.c
@@ -549,14 +549,14 @@ transport_get_interface_ip (u32 sw_if_index, u8 is_ip4, ip46_address_t * addr)
}
static session_error_t
-transport_find_local_ip_for_remote (u32 sw_if_index,
- transport_endpoint_t * rmt,
- ip46_address_t * lcl_addr)
+transport_find_local_ip_for_remote (u32 *sw_if_index,
+ transport_endpoint_t *rmt,
+ ip46_address_t *lcl_addr)
{
fib_node_index_t fei;
fib_prefix_t prefix;
- if (sw_if_index == ENDPOINT_INVALID_INDEX)
+ if (*sw_if_index == ENDPOINT_INVALID_INDEX)
{
/* Find a FIB path to the destination */
clib_memcpy_fast (&prefix.fp_addr, &rmt->ip, sizeof (rmt->ip));
@@ -570,13 +570,13 @@ transport_find_local_ip_for_remote (u32 sw_if_index,
if (fei == FIB_NODE_INDEX_INVALID)
return SESSION_E_NOROUTE;
- sw_if_index = fib_entry_get_resolving_interface (fei);
- if (sw_if_index == ENDPOINT_INVALID_INDEX)
+ *sw_if_index = fib_entry_get_resolving_interface (fei);
+ if (*sw_if_index == ENDPOINT_INVALID_INDEX)
return SESSION_E_NOINTF;
}
clib_memset (lcl_addr, 0, sizeof (*lcl_addr));
- return transport_get_interface_ip (sw_if_index, rmt->is_ip4, lcl_addr);
+ return transport_get_interface_ip (*sw_if_index, rmt->is_ip4, lcl_addr);
}
int
@@ -593,7 +593,7 @@ transport_alloc_local_endpoint (u8 proto, transport_endpoint_cfg_t * rmt_cfg,
*/
if (ip_is_zero (&rmt_cfg->peer.ip, rmt_cfg->peer.is_ip4))
{
- error = transport_find_local_ip_for_remote (rmt_cfg->peer.sw_if_index,
+ error = transport_find_local_ip_for_remote (&rmt_cfg->peer.sw_if_index,
rmt, lcl_addr);
if (error)
return error;