From c97dacbf35abfa49bb7f95fa766b6b1adc218eae Mon Sep 17 00:00:00 2001 From: Cheoleun Moon Date: Wed, 22 Apr 2020 20:48:41 +0900 Subject: [PATCH] Try again to scan if nl_recvmsgs returns NLE_AGAIN and there is no error Change-Id: I8db32f5847b578c5d93fbcb609361da0c0e6a299 Signed-off-by: Cheoleun Moon --- packaging/net-config.spec | 2 +- src/wifi-netlink-scan.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packaging/net-config.spec b/packaging/net-config.spec index bd32cbc..95c8371 100755 --- a/packaging/net-config.spec +++ b/packaging/net-config.spec @@ -1,6 +1,6 @@ Name: net-config Summary: TIZEN Network Configuration service -Version: 1.1.151 +Version: 1.1.153 Release: 3 Group: System/Network License: Apache-2.0 diff --git a/src/wifi-netlink-scan.c b/src/wifi-netlink-scan.c index 04d6f75..b59e843 100755 --- a/src/wifi-netlink-scan.c +++ b/src/wifi-netlink-scan.c @@ -723,8 +723,12 @@ static int __netconfig_request_netlink_scan(struct nl_sock *socket, if (ret == -NLE_AGAIN && err >= 0) continue; #endif - if (ret < 0 || err < 0) { + if (ret < 0) { DBG("scan failed"); + goto out; + } + if (err < 0) { + DBG("scan failed err: %d", err); ret = -1; goto out; } @@ -835,6 +839,10 @@ int handle_netlink_scan(Wifi *wifi, GDBusMethodInvocation *context, GVariant *pa /** Request NL80211_CMD_TRIGGER_SCAN to the kernel. */ ret = __netconfig_request_netlink_scan(global.socket, global.if_index, global.id, params); + if (ret == -NLE_AGAIN) { + DBG("Try Again"); + ret = __netconfig_request_netlink_scan(global.socket, global.if_index, global.id, params); + } if (ret < 0) { DBG("__netconfig_request_netlink_scan() failed, error %d", ret); netconfig_error_dbus_method_return(context, NETCONFIG_ERROR_INTERNAL, "AccessDenied"); -- 2.34.1