From: Niraj Kumar Goit Date: Sat, 17 Mar 2018 10:25:03 +0000 (+0530) Subject: Modify the netlink scan results. X-Git-Tag: accepted/tizen/unified/20180322.145028^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F18%2F172918%2F1;p=platform%2Fcore%2Fconnectivity%2Fnet-config.git Modify the netlink scan results. Remove the duplicate SSIDs (same security type) and the EAP security type in netlink scan results. Change-Id: Ib6d359b652c144480f7abc4d812f8a3658425e85 Signed-off-by: Niraj Kumar Goit --- diff --git a/src/wifi-netlink-scan.c b/src/wifi-netlink-scan.c index 5d935c2..4f9c61d 100755 --- a/src/wifi-netlink-scan.c +++ b/src/wifi-netlink-scan.c @@ -488,6 +488,16 @@ static int __netconfig_netlink_scan_cb(struct nl_msg *msg, void *user_data) __netconfig_get_security(nla_data(bss[NL80211_BSS_INFORMATION_ELEMENTS]), nla_len(bss[NL80211_BSS_INFORMATION_ELEMENTS]), &sec_type, &enc_type); + if (sec_type == WIFI_SECURITY_TYPE_EAP) + return NL_SKIP; + for (GSList *list = bss_info_list; list != NULL; list = list->next) { + struct bss_scan_info_t *bss_info = (struct bss_scan_info_t *)list->data; + if ((g_strcmp0(bss_info->ssid, ssid) == 0) && (bss_info->security_type == sec_type) + && (bss_info->encryption_type == enc_type)) { + return NL_SKIP; + } + } + /** Create AP info list. */ if (ssid[0] != '\0') { struct bss_scan_info_t *bss_info;