aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/unittest/session_test.c8
-rw-r--r--src/vnet/tcp/tcp.c3
2 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/unittest/session_test.c b/src/plugins/unittest/session_test.c
index 87fd708ecd8..6a292c783eb 100644
--- a/src/plugins/unittest/session_test.c
+++ b/src/plugins/unittest/session_test.c
@@ -290,11 +290,11 @@ session_test_endpoint_cfg (vlib_main_t * vm, unformat_input_t * input)
/*
* Create the loopbacks
*/
- intf_addr[0].as_u32 = clib_host_to_net_u32 (0x01010101),
- session_create_lookpback (0, &sw_if_index[0], &intf_addr[0]);
+ intf_addr[0].as_u32 = clib_host_to_net_u32 (0x01010101);
+ session_create_lookpback (0, &sw_if_index[0], &intf_addr[0]);
- intf_addr[1].as_u32 = clib_host_to_net_u32 (0x02020202),
- session_create_lookpback (1, &sw_if_index[1], &intf_addr[1]);
+ intf_addr[1].as_u32 = clib_host_to_net_u32 (0x02020202);
+ session_create_lookpback (1, &sw_if_index[1], &intf_addr[1]);
session_add_del_route_via_lookup_in_table (0, 1, &intf_addr[1], 32,
1 /* is_add */ );
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;