From 5ff5b607376483b7b69d49869c5c4641255e4fd0 Mon Sep 17 00:00:00 2001 From: Niraj Kumar Goit Date: Tue, 30 Jan 2018 16:28:07 +0530 Subject: [PATCH] Do not add redundant vsie to system. Added check in CAPI "wifi_manager_add_vsie" so that redundant vsie is not appended in the system. Change-Id: I29cc5b50aaa68c8f35da9562a5195e0c23ec09d3 Signed-off-by: Niraj Kumar Goit --- src/wifi_manager.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/wifi_manager.c b/src/wifi_manager.c index f27f60d..75f7bdb 100755 --- a/src/wifi_manager.c +++ b/src/wifi_manager.c @@ -1345,6 +1345,8 @@ EXPORT_API int wifi_manager_add_vsie(wifi_manager_h wifi, wifi_manager_vsie_frames_e frame_id, const char *vsie_str) { __NETWORK_CAPI_FUNC_ENTER__; + char *vsie = NULL; + int rv; CHECK_FEATURE_SUPPORTED(WIFI_FEATURE); @@ -1354,6 +1356,14 @@ EXPORT_API int wifi_manager_add_vsie(wifi_manager_h wifi, return WIFI_MANAGER_ERROR_INVALID_PARAMETER; } + rv = _wifi_get_vsie(wifi, frame_id, &vsie); + if (rv == WIFI_MANAGER_ERROR_NONE) { + if (strstr(vsie, vsie_str)) { + g_free(vsie); + return rv; + } + } + __NETWORK_CAPI_FUNC_EXIT__; return _wifi_add_vsie(wifi, frame_id, vsie_str); } -- 2.7.4