aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-10-21 16:07:46 -0700
committerDave Barach <openvpp@barachs.net>2020-04-03 22:10:22 +0000
commit00e01d3e875bb18397ff81e0f58f9b468477f473 (patch)
tree277b9ce692a465644de5d3481b42e6cce6394f46 /src/vnet/tcp
parent39aa7a5202a6a875bd6f5d341cb07f19ab0bf51e (diff)
session: improve error reporting
Type: improvement Change-Id: I9dd850a1ce85b0adb5136233f176117e0ee38817 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp')
-rw-r--r--src/vnet/tcp/tcp.c7
-rwxr-xr-xsrc/vnet/tcp/tcp_input.c6
-rw-r--r--src/vnet/tcp/tcp_output.c2
3 files changed, 7 insertions, 8 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index d85225b9172..b1ae37409fd 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -738,10 +738,7 @@ tcp_alloc_custom_local_endpoint (tcp_main_t * tm, ip46_address_t * lcl_addr,
}
port = transport_alloc_local_port (TRANSPORT_PROTO_TCP, lcl_addr);
if (port < 1)
- {
- clib_warning ("Failed to allocate src port");
- return -1;
- }
+ return SESSION_E_NOPORT;
*lcl_port = port;
return 0;
}
@@ -767,7 +764,7 @@ tcp_session_open (transport_endpoint_cfg_t * rmt)
rmt, &lcl_addr, &lcl_port);
if (rv)
- return -1;
+ return rv;
/*
* Create connection and send SYN
diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c
index 713e11fd896..403acad1700 100755
--- a/src/vnet/tcp/tcp_input.c
+++ b/src/vnet/tcp/tcp_input.c
@@ -1985,7 +1985,8 @@ tcp46_syn_sent_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
/* Notify app that we have connection. If session layer can't
* allocate session send reset */
- if (session_stream_connect_notify (&new_tc0->connection, 0))
+ if (session_stream_connect_notify (&new_tc0->connection,
+ SESSION_E_NONE))
{
tcp_send_reset_w_pkt (new_tc0, b0, my_thread_index, is_ip4);
tcp_connection_cleanup (new_tc0);
@@ -2006,7 +2007,8 @@ tcp46_syn_sent_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
new_tc0->state = TCP_STATE_SYN_RCVD;
/* Notify app that we have connection */
- if (session_stream_connect_notify (&new_tc0->connection, 0))
+ if (session_stream_connect_notify (&new_tc0->connection,
+ SESSION_E_NONE))
{
tcp_connection_cleanup (new_tc0);
tcp_send_reset_w_pkt (tc0, b0, my_thread_index, is_ip4);
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index a68d5269abd..095f3602557 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -1472,7 +1472,7 @@ tcp_timer_retransmit_syn_handler (tcp_connection_t * tc)
/* Active open establish timeout */
if (tc->rto >= TCP_ESTABLISH_TIME >> 1)
{
- session_stream_connect_notify (&tc->connection, 1 /* fail */ );
+ session_stream_connect_notify (&tc->connection, SESSION_E_TIMEDOUT);
tcp_connection_cleanup (tc);
return;
}