wpa_supplicant: Experimenting with wifi_display

Mike Auty mike.auty at gmail.com
Tue Feb 4 12:05:57 EST 2014


Hi there,

I've recently been trying out the wifi_display support in wpa_supplicant
(I just tested this with wpa_supplicant-2.1).  I realize from the lack
of documentation that this is still under development and not at all
ready for bug posts or similar, but I thought I'd try it and see where I
could get to in its current state.

There appear to be a number of calls that don't sufficiently check the
validity of the variables they're handed, and attempting to use
openwfd_p2pd I end up segfaulting in p2p_set_wfd_dev_info in p2p.c.
Tracing the call back (full bt attached for those that are interested) I
get to wifi_display_update_wfd_ie in wifi_display.c which had global
with p2p as null (global from gdb attached too).

The list of commands openwfd uses are as follows:

GET wifi_display
SET ap_scan 1
SET device_name some-random-name
SET device_type 1-0050F204-1
SET wifi_display 1

That last one triggers the segfault, presumably because no p2p
connection has been setup already?  My knowledge of Wifi Direct is
limited though, so that's about as far as i can get.

Has anyone else gotten wifi_display to work?  If so are they using
custom software or openwfd?  Is openwfd making the right calls to
wpa_supplicant?  If so, could someone help me figure out why p2p isn't
being setup properly, and where it should be setup for this call?

Any help would be greatly appreciated!  5:)

Mike  5:)

-------------- next part --------------
(gdb) bt full
#0  p2p_set_wfd_dev_info (p2p=0x0, elem=0x0) at ../src/p2p/p2p.c:4278
No locals.
#1  0x0000000000445e2d in wifi_display_update_wfd_ie (global=0x7517b0) at wifi_display.c:63
        ie = <optimized out>
        buf = <optimized out>
        len = <optimized out>
        plen = <optimized out>
#2  0x00000000004463c0 in wifi_display_enable (global=<optimized out>, enabled=<optimized out>) at wifi_display.c:190
No locals.
#3  0x00000000004943f8 in wpa_supplicant_ctrl_iface_set (cmd=0x7fffffffcad4 "wifi_display", wpa_s=0x7519d0) at ctrl_iface.c:443
        value = 0x7fffffffcae1 "1"
        ret = 0
#4  wpa_supplicant_ctrl_iface_process (wpa_s=wpa_s at entry=0x7519d0, buf=<optimized out>, buf at entry=0x7fffffffcad0 "SET wifi_display", resp_len=resp_len at entry=0x7fffffffc988) at ctrl_iface.c:5817
        reply = 0x777cf0 "OK\n\366\377\177"
        reply_len = <optimized out>
#5  0x0000000000497762 in wpa_supplicant_ctrl_iface_receive (sock=16, eloop_ctx=0x7519d0, sock_ctx=0x76f6b0) at ctrl_iface_unix.c:194
        wpa_s = <optimized out>
        priv = 0x76f6b0
        buf = "SET wifi_display\000\061\000\060\065\060F204-1\000ame\000\313\377\377\377\177\000\000Q\000\000\000\000\000\000\000P\004w\000\000\000\000\000x\202A", '\000' <repeats 13 times>, "\030\000\000\000\060\000\000\000\240\314\377\377\377\177\000\000\300\313\377\377\377\177\000\000wlan0: \000\001\000\000\000\000\000\000\000P\004w\000\000\000\000\000\357|I\000\000\000\000\000\021\000\000\000\000\000\000\000\260\366v", '\000' <repeats 13 times>, "\360|w\000\000\000\000\000\320\031u\000\000\000\000\000\003\000\000\000\000\000\000\000\371(O\000\000\000\000\000\001\000\000\000\000\000\000\000P\004w\000\000\000\000\000"...
        res = <optimized out>
        from = {sun_family = 1, 
          sun_path = "/tmp/wpa_ctrl_16364-1\000\000\220\377\367\377\177\000\000\060\313\377\377\377\177\000\000\023\325\300\366\377\177\000\000Y\000\000\000\000\000\000\000\n\000\000\000\000\000\000\000\320\031u\000\000\000\000\000%\355\300\366\377\177\000\000\240\202\363\366\377\177\000\000\203\360\300\366\377\177\000\000\240\202\363\366\377\177\000\000\002\000\000\000\000"}
        fromlen = 24
        reply = 0x0
        reply_buf = 0x0
        reply_len = 0
        new_attached = 0
#6  0x00000000004195d4 in eloop_sock_table_dispatch (table=table at entry=0x750548 <eloop+8>, fds=fds at entry=0x753430) at ../src/utils/eloop.c:393
        i = 6
#7  0x0000000000419fc7 in eloop_run () at ../src/utils/eloop.c:862
        timeout = <optimized out>
        rfds = 0x753430
        wfds = 0x7700d0
        efds = 0x770160
        _tv = {tv_sec = 9, tv_usec = 214694}
        res = 1
        tv = <optimized out>
        now = {sec = 23579, usec = 390761}
#8  0x00000000004b3ef1 in wpa_supplicant_run (global=global at entry=0x7517b0) at wpa_supplicant.c:3874
        wpa_s = <optimized out>
#9  0x000000000040f931 in main (argc=<optimized out>, argv=<optimized out>) at main.c:329
        c = <optimized out>
        i = 1
        ifaces = 0x751010
        iface = <optimized out>
        iface_count = <optimized out>
        exitcode = <optimized out>
        params = {daemonize = 0, wait_for_monitor = 0, pid_file = 0x0, wpa_debug_level = 1, wpa_debug_show_keys = 0, wpa_debug_timestamp = 0, ctrl_interface = 0x0, ctrl_interface_group = 0x0, 
          dbus_ctrl_interface = 0, wpa_debug_file_path = 0x0, wpa_debug_syslog = 0, wpa_debug_tracing = 0, override_driver = 0x0, override_ctrl_interface = 0x0, entropy_file = 0x0}
        global = 0x7517b0

-------------- next part --------------
(gdb) inspect *global
$5 = {ifaces = 0x72c970, params = {daemonize = 0, wait_for_monitor = 0, pid_file = 0x0, wpa_debug_level = 1, wpa_debug_show_keys = 0, wpa_debug_timestamp = 0, ctrl_interface = 0x0, dbus_ctrl_interface = 0, 
    wpa_debug_file_path = 0x0, wpa_debug_syslog = 0, wpa_debug_tracing = 0, override_driver = 0x0, override_ctrl_interface = 0x0, entropy_file = 0x0}, ctrl_iface = 0x72c920, dbus = 0x0, drv_priv = 0x72c940, 
  drv_count = 4, suspend_time = {sec = 0, usec = 0}, p2p = 0x0, p2p_init_wpa_s = 0x0, p2p_group_formation = 0x0, p2p_dev_addr = "\000\000\000\000\000", p2p_srv_bonjour = {next = 0x72c850, prev = 0x72c850}, 
  p2p_srv_upnp = {next = 0x72c860, prev = 0x72c860}, p2p_disabled = 0, cross_connection = 0, p2p_disallow_freq = 0x0, num_p2p_disallow_freq = 0, conc_pref = WPA_CONC_PREF_NOT_SET, p2p_cb_on_scan_complete = 0, 
  wifi_display = 1, wfd_subelem = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}



More information about the HostAP mailing list