Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp886914ybz; Fri, 1 May 2020 10:19:06 -0700 (PDT) X-Google-Smtp-Source: APiQypIwtLbGfDoLJAGM4SS2bFr079BRxCFmVN5Uo6ec9AFseNS7mokHxoB9i82jwTHaRxNOeX+P X-Received: by 2002:a05:6402:31b6:: with SMTP id dj22mr4585184edb.258.1588353545853; Fri, 01 May 2020 10:19:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588353545; cv=none; d=google.com; s=arc-20160816; b=anuifLILdr1YGRzvXR3lXiZgBz6aDsdqhT9bzi9DUrZvM8C94YuJxlnA7DnNoBokU3 YQfGg8ft6eLte50S8PrySARdJMC0J/34W1S/42NwddWUtpbKmI/D5McP3jpAVZP5gPXw kQv0gRJQbge1n02sBv8NNgQUIZ/nfDDw/8Lc93CUudZcckSFvmuHkIJw+TYSbsoO/HEC qjIAaf6viXjm413rnGO44bboqWSz1MdmFsKpLfnBKKbPznYTFezabI3mKmfvsIJKGTaj APLu6JDLpdqGnT5osi+jmnxtagirqSGibiWLabRPT4B9IYuw3W9bFtcGbPrNRNv79WOI yMrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NCIQzoQkXUC2sPB4DCcD1ewh2MMBFcxdtF5Uc5/Li6Q=; b=TooIRkwXOUCe6xsSTj1gGh/WrzBsoF6j7fu+2sm+HQ8M5i6K5Go04tXxq+JWReOuaK 27HE1TzlCjAewKoXMAW1CoyUQ1OlqKesd/C/9xvugKu+E9drKfuAi37Te2pmmbaiASXG PZTXR6NFZO3DkpFCWit1zB5AhVi0UhRWSpFWIvuWmfcA1QLVwwbb96bFRIEvvHmMe9aW uR6z74zk5C/GuT50X5ZNL9sY74Vbghb9J2F2pzjxrG/kVUOIewI3VuspqMHGxX8/O9yg vf3a3rzHucYF3bkDDI80EoV6iNpspapaCJKWbBXaUJxMd00HjbWaf7s9H/yhqwV6zyA3 QHfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=NaRHZgKT; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ks2si2005551ejb.445.2020.05.01.10.18.33; Fri, 01 May 2020 10:19:05 -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=pass header.i=@google.com header.s=20161025 header.b=NaRHZgKT; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729382AbgEARR7 (ORCPT + 99 others); Fri, 1 May 2020 13:17:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729246AbgEARR6 (ORCPT ); Fri, 1 May 2020 13:17:58 -0400 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EB21C061A0C for ; Fri, 1 May 2020 10:17:58 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id f8so4356474lfe.12 for ; Fri, 01 May 2020 10:17:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NCIQzoQkXUC2sPB4DCcD1ewh2MMBFcxdtF5Uc5/Li6Q=; b=NaRHZgKTXiWqpT8hBHW8lzXf9ZulNjem7O0KHmLF7rP9+Ai5KMQuJxX9pEn/eqbbei m5kzzlKNNvh6P9BvDAOqpWx9gQERqapXVxag1MlXZCE/OzCE/SysBSKr8DnqGBHrIvJH cp9ARzAaz6fwYQ5HQcgV8M298qId1rYMdjA4+3P0q4ykrnz8L9J1zmUCiHDwFp6y2zqh YNFKJJqrenr8u4QolILWokbdbp9pDFenGK7nZ5Yc0fkLbzuYCmUCsBVZmdtWJKsVwHF5 VpfRM7SVrcMB9j8qiHABPYCD06TKuKPSwHAqxExsGQSHJ+KVLUMIi4Ndyxb6okaikKzF sckw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NCIQzoQkXUC2sPB4DCcD1ewh2MMBFcxdtF5Uc5/Li6Q=; b=sRSz0rMNyPvjP3AsGVgkLCbm+V7PYbT35LKMWLlEIMSZPE9ofX+Ta0Gprf/rBFJvgI 9xvP6mX8wIZu+S8We+PMcahL5KXDlaL5VFgI1MrWRyw6VcsuTW2hFxZ2mPCUaXIaqvxF VOKSuOsrDX+e77uatyYcUbcwzswAFmvMXPgH+oL6VDtJ/96Jrw/dGB6E6Y8WQaaKRcqv nRlWVwdinPHMdkwP7p4FpBhEEx/g5Obysah5hKkaZNHjda1FVqhng/v7fzSwDSpmcKIw /t5URWlYT65YCv5fKgXyOAvvK1xhSS9oYk9u4Mfv0DpNiVxIULyZvRFQISceRnt701jl USHQ== X-Gm-Message-State: AGi0Puanz8FOEHfYDNnkOPw4XtMbzf8EaJxpkM1GkaS44+bXXQQ9Z3Nv D7aCRuf3poloYq8eSrE3urRNqcxJ5dW77OWTqB4U7w== X-Received: by 2002:ac2:57cc:: with SMTP id k12mr3011693lfo.69.1588353476620; Fri, 01 May 2020 10:17:56 -0700 (PDT) MIME-Version: 1.0 References: <20200501144037.1684-1-alainm@chromium.org> <4195BFB9-1586-435F-8FC2-ED215959A591@holtmann.org> In-Reply-To: <4195BFB9-1586-435F-8FC2-ED215959A591@holtmann.org> From: Alain Michaud Date: Fri, 1 May 2020 13:17:45 -0400 Message-ID: Subject: Re: [BlueZ PATCH v1] shared/gatt-client:Ignore orphaned characteristics To: Marcel Holtmann Cc: Alain Michaud , BlueZ Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Marcel, On Fri, May 1, 2020 at 12:26 PM Marcel Holtmann wrote: > > Hi Alain, > > > The gatt discovery proceedure simplification to discover all > > characteristics at once has exposed a device side issue where some > > device implementation reports orphaned characteristics. While this > > technically shouldn't be allowed, some instances of this were observed > > (namely on some Android phones). > > > > The fix is to simply skip over orphaned characteristics and continue > > with everything else that is valid. > > > > This has been tested as part of the Android CTS tests against an > > affected platform and was confirmed to have worked around the issue. > > --- > > > > src/shared/gatt-client.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c > > index 963ad619f..d604c77a3 100644 > > --- a/src/shared/gatt-client.c > > +++ b/src/shared/gatt-client.c > > @@ -632,7 +632,10 @@ static bool discover_descs(struct discovery_op *op, bool *discovering) > > util_debug(client->debug_callback, client->debug_data, > > "Failed to insert characteristic at 0x%04x", > > chrc_data->value_handle); > > - goto failed; > > + > > + /* Skip over invalid characteristic */ > > + free(chrc_data); > > + continue; > > } > > should we add a warning here? Is there a good way other than the util_debug mechanism to write a warning? > > And I think it would be good to have a bit more verbose comment why this is done this way instead of aborting. Ack, will be added in V2. > > Regards > > Marcel >