aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYohanPipereau <ypiperea@cisco.com>2019-02-21 11:57:34 +0100
committerHongjun Ni <hongjun.ni@intel.com>2019-02-25 05:43:11 +0000
commit8762a4df2e1037704177b85756ce7d64d3a8cc19 (patch)
treecfd1fdc1f89bedd0a18884f81a80cad91422bc15
parente74f9b38302b1b386cefa3b40e6579dfaf7235a2 (diff)
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 <ypiperea@cisco.com>
-rw-r--r--src/scvpp/src/sc_vpp_comm.c3
1 files changed, 2 insertions, 1 deletions
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);