[PATCH] wpa_supplicant: Fix updating GO beacons on WFD subelements change

Ilan Peer ilan.peer
Sun Nov 3 05:24:13 PST 2013


From: Andrei Otcheretianski <andrei.otcheretianski at intel.com>

When WFD Subelements are set, the ie in the
beacons of already existing groups are not updated.
This patch fixes this issue by setting beacon_update to be 1.

Signed-hostap: Andrei Otcheretianski <andrei.otcheretianski at intel.com>

---
 src/p2p/p2p.c       |    2 +-
 src/p2p/p2p_group.c |    6 ++++++
 src/p2p/p2p_i.h     |    1 +
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index 84de7af..b263609 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -4192,7 +4192,7 @@ static void p2p_update_wfd_ie_groups(struct p2p_data *p2p)
 
 	for (g = 0; g < p2p->num_groups; g++) {
 		group = p2p->groups[g];
-		p2p_group_update_ies(group);
+		p2p_group_force_beacon_update_ies(group);
 	}
 }
 
diff --git a/src/p2p/p2p_group.c b/src/p2p/p2p_group.c
index 15e7622..b3c3a44 100644
--- a/src/p2p/p2p_group.c
+++ b/src/p2p/p2p_group.c
@@ -980,3 +980,9 @@ int p2p_group_is_group_id_match(struct p2p_group *group, const u8 *group_id,
 	return os_memcmp(group_id + ETH_ALEN, group->cfg->ssid,
 			 group->cfg->ssid_len) == 0;
 }
+
+void p2p_group_force_beacon_update_ies(struct p2p_group *group)
+{
+	group->beacon_update = 1;
+	p2p_group_update_ies(group);
+}
diff --git a/src/p2p/p2p_i.h b/src/p2p/p2p_i.h
index bb5dd39..6b7f6bd 100644
--- a/src/p2p/p2p_i.h
+++ b/src/p2p/p2p_i.h
@@ -608,6 +608,7 @@ u8 p2p_group_presence_req(struct p2p_group *group,
 int p2p_group_is_group_id_match(struct p2p_group *group, const u8 *group_id,
 				size_t group_id_len);
 void p2p_group_update_ies(struct p2p_group *group);
+void p2p_group_force_beacon_update_ies(struct p2p_group *group);
 struct wpabuf * p2p_group_get_wfd_ie(struct p2p_group *g);
 
 
-- 
1.7.10.4




More information about the Hostap mailing list