[PATCH] This patch is to send P2P-DEVICE-FOUND event to upper layer on changing device name of the peer device.

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

 



This is to handle the case when peer changes device name and same need to be updated to upper layer by P2P-DEVICE-FOUND event.
It is similiar to case when peer changes wfd_subelems and P2P-DEVICE-FOUND event goes to upper layer.

Signed-off-by: Mayank Haarit <mayank.h@xxxxxxxxxxx>
Signed-off-by: Avichal Agarwal <avichal.a@xxxxxxxxxxx>
---
 src/p2p/p2p.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index cd2fba3..2f1f294 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -711,6 +711,7 @@ int p2p_add_device(struct p2p_data *p2p, const u8 *addr, int freq,
 	struct p2p_message msg;
 	const u8 *p2p_dev_addr;
 	int wfd_changed;
+	int devicename_changed;
 	int i;
 	struct os_reltime time_now;
 
@@ -821,6 +822,11 @@ int p2p_add_device(struct p2p_data *p2p, const u8 *addr, int freq,
 	}
 	dev->info.level = level;
 
+	if(msg.device_name && (os_strcmp(dev->info.device_name, msg.device_name) != 0))
+		devicename_changed = 1;
+	else
+		devicename_changed = 0;
+
 	p2p_copy_wps_info(p2p, dev, 0, &msg);
 
 	for (i = 0; i < P2P_MAX_WPS_VENDOR_EXT; i++) {
@@ -854,7 +860,7 @@ int p2p_add_device(struct p2p_data *p2p, const u8 *addr, int freq,
 
 	p2p_update_peer_vendor_elems(dev, ies, ies_len);
 
-	if (dev->flags & P2P_DEV_REPORTED && !wfd_changed &&
+	if (dev->flags & P2P_DEV_REPORTED && !wfd_changed && !devicename_changed &&
 	    (!msg.adv_service_instance ||
 	     (dev->flags & P2P_DEV_P2PS_REPORTED)))
 		return 0;
-- 
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