D-Bus Fix network_is_persistent_group() for P2P operations

Commit c2762e410f ('P2P: Update D-Bus
network object semantics during group formation') added this helper
function to determine whether a network block is used for storing a
persistent group information. However, it implemented this in a way that
matches both persistent group storage and an operating persist group
instance. This does not seem to match the expected behavior for the
D-Bus objects, so fix this to match only the persistent group storage
case to avoid registering/unregistered incorrect D-Bus objects for
groups.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2015-04-29 20:48:07 +03:00 committed by Jouni Malinen
parent 5441da2beb
commit 5aeebc48e8

View file

@ -1118,13 +1118,13 @@ struct wpa_bss * wpa_supplicant_pick_network(struct wpa_supplicant *wpa_s,
int eap_register_methods(void); int eap_register_methods(void);
/** /**
* Utility method to tell if a given network is a persistent group * Utility method to tell if a given network is for persistent group storage
* @ssid: Network object * @ssid: Network object
* Returns: 1 if network is a persistent group, 0 otherwise * Returns: 1 if network is a persistent group, 0 otherwise
*/ */
static inline int network_is_persistent_group(struct wpa_ssid *ssid) static inline int network_is_persistent_group(struct wpa_ssid *ssid)
{ {
return ((ssid->disabled == 2) || ssid->p2p_persistent_group); return ssid->disabled == 2 && ssid->p2p_persistent_group;
} }
int wpas_network_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid); int wpas_network_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);