Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2838732rdg; Mon, 16 Oct 2023 17:22:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtsdL5ekS2yeZPRtbzqRyt3iYlWTRTKWaDKsDioFjhfm3m0TdBHLuzNwRYAvHN5Qk17SfN X-Received: by 2002:a05:6830:310d:b0:6bc:b2a2:7b02 with SMTP id b13-20020a056830310d00b006bcb2a27b02mr1008148ots.7.1697502142208; Mon, 16 Oct 2023 17:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697502142; cv=none; d=google.com; s=arc-20160816; b=UAzCLw5aflmZQl8arWzt7FRvOkWW5yJVcdpoEnXPQwH/avbTJs/0zxcaj2OQqCKtLM W8SxbktcPGLD+T426dsYXLXLk2gyauanvfXl18G2yGV41pdg8KybiulRfEE4JzQzOSH1 ME8yYLCdjwMP0Q3gdk9wDRknC3Vsg8BQR43Ve4DtvRzRSn4JAW6xJPhrKlezTiAJtiv8 gmEAxr0XXJb1nlnImebG1Bji75+vgTgbnizJ8es3NgGeRlE6ezHPE8BTWjtWSz+xXvo7 EGLhNIW6AyRv+PxIB/SyXlJjyR16LrtfCoqkpK0f2NbeygMTCWDpSg6gaUa8JH0gxzOJ 1vog== 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:cc:to:from:dkim-signature; bh=o4wgzh3mOCP7wlv+sWzfFSITlUpuF8QS9eF0cltOs2U=; fh=vffO20OQHr+ez65z5iDOuRt6Z6vlzXAnr3S+SmTiPz8=; b=Hd1hvwJDav8wg3kNbHEkZJ5aB9h4Bgb0Z5Q16lvxDPRSGurmw1zAiB0IEubFsDlEhx Xwld8+1DOEgC82ljKaavLvi6fqlTgmSqS7RR6dJLd1h4Odtu8xBfqP8M6uIGYF3nMM4l esgR9toWzBzRFRoIdvXnHOmNUTxqsZMrayoH3Pt2OGEudHSsak8eqpZRQxlEgRbUMRGa EkUjt3iDU2J/mD61muirS4lJLNh1saigC6nq6rkOl/Tb9tCgzxVpAuYtbTac0Pym1Su0 NXbk/hogEL8ErM/1QeYGLlbeWPA2Orsi/tIA35Zr0faXdl4VLpfQouInJTIeFjvt3hJp v2rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=CllBKMHN; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id 201-20020a6302d2000000b005b000325119si522806pgc.414.2023.10.16.17.22.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 17:22:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=CllBKMHN; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id CF38780A1E3A; Mon, 16 Oct 2023 17:22:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232172AbjJQAWI (ORCPT + 99 others); Mon, 16 Oct 2023 20:22:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232096AbjJQAWH (ORCPT ); Mon, 16 Oct 2023 20:22:07 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 541D092 for ; Mon, 16 Oct 2023 17:22:06 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6b2018a11efso3360915b3a.0 for ; Mon, 16 Oct 2023 17:22:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697502126; x=1698106926; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=o4wgzh3mOCP7wlv+sWzfFSITlUpuF8QS9eF0cltOs2U=; b=CllBKMHNnxfo2zQ07XCKk2OZniU3ivDD8Qb8YPb5O9v4hMdFh1dCjRQFdGusJR4ovZ JbUAvVYOdEzCnnux9q4hADLETjE4wddkSrbsk5LNBvQRjojeZYfM/cK1OeSS+PR2vmD3 aev9XxG1F2sLycZswjClMjkE02tqJp54r+Icvqq+1rJg+z9mdcdulGPgoaCJorgMWQEj zkIhtJMT6ryj0nq4bh1YIWoMU0jiVAD+n/ENzJ24sdhbyZDWi3+9BKQZWiyE1hMsRqW7 BjyTJuv0OgY1b9n7YBRGmp7guSXNFDHG5P5kdu5U3xqf2Al3IQFAG0EF4729gQDTLw21 dTFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697502126; x=1698106926; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=o4wgzh3mOCP7wlv+sWzfFSITlUpuF8QS9eF0cltOs2U=; b=BXQbY1sXkIu5dNRwLGTNEmLijncZED7hjSrifVjNbDVM26n7Zk2kugE/qbRZT2LRnA CRGmNsjbYhIjbf/UZg5fWitl71T23JWgpe+c/yYqPObCP3sFKGR52EyyQexBnRtaKyOk WFeeRXKf1lu6xCGys+vrjE9mCZW8I4qwyLrr3R691yVIVNXA6kmPiAzYiVNQWpTLLuAx g0lW+qklhg1vrOfrRfoBAeLYePzt+NsbyeGjfky1ebQzzvJ7Ymjh+talevXBLksaZFNE Wjejtqg7UXUKX+xSnqA+rrYMkMXJwhafaIi3RmF6zITl3GoWgvZhGHU0zKHmQojHGY4b TyFg== X-Gm-Message-State: AOJu0YwvuUHPfEDjn1Yi8cLRbPaaNZvWPMTqsRU1JcEnXdsMDextZQpT 5u/qKXt6+l/GxMpAr62gQCn/ew6YMIizGQ== X-Received: by 2002:a05:6a21:35c8:b0:16b:c22c:f99c with SMTP id ba8-20020a056a2135c800b0016bc22cf99cmr510392pzc.32.1697502125625; Mon, 16 Oct 2023 17:22:05 -0700 (PDT) Received: from fedora.. ([2601:601:a480:c78:c3f1:c438:9351:a6f1]) by smtp.googlemail.com with ESMTPSA id i10-20020a17090a2a0a00b0027cf8869ee7sm32481pjd.0.2023.10.16.17.22.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 17:22:05 -0700 (PDT) From: Inga Stotland To: brian.gix@gmail.com, luiz.von.dentz@intel.com, linux-bluetooth@vger.kernel.org Cc: Inga Stotland Subject: [PATCH BlueZ v2] mesh: Fix check for active scan when using generic IO Date: Mon, 16 Oct 2023 17:21:23 -0700 Message-ID: <20231017002123.43533-1-inga.stotland@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 16 Oct 2023 17:22:19 -0700 (PDT) This modifies the check for an active scan in generic IO: the bug has been introduced during earlier code refactoring. Fixes: https://github.com/bluez/bluez/issues/625 --- mesh/mesh-io-generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesh/mesh-io-generic.c b/mesh/mesh-io-generic.c index 00932ade7..13a863b48 100644 --- a/mesh/mesh-io-generic.c +++ b/mesh/mesh-io-generic.c @@ -781,7 +781,7 @@ static bool recv_register(struct mesh_io *io, const uint8_t *filter, bool already_scanning; bool active = false; - already_scanning = !l_queue_isempty(io->rx_regs); + already_scanning = l_queue_length(io->rx_regs) > 1; /* Look for any AD types requiring Active Scanning */ if (l_queue_find(io->rx_regs, find_active, NULL)) -- 2.41.0