[PATCH] This patch is to clear existing dev->info.wfd_subelems when peer stops sending wfd_subelems.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch fixes below scenario:

When peer device stops sending wfd_subelems , then supplicant should remove dev->info.wfd_subelems from device's property.
Currently , Supplicant is not removing old dev->info.wfd_subelems.

Also , Above behaviour generates another issue :

As "wfd_changed" variable becomes true even when peer stops sending wfd_subelems and dev->info.wfd_subelems has an old value.
It results in notifying P2P-DEVICE-FOUND event again and again to upper layer.

Signed-off-by: Mayank Haarit <mayank.h@xxxxxxxxxxx>
---
 src/p2p/p2p.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index cd2fba3..8cc1971 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -839,9 +839,12 @@ int p2p_add_device(struct p2p_data *p2p, const u8 *addr, int freq,
 
 	wfd_changed = p2p_compare_wfd_info(dev, &msg);
 
-	if (msg.wfd_subelems) {
+	if(wfd_changed)
+	{
 		wpabuf_free(dev->info.wfd_subelems);
-		dev->info.wfd_subelems = wpabuf_dup(msg.wfd_subelems);
+		dev->info.wfd_subelems = NULL;
+		if (msg.wfd_subelems)
+			dev->info.wfd_subelems = wpabuf_dup(msg.wfd_subelems);
 	}
 
 	if (scan_res) {
-- 
1.7.9.5


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux