]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
D-Bus Fix network_is_persistent_group() for P2P operations
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 29 Apr 2015 17:48:07 +0000 (20:48 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 29 Apr 2015 17:52:22 +0000 (20:52 +0300)
Commit c2762e410fa319f75a174aeb12343beddf99fce4 ('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>
wpa_supplicant/wpa_supplicant_i.h

index 8ed8b7258c19d526d4b4c1f6a0ae37f3513f4a5a..364ba194922003e667706ac32c0eadf03f293b30 100644 (file)
@@ -1118,13 +1118,13 @@ struct wpa_bss * wpa_supplicant_pick_network(struct wpa_supplicant *wpa_s,
 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
  * Returns: 1 if network is a persistent group, 0 otherwise
  */
 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);