Linux-Bluetooth Archive on lore.kernel.org
 help / color / Atom feed
From: Niels Avonds <niels.avonds@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Niels Avonds <niels@nobi.life>
Subject: [PATCH BlueZ] device: Don't mark services resolved on error
Date: Wed, 29 Jul 2020 09:16:02 +0200
Message-ID: <20200729071602.12868-1-niels@nobi.life> (raw)

This fixes a bug where the service UUIDs were not rediscovered after a
failed bonding attempt because the svc_resolved flag remained set even
though the uuids list was empty.
---
 src/device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/device.c b/src/device.c
index bb8e07e8f..e20c2d240 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2591,7 +2591,8 @@ static void device_svc_resolved(struct btd_device *dev, uint8_t browse_type,
 
 	DBG("%s err %d", dev->path, err);
 
-	state->svc_resolved = true;
+	if (err == 0)
+		state->svc_resolved = true;
 
 	/* Disconnection notification can happen before this function
 	 * gets called, so don't set svc_refreshed for a disconnected
-- 
2.18.0


                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200729071602.12868-1-niels@nobi.life \
    --to=niels.avonds@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=niels@nobi.life \
    /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

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org
	public-inbox-index linux-bluetooth

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git