All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrejs Hanins <andrejs.hanins@ubnt.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH] core/advertising: Fix string match in le adv search
Date: Tue, 6 Oct 2015 14:46:47 +0300	[thread overview]
Message-ID: <5613B4A7.7030901@ubnt.com> (raw)

Instead of searching for matched entry in the list, the function match_advertisement
was searching for the first non-matched entry. As a result, it wasn't possible to
unregister existing advertisement from LE Adv manager.

Signed-off-by: Andrejs Hanins <andrejs.hanins@ubnt.com>
---
 src/advertising.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/advertising.c b/src/advertising.c
index d56b7a2..a148625 100644
--- a/src/advertising.c
+++ b/src/advertising.c
@@ -77,10 +77,10 @@ static bool match_advertisement(const void *a, const void *b)
 	const struct advertisement *ad = a;
 	const struct dbus_obj_match *match = b;
 
-	if (match->owner && !g_strcmp0(ad->owner, match->owner))
+	if (match->owner && g_strcmp0(ad->owner, match->owner))
 		return false;
 
-	if (match->path && !g_strcmp0(ad->path, match->path))
+	if (match->path && g_strcmp0(ad->path, match->path))
 		return false;
 
 	return true;
-- 
1.9.1


             reply	other threads:[~2015-10-06 11:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-06 11:46 Andrejs Hanins [this message]
2015-10-07 13:09 ` [PATCH] core/advertising: Fix string match in le adv search Luiz Augusto von Dentz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5613B4A7.7030901@ubnt.com \
    --to=andrejs.hanins@ubnt.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.