]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Allow advertisement config methods to be limited
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 8 Sep 2011 13:48:06 +0000 (16:48 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 8 Sep 2011 13:48:06 +0000 (16:48 +0300)
The default config methods was hardcoded to claim support for
PushButton, Display, and Keypad. While these are supported by
most P2P devices, there may be some cases where it is convenient
to be able to disable a specific config method. Use config_methods
configuration parameter to set the default values for Config Methods
in the P2P Device Info attribute.

src/p2p/p2p_build.c

index 5aba1e11d9e82413f117609147959334af41d4f9..a82e16df093814ee1f9b0be0c7d7af94c9a44346 100644 (file)
@@ -174,6 +174,10 @@ void p2p_buf_add_device_info(struct wpabuf *buf, struct p2p_data *p2p,
                else if (peer->wps_method == WPS_PIN_DISPLAY ||
                         peer->wps_method == WPS_PIN_KEYPAD)
                        methods |= WPS_CONFIG_DISPLAY | WPS_CONFIG_KEYPAD;
+       } else if (p2p->cfg->config_methods) {
+               methods |= p2p->cfg->config_methods &
+                       (WPS_CONFIG_PUSHBUTTON | WPS_CONFIG_DISPLAY |
+                        WPS_CONFIG_KEYPAD);
        } else {
                methods |= WPS_CONFIG_PUSHBUTTON;
                methods |= WPS_CONFIG_DISPLAY | WPS_CONFIG_KEYPAD;