[PATCH BlueZ 2/5] shared/ad: Fix bt_ad_has_data not matching when only type is passed

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

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

bt_ad_has_data attempts to match the data portion even when not set
which is useful the user is only interested in actually mataching the
type alone.
---
 src/shared/ad.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/shared/ad.c b/src/shared/ad.c
index 27b76dc8179b..7350aa206d1e 100644
--- a/src/shared/ad.c
+++ b/src/shared/ad.c
@@ -1028,6 +1028,9 @@ static bool data_match(const void *data, const void *user_data)
 	if (d1->type != d2->type)
 		return false;
 
+	if (!d2->len && !d2->data)
+		return true;
+
 	if (d1->len != d2->len)
 		return false;
 
-- 
2.39.2




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux