aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohammed Hawari <mohammed@hawari.fr>2023-10-30 10:52:19 +0100
committerFlorin Coras <florin.coras@gmail.com>2023-10-30 15:48:34 +0000
commitf4e3ee1dd1b6edaca193a5a51057cf19c653aeb2 (patch)
tree70fdcabb1021d00011b7adbb3197eaecb1f80be7
parent0e2f188f7c9872d7c946c14d785c6dc7c7c68847 (diff)
vcl: propagate correctly EADDRINUSE for UDP bind
Change-Id: Ia8b5421cbaaf861ddb3ad7aeca53a077ff18864e Signed-off-by: Mohammed Hawari <mohammed@hawari.fr> Type: fix
-rw-r--r--src/vcl/vppcom.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index e929fa1b6e3..d9c3b30afea 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -545,6 +545,7 @@ vcl_session_bound_handler (vcl_worker_t * wrk, session_bound_msg_t * mp)
{
session->session_state = VCL_STATE_DETACHED;
session->vpp_handle = mp->handle;
+ session->vpp_error = mp->retval;
return sid;
}
else
@@ -1161,7 +1162,10 @@ vppcom_wait_for_session_state_change (u32 session_index,
}
if (session->session_state == VCL_STATE_DETACHED)
{
- return VPPCOM_ECONNREFUSED;
+ if (session->vpp_error == SESSION_E_ALREADY_LISTENING)
+ return VPPCOM_EADDRINUSE;
+ else
+ return VPPCOM_ECONNREFUSED;
}
if (svm_msg_q_sub (wrk->app_event_queue, &msg, SVM_Q_NOWAIT, 0))
@@ -1678,7 +1682,7 @@ vppcom_session_bind (uint32_t session_handle, vppcom_endpt_t * ep)
vcl_evt (VCL_EVT_BIND, session);
if (session->session_type == VPPCOM_PROTO_UDP)
- vppcom_session_listen (session_handle, 10);
+ return vppcom_session_listen (session_handle, 10);
return VPPCOM_OK;
}