Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5052222rwl; Mon, 3 Apr 2023 13:39:58 -0700 (PDT) X-Google-Smtp-Source: AKy350Z641Z7+i9ro+aRWCN1NdGeVoy2fYFxAplBwWW0gc68PtRn4pDnndWZZVgWTZeSBW6e8aTT X-Received: by 2002:a17:903:1c3:b0:1a0:4859:19ea with SMTP id e3-20020a17090301c300b001a0485919eamr244519plh.39.1680554397755; Mon, 03 Apr 2023 13:39:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680554397; cv=none; d=google.com; s=arc-20160816; b=GcST0cml/EXV4LkebstGUyP+f+raL5UdXk6NN//3O1AVhUlzuGxBqA6qQbS6uoGiPy D6R6m+2BmaoJRKNO9BQL6i+3Ckw88Ohb5uYFVRVASb5Upt7CeHFRkoMy6quFD9xzABvd Scks1A8/TP++MNgMmOFhIpZc/rioNznQgB2e9hIn2QVlLI+giWZAk+1hnT1NgOhJOqg8 D+tzXwpJY/LGsvnLjdi0FAcerZlQ7Rcf10fDuquHL77DYJaLavrk514Rv0saWxq9XwjC WpYpwxX1Sgag3uV9ugjE2zNWhdeHTsc5Bd3adS0oMu4ASaG9doga9wbXi9w2JAlKOU36 A7bw== 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 :message-id:date:subject:to:from:dkim-signature; bh=jTRAeRWaa/WU59xEBFWRGeQrSpj8glfPo7tnjjCjgLM=; b=lLK0E+yhxLoHr0EIVZU4jUgrn010Ax0mJTiqK7JkjJpeSKLS4We0H3xO1VC53HDYm3 620I5NegFxFhKVbyAsRAtqhGHGhsh2+mpf7vQ3caMnO9H11STkoFGXHIkM095NHHHaCQ 0VPMVSEAV1nbaWhvfMhipatXDOvdgqY/yEL3aZtJzfxJ+eoEH0AAq0LuwMkDB7ykeWhY as28+nTYIeepPEs7NzONnWZfWnl9rO0gr+GoCbL8UV4b1KjCRtbctqaXgR9jG3MKzq30 wqtIZhA26wOsfk8nnHLObBMFdl2Nmf3HCkVkTzCaTo/xlvZocABmGUItx+62JBaNBQFL xKDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HyfaWIjl; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l71-20020a63884a000000b005138c1f1fbesi9142351pgd.845.2023.04.03.13.39.35; Mon, 03 Apr 2023 13:39:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HyfaWIjl; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232776AbjDCUc5 (ORCPT + 99 others); Mon, 3 Apr 2023 16:32:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233128AbjDCUc5 (ORCPT ); Mon, 3 Apr 2023 16:32:57 -0400 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF249210C for ; Mon, 3 Apr 2023 13:32:46 -0700 (PDT) Received: by mail-qt1-x833.google.com with SMTP id cn12so26305895qtb.8 for ; Mon, 03 Apr 2023 13:32:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680553965; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=jTRAeRWaa/WU59xEBFWRGeQrSpj8glfPo7tnjjCjgLM=; b=HyfaWIjlfvWOQRVLj/gtzOkA496LDdt3pW1AewMkhW8pVF5UDb7eGgDWUrEIw6svuf JUxNdDx2txdNjJ4z0VXWUhKxBKV0kBCdHHDMhVikrJsvFyB/6CXqtxJee6tLudsN1E4W DXmR+hfUw55zp7gzk/16mQC4+LBRzHHbRqG43ktblYYVZOrkD6AY5q6cYtJJ2r57wFTi sbFTJkaOXs6v4gB/28dhRS3aNkoRC7ooIROLUS0HeUQLRbcCh6UkkZQoJ+t2qS0Vkhbt naTL01J9QJ7azJEIVqon5ArTpxWMrne1WNzygytzKwrT5374CbMWtunJIyPnRIyRwpkv A4DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680553965; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jTRAeRWaa/WU59xEBFWRGeQrSpj8glfPo7tnjjCjgLM=; b=WwouTq+IxGd6quEE1GDS9+U4jsAGq9FHsCzouzL+IUv01Jf7ZcW5n83NHJH//RID6U bZr4PLqh+RsgZUBNCU7fTzQWemKRxPjqNO5FYVeZhgUJFQisG8WMTIyjQMTO6R/7k4Q2 xpKTktPqYT/37IUhREJBQEidweGWY3ngAJZB/1dz0PKlt57PTXdpntDyBkiFw7Db2beQ zJAIvjTnzhReM7SotJjbAlq3TVBoRR7pgYDSGtptdwMZ2uyLAKTC4LVq0jT4a+aMarqL 6/q6qEwQz7K19Y7wMkec9b0Kp9CTgzoH9rRpuic5V5trruuTPx2RvqBoz0g+ueoFPbUw 80NQ== X-Gm-Message-State: AO0yUKVsxaO3pS35TYGeWLEcU0/aOO4+xs1FIucftp64pTQCd0SZVk7i p1K+uQidSwUdgLMjgKfAWVTwJ56qUdE= X-Received: by 2002:ac8:5713:0:b0:3e3:86cb:1b9b with SMTP id 19-20020ac85713000000b003e386cb1b9bmr64172373qtw.13.1680553965405; Mon, 03 Apr 2023 13:32:45 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-59-129-171.hsd1.or.comcast.net. [71.59.129.171]) by smtp.gmail.com with ESMTPSA id r5-20020ac87945000000b003e6410b4bfbsm2469345qtt.28.2023.04.03.13.32.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 13:32:44 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ] set: Fix not attempt to connect devices with RSI Date: Mon, 3 Apr 2023 13:32:43 -0700 Message-Id: <20230403203243.1960045-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz If a device advertising with RSI is only found later after the set was already create we shall still attempt to connect to it. --- src/set.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/set.c b/src/set.c index f1008a057f90..ad64fb163b25 100644 --- a/src/set.c +++ b/src/set.c @@ -317,7 +317,8 @@ struct btd_device_set *btd_set_add_device(struct btd_device *device, set = set_find(device, sirk); if (set) { set_add(set, device); - return set; + /* Check if there are new devices with RSI found */ + goto done; } set = set_new(device, sirk, size); @@ -329,6 +330,7 @@ struct btd_device_set *btd_set_add_device(struct btd_device *device, queue_push_tail(set_list, set); +done: /* Attempt to add devices which have matching RSI */ btd_adapter_for_each_device(device_get_adapter(device), foreach_device, set); -- 2.39.2