Try again to scan if nl_recvmsgs returns NLE_AGAIN and there is no error 69/231569/1
authorCheoleun Moon <chleun.moon@samsung.com>
Wed, 22 Apr 2020 11:48:41 +0000 (20:48 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Wed, 22 Apr 2020 11:48:41 +0000 (20:48 +0900)
Change-Id: I8db32f5847b578c5d93fbcb609361da0c0e6a299
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
packaging/net-config.spec
src/wifi-netlink-scan.c

index bd32cbc..95c8371 100755 (executable)
@@ -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
index 04d6f75..b59e843 100755 (executable)
@@ -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");