Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp580900pxb; Wed, 25 Aug 2021 09:54:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWJ3ucJLkBQOX8cHyHxGCQE9hsOH1OuOgpG5B2Irz7UAXlo8DfnpceeL/SiJQXc7FrFOGK X-Received: by 2002:a17:906:12c6:: with SMTP id l6mr48122559ejb.373.1629910494678; Wed, 25 Aug 2021 09:54:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629910494; cv=none; d=google.com; s=arc-20160816; b=MtRyJ/jsjZ5Q9A7tNZ23AnhIYVbgpCcQ/LFzOiYobf8V2eD3b/YweLl4MoOdW7GyuH p4AkshvJRRNHM/1mZ8khUe1O1fnhMU4+3BOn5IX9OuZalvDaxb03xotCZXFwaHRX8HIM SnX2yUwU4JJGER983lBY85/YkMgbQScRHDAXbW6QhGUJ6Mmiou+kaeF/Tah2RjZ1bsbz 3HRVolUrXRCba1buO7vsxJdpaJxmtsUAgdwtGavbxri1VaeCjTewxW7YFsMlyOxappVZ Blb07L0kSHBWh2SJSNLxI5Ody2jvdGc3puGkvelpN70zMiSl1wMhcs5CnucVIociZTA5 FS2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Okqha9zGYw7gOum05FTweoMx0bZinn0Ns29etpuXzUI=; b=x2/w5WfcjWBCuRYYYaTjZ715W2OnSB6ZrmLk6qA5g3y4ri1Bz5/bRBYz7X8qEIkYX0 QPJhux7yvmxkaPZ+UNKJMY9uLpFHLmW8hEk/u1M5DxCIVnpVImRPcyf1/ghx5D5E+I9j bzBver4wwDQa+3sf3r1+M1w7trEj+r+H62QBI5/DtIUEqy5wo3dJmJ6/VaB4k3jhw5op wSrtsecZmkxqrkHluMCHfMaql1YB7ZdG2GAaUlwHzzZZPw1SY+ZifB15NvHJswcpU3hi PDhN4xDb9a5JAt0waJiIMFEGTK00f6xJ5/7dqXvBIH0JFhCBYckGx2uWC98EEXVNld+Z tLvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b="zIw/i2Gd"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu1si217150ejb.482.2021.08.25.09.53.38; Wed, 25 Aug 2021 09:54:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b="zIw/i2Gd"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229791AbhHYQws (ORCPT + 99 others); Wed, 25 Aug 2021 12:52:48 -0400 Received: from vern.gendns.com ([98.142.107.122]:36504 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230363AbhHYQwr (ORCPT ); Wed, 25 Aug 2021 12:52:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Okqha9zGYw7gOum05FTweoMx0bZinn0Ns29etpuXzUI=; b=zIw/i2GdRi12fDTZYRo0gf/53x CkkWUV1EFwOOa/6A0cWrGByoV3jQ332xPwkQfWcp0+WJ/d7vVfqss6AHh2rwoJW9BOg0vMLisOnpT YUFQbvMvblCqZSEbpzph7iolGwXHzaPwwwgv8XHXvcyLA7O9Ajvk7Rbm8wnfscKvOoQRayDWZybGw GgbK0XHS5vWteh7VqsF1NfosAXQB9OAQAIzNcr/T4yO4jMzI5Bbh9nKBLAuRHxJDaqlvfvsBxA0Lm 9mvgb+/fnonhmsKejLX/ZApvru2KAl7hr71dJTxMXggfAGXydwU/besg7Qf+ZUF23/PMNcDnegUJ5 fnh3G7wg==; Received: from [2600:1700:4830:1658::fb2] (port=60238 helo=freyr.lechnology.com) by vern.gendns.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1mIw7y-0006LP-Gd; Wed, 25 Aug 2021 12:51:58 -0400 From: David Lechner To: linux-bluetooth@vger.kernel.org Cc: David Lechner Subject: [PATCH BlueZ v2 1/2] device: clear eir_uuids list on disconnect Date: Wed, 25 Aug 2021 11:51:24 -0500 Message-Id: <20210825165125.2675544-2-david@lechnology.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210825165125.2675544-1-david@lechnology.com> References: <20210825165125.2675544-1-david@lechnology.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org The eir_uuids list contains GATT service UUIDs from advertising data. The device may advertise different UUIDs each time it is scanned and connected, so the list needs to be cleared when the device disconnects. This partially fixes an issue where the UUIDs D-Bus property is empty after scanning, connecting, disconnecting and scanning again when [GATT] Cache = yes is set in main.conf. Issue: https://github.com/bluez/bluez/issues/192 Signed-off-by: David Lechner --- src/device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/device.c b/src/device.c index 807106812..53ef3e9a1 100644 --- a/src/device.c +++ b/src/device.c @@ -3129,6 +3129,9 @@ void device_remove_connection(struct btd_device *device, uint8_t bdaddr_type) device_update_last_seen(device, bdaddr_type); + g_slist_free_full(device->eir_uuids, g_free); + device->eir_uuids = NULL; + g_dbus_emit_property_changed(dbus_conn, device->path, DEVICE_INTERFACE, "Connected"); -- 2.25.1