From 8762a4df2e1037704177b85756ce7d64d3a8cc19 Mon Sep 17 00:00:00 2001 From: YohanPipereau Date: Thu, 21 Feb 2019 11:57:34 +0100 Subject: Set vapi_context to NULL after trying to connect to VPP api and it failed. This prevents a SEGFAULT error triggered every time the connection to VPP fails. Change-Id: I2cab59168fe1479d6cbbcd8cb0645381171c527c Signed-off-by: Yohan Pipereau --- src/scvpp/src/sc_vpp_comm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scvpp/src/sc_vpp_comm.c b/src/scvpp/src/sc_vpp_comm.c index 9059ff7..2ebdb7a 100644 --- a/src/scvpp/src/sc_vpp_comm.c +++ b/src/scvpp/src/sc_vpp_comm.c @@ -31,8 +31,9 @@ int sc_connect_vpp() rv = vapi_connect(g_vapi_ctx_instance, APP_NAME, NULL, MAX_OUTSTANDING_REQUESTS, RESPONSE_QUEUE_SIZE, VAPI_MODE_BLOCKING, true); if (rv != VAPI_OK) { - SC_LOG_ERR("*connect %s faild,with return %d", APP_NAME, rv); + SC_LOG_ERR("*connect %s failed with error code %d", APP_NAME, rv); vapi_ctx_free(g_vapi_ctx_instance); + g_vapi_ctx_instance = NULL; return -1; } SC_LOG_DBG("*connected %s ok", APP_NAME); -- cgit 1.2.3-korg