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;
}
/** 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");