Changing P2P WPS config methods on the fly

Jon Deon jld_eon at yahoo.com
Wed Aug 10 13:24:40 PDT 2016


I'm using wpa_supplicant (as part of Android M) to set up a WiFi P2P network using a persistent group.  Sometimes my device has a display, and sometimes it doesn't.  In the display case, I'd like to show the user a PIN (ie, config_methods = physical_display) and when the display isn't connected I'd like to use PBC (ie, config_methods = virtual_push_button).  This state may change on the fly after the P2P group has been created.

When I detect the display is connected, I set the config_methods on the P2P interface to physical_display, and when I detect that it isn't, I set the config_methods on the P2P interface to virtual_push_button.  (For the purposes of this test, I'm using wpa_cli and doing this manually using "IFNAME=p2p-wlan0-0 set config_methods virtual_push_button" or similar)

However, this seems to not work properly.  Clients (a Win10 laptop and a Samsung Android tablet) that connect to the group after I switch from PIN to PBC still request a PIN.  It seems like they're getting out of date config methods at some stage in the process.  It's also possible that they're caching it somehow, although I've rebooted the devices after the group has switched configuration and it still seems to persist.

I've noticed that in p2p_process_prov_disc_req, the config method suggested by the peer will be accepted as long as it's one of display, keypad, pushbutton, or P2PS.  By this point, though, it seems like the client has already chosen a WPS method it thinks will succeed, and rejecting the authentication attempt just yields errors on the client side.

Is there some other place where the config methods are stored and relayed to clients before provision discovery?  I've captured the broadcast packets and not seen any info in them regarding WPS config, which seemed like another likely place.

Any help is much appreciated :)



More information about the Hostap mailing list