summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Gusakov <andrey.gusakov@cogentembedded.com>2014-08-11 16:18:11 +0400
committerDavid Herrmann <dh.herrmann@gmail.com>2014-09-03 08:11:13 +0200
commit67ad4867653080d41b567a9be7edce1ef6ec304b (patch)
treedf0306636765d0537dd94c14781a7a9953ec111c
parentdbf3972619e60f967d5729791a1d2ef925477fa2 (diff)
wifi: check device_name and name in supplicant_parse_peer()
P2P-PEER reports the device name as 'device_name' while P2P-DEVICE-FOUND reports it as 'name'. Try both. Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
-rw-r--r--src/wifi/wifid-supplicant.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wifi/wifid-supplicant.c b/src/wifi/wifid-supplicant.c
index b2d9202..568f978 100644
--- a/src/wifi/wifid-supplicant.c
+++ b/src/wifi/wifid-supplicant.c
@@ -811,7 +811,11 @@ static void supplicant_parse_peer(struct supplicant *s,
return;
}
+ /* P2P-PEER reports the device name as 'device_name', P2P-DEVICE-FOUND
+ * uses 'name. Allow either here.. */
r = wpas_message_dict_read(m, "device_name", 's', &name);
+ if (r < 0)
+ r = wpas_message_dict_read(m, "name", 's', &name);
if (r >= 0) {
t = strdup(name);
if (!t) {
@@ -822,7 +826,7 @@ static void supplicant_parse_peer(struct supplicant *s,
peer_supplicant_friendly_name_changed(sp->p);
}
} else {
- log_debug("no device_name in P2P_PEER information: %s",
+ log_debug("no device-name in P2P_PEER information: %s",
wpas_message_get_raw(m));
}