Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp1306327pxw; Sat, 9 Apr 2022 19:29:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+domyg1oUyTsGMEE4OIbglAlgXCUBYIx9KhG8RmOvrH8LxAx3zK2THKPnC9CRfavQmDrp X-Received: by 2002:a05:6402:1541:b0:41c:bfb9:d56b with SMTP id p1-20020a056402154100b0041cbfb9d56bmr26515786edx.344.1649557751868; Sat, 09 Apr 2022 19:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649557751; cv=none; d=google.com; s=arc-20160816; b=xgyZZIl+fokONeouygFTeLCebDNjRSR7p6+BrA9cjBbAxRJbkq6f8wHkKX6WVjdkcg 44JkcGoEcaFa58uBpfGdqY0asaXT0jOmRyNEih0lEnfjLFT2AHD7M1K7oR2iNWk4O6sr DDcqK/yUoucxSXJLnIun4Rt3vjwzkgIJlMfiPyeKvfURaHHOpP16Q19elbMLt0c0savd dZqGMklWdwetE1CW5Ps6PP/FuRE7jy0uo/i/reBh8gvI5979KFaEozIe+Xq7Lt5gZuAF ImUxcZBQSWu4A98njhyeHvUuIVXeS2+Adwu9enX9uB/cM5TgThC79e3LU27C9g51Gpmg kGlw== 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=8GJcLDe13JuHpHi3WUYSuWh77KPku0pyG0zFNlLTUlQ=; b=mnUHA5bEz97xM3KpbQQPk6yG6u+411YqlQpa+rXx4rvQ/7ZV+EONjPqycsTbDFUphx zWD7ZTwISK5V+Fuk+VUPFosPLT/Y9NFMpH8FG1CYF+gFmlrujpMPVoaNs+GMjq2ODRc3 VC8EYA2p82ICGDIKnMiSqsUR9/xhP/bO3Sxc19/bkTufT3qVbS3K2cQxCuSP5J+Ft1Dr VMqnnxIn4OBtTqDwKb18kxMG2K4JQpxRdbnJ4nMSkFUXrm1tAQBGM/OJ+tb7JQtahCZh Yks3HLBs/1Q+vRadTDeZDSfZrENdtwIuwfpbPWUwiciN3+9Z2tz2mbguASdbxA0YWgle 31lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hilmer-dk.20210112.gappssmtp.com header.s=20210112 header.b=tcS0Nazy; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y16-20020a056402271000b0041d38202363si5629582edd.500.2022.04.09.19.28.18; Sat, 09 Apr 2022 19:29:07 -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=@hilmer-dk.20210112.gappssmtp.com header.s=20210112 header.b=tcS0Nazy; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230368AbiDIKEj (ORCPT + 99 others); Sat, 9 Apr 2022 06:04:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233216AbiDIKEi (ORCPT ); Sat, 9 Apr 2022 06:04:38 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1849322FD8C for ; Sat, 9 Apr 2022 03:02:14 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id b21so18804502lfb.5 for ; Sat, 09 Apr 2022 03:02:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hilmer-dk.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8GJcLDe13JuHpHi3WUYSuWh77KPku0pyG0zFNlLTUlQ=; b=tcS0Nazyg2Sj1ddp2TfjJv7iT3rSJnC+/SVBGxG6WZHn+Fk138hYd0qI0jBxB2MsWq QKZRbypl/hPQ4dA6OxWZl4gJSQmgmpVgZJgu9rF95zPsrKKXk9Vl9WBR35xjuAPJqNa4 3Ib1WoldT4Aso7oQm2rXmr2Nn5zozg8nv21+nXP0czxq/cwFXhcqBXHSIqz2lceZQBj1 ZoCxQw89B4qY6Z9ug82aTHMelZ1VbkCIUsUoTBzpUkz/1v+9L67qscDcUEPoYhIIQa6M 7KRfavigSId7+7PSSKAZcaiwgsopmBUgLygIcAfNeWTr15I8l4Il6ZB7anGrmnMdwOuK J/VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8GJcLDe13JuHpHi3WUYSuWh77KPku0pyG0zFNlLTUlQ=; b=f6N+gUuNDo73PVu2IPtuu6REbkvgo81ywpbYTsl886KUCxl7IGtDGZQa36+qxf2KiU Xj6r2mcv0nI6fXJZrxsgxGgip8VSZgmaAWaBe8CtT9qaolbtu/BrykWnTwqhY9gWAazR vnAyaMCp51edN+RTTo/3sB3CFV6kdzd0eaQdhFL8vhdgyJtyCfiNPTNRBtH1TBYt1EsD I6lmkDkVoeJ/Pa5u7Zr5M20Yj1ul+05jfWCtyh8za6qd6MQRODWv6ozpGJ6HlUyU57xM LHtv7eY6iF2ZVyUon+d8zn2RzihO7puAMhj2VUdgiHGrPkumsse5myHisKVThllmDYKX M/3g== X-Gm-Message-State: AOAM531HK8PkSRlzsAVq6kS7VJARudmhlhh4laVobD0ZvmxzQUVjt4B/ QABnbtw0bfezLf+B1d6SnFaf7AmkxtLc5xJR X-Received: by 2002:a19:7610:0:b0:46b:9365:fa98 with SMTP id c16-20020a197610000000b0046b9365fa98mr1141113lff.100.1649498532056; Sat, 09 Apr 2022 03:02:12 -0700 (PDT) Received: from jakob-nuc.lan ([185.229.152.125]) by smtp.gmail.com with ESMTPSA id i16-20020a056512319000b0044ae52c6365sm2471759lfe.88.2022.04.09.03.02.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Apr 2022 03:02:11 -0700 (PDT) From: Jakob Hilmer To: linux-bluetooth@vger.kernel.org Cc: Jakob hilmer Subject: [PATCH BlueZ 1/1] adapter: Fix check of DISCOVERABLE setting Date: Sat, 9 Apr 2022 12:01:30 +0200 Message-Id: <20220409100130.9743-2-jakob@hilmer.dk> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220409100130.9743-1-jakob@hilmer.dk> References: <20220409100130.9743-1-jakob@hilmer.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NO_DNS_FOR_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR autolearn=no 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: Jakob hilmer The test for `DISCOVERABLE` should be done with `MGMT_SETTING_DISCOVERABLE` instead of `MGMT_OP_SET_DISCOVERABLE`. --- src/adapter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adapter.c b/src/adapter.c index 71de9e82b..f1197684e 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -1993,7 +1993,7 @@ static bool set_discovery_discoverable(struct btd_adapter *adapter, bool enable) return true; /* Reset discoverable filter if already set */ - if (enable && (adapter->current_settings & MGMT_OP_SET_DISCOVERABLE)) + if (enable && (adapter->current_settings & MGMT_SETTING_DISCOVERABLE)) return true; adapter->discovery_discoverable = enable; @@ -2229,7 +2229,7 @@ static int update_discovery_filter(struct btd_adapter *adapter) /* Only attempt to overwrite current discoverable setting when not * discoverable. */ - if (!(adapter->current_settings & MGMT_OP_SET_DISCOVERABLE)) { + if (!(adapter->current_settings & MGMT_SETTING_DISCOVERABLE)) { GSList *l; for (l = adapter->discovery_list; l; l = g_slist_next(l)) { -- 2.25.1