summaryrefslogtreecommitdiff
path: root/gsupplicant
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-10-16 05:35:16 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-10-16 10:45:49 (GMT)
commit14fb18645d64c546f914d37bbd2d9a7a9bd27d2a (patch)
tree038f9466273147993d1dc8aaa9c709b30361f403 /gsupplicant
parent583b1a120a8b5b11654c389144d9f7f96c4cfe35 (diff)
downloadconnman-14fb18645d64c546f914d37bbd2d9a7a9bd27d2a.zip
connman-14fb18645d64c546f914d37bbd2d9a7a9bd27d2a.tar.gz
connman-14fb18645d64c546f914d37bbd2d9a7a9bd27d2a.tar.bz2
gsupplicant: Send -ENOLINK error on scan reply if interface was not ready
Diffstat (limited to 'gsupplicant')
-rw-r--r--gsupplicant/supplicant.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 477106b..cd1225e 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -2700,12 +2700,20 @@ static void interface_scan_result(const char *error,
DBusMessageIter *iter, void *user_data)
{
struct interface_scan_data *data = user_data;
+ int err = 0;
if (error != NULL) {
SUPPLICANT_DBG("error %s", error);
+ err = -EIO;
+ }
+
+ /* A non ready interface cannot send/receive anything */
+ if (data->interface->ready == FALSE)
+ err = -ENOLINK;
+ if (err != 0) {
if (data->callback != NULL)
- data->callback(-EIO, data->interface, data->user_data);
+ data->callback(err, data->interface, data->user_data);
} else {
data->interface->scan_callback = data->callback;
data->interface->scan_data = data->user_data;