mirror of
https://github.com/albfan/miraclecast.git
synced 2025-02-12 22:21:55 +00:00
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>
This commit is contained in:
parent
dbf3972619
commit
67ad486765
1 changed files with 5 additions and 1 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue