diff options
author | Adrien Bustany <adrien.bustany@nokia.com> | 2012-04-14 21:06:16 +0300 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2012-04-14 21:06:16 +0300 |
commit | e56fc9e81b99ee110fa083cbdc913823ca6e9890 (patch) | |
tree | 039966d261f91fc3d1e3103241a8934a32feabf4 /wpa_supplicant | |
parent | cca0060f1e67a37b6b490ac8689bb9da7c187dec (diff) | |
download | external_wpa_supplicant_8_ti-e56fc9e81b99ee110fa083cbdc913823ca6e9890.zip external_wpa_supplicant_8_ti-e56fc9e81b99ee110fa083cbdc913823ca6e9890.tar.gz external_wpa_supplicant_8_ti-e56fc9e81b99ee110fa083cbdc913823ca6e9890.tar.bz2 |
P2P: Allow wildcard service discovery from DBus API
Using the socket command interface, it is possible to pass a NULL dst to
wpas_p2p_sd_request, however you could not do so using the D-Bus API,
since it required a valid Peer object path. This patch changes the
behavior, so that if the "peer_object" is missing from the parameters,
a NULL dst is passed to wpas_p2p_sd_request.
Signed-hostap: Adrien Bustany <adrien.bustany@nokia.com>
intended-for: hostap-1
Diffstat (limited to 'wpa_supplicant')
-rw-r--r-- | wpa_supplicant/dbus/dbus_new_handlers_p2p.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c index 8d50bca..edfc734 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c +++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c @@ -2265,7 +2265,7 @@ DBusMessage * wpas_dbus_handler_p2p_service_sd_req( struct wpabuf *tlv = NULL; u8 version = 0; u64 ref = 0; - u8 addr[ETH_ALEN]; + u8 addr_buf[ETH_ALEN], *addr; dbus_message_iter_init(message, &iter); @@ -2302,10 +2302,15 @@ DBusMessage * wpas_dbus_handler_p2p_service_sd_req( wpa_dbus_dict_entry_clear(&entry); } - if (!peer_object_path || - (parse_peer_object_path(peer_object_path, addr) < 0) || - !p2p_peer_known(wpa_s->global->p2p, addr)) - goto error; + if (!peer_object_path) { + addr = NULL; + } else { + if (parse_peer_object_path(peer_object_path, addr_buf) < 0 || + !p2p_peer_known(wpa_s->global->p2p, addr_buf)) + goto error; + + addr = addr_buf; + } if (upnp == 1) { if (version <= 0 || service == NULL) |