Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3885359pxb; Mon, 27 Sep 2021 05:00:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKJnVLZ/uI+JZwaIpCONd29nLpvksuCIv7A5IKLDWIXuo7stf7VObmYNtGsWrYx+6kWl+J X-Received: by 2002:a17:906:a082:: with SMTP id q2mr25695593ejy.535.1632744048924; Mon, 27 Sep 2021 05:00:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632744048; cv=none; d=google.com; s=arc-20160816; b=YTpNa8tPKodZ5Cj9PZqrlQXyZkL0TxA8mdf12k9ChS9/Ir0xE5NOEG0mi8mo43CFej CZBk37Rmix2qcT3fm3Z2wnHi/I4M1GlPHILYi7S2UK9QVIulmdHB1RP/kV8MlXKoq5A9 0MGQDPxxlhvpySApXMb0k20JhTIhXeJkGU5DEFIVbLdx2NQUHI+mdTo2CKov8Fvt2/Al CSGWecxVPTwc686UaoUiC53uPiRlPDlwWvIqiiqRF2VZuxJar1XOpQ9v6PnjZUuisR/J aY2FkmGCrpfPqzcLH7/CMQNHctE73SFUvHRkYWLrLMrRlE0hUH4/FoLWFlP1N55zpmXa /3Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=FHQuGPAsx7HYP87vGVnx/78AZl3+QiedtSpkbOjt7EQ=; b=MJ6gwtK2zz7A0KKKl9/Qt6ZRHyWTKodc4JZvWLGrD4Txcqgcdyy7KNW+YzU/xGH6s/ 6L/crk5TzfFepW6PHxDTEuEdwQ7KHHcu+3aWpSTYodhzxS/gJAB7YYVh95DDOxDb7aLM ufYT5Dmqzs2VZ8/GmE4knz1Yx4cxv22FCEIMEcZjXyVoOehLXGhiYSM5jaonXm2Qbsvg h8a61vPCPXf7s7O50Tj9L6cyWi23KlnrlDN4R1xsBN4fsLE8sU+1aGhVvL7RQIxrm+wc Tcx5OvtPCNafC2uD7A8KCzs9+ixb85WUiDZGlNcgIpkr4RSFwxfAvzPpYZJcCvnkiqWg H4bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=PQ4wLEoH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 p4si17535417ejr.151.2021.09.27.05.00.24; Mon, 27 Sep 2021 05:00:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=20210112 header.b=PQ4wLEoH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S234150AbhI0MAH (ORCPT + 99 others); Mon, 27 Sep 2021 08:00:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234111AbhI0MAF (ORCPT ); Mon, 27 Sep 2021 08:00:05 -0400 Received: from mail-qk1-x74a.google.com (mail-qk1-x74a.google.com [IPv6:2607:f8b0:4864:20::74a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DAAAC061604 for ; Mon, 27 Sep 2021 04:58:27 -0700 (PDT) Received: by mail-qk1-x74a.google.com with SMTP id g8-20020a05620a40c800b0045ce49e5340so64319347qko.14 for ; Mon, 27 Sep 2021 04:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=FHQuGPAsx7HYP87vGVnx/78AZl3+QiedtSpkbOjt7EQ=; b=PQ4wLEoHwibbQljKZZiGlG0QC+UQZ0CprAOKwd9fPGtN4DGicTZ+rV6TcK1FpX3B0r dSW4x/IRQBcxSHKTlFm0edXdUh4XHcwxEu2l/+vzYtdaeQeQp18tGGGNjmG/drcRaq1L lCU2NPYODwZkL/wtwQEPKbOhaL1rh0dwPIdophSYaLznP/0CNNXF+DFLffslQPwPWeD0 Y4uFtw5VeD2YFPiLADaxQjd1Ox8uhjgj9crlLO5aul80Y9FdHATm41JEzAarFEpg7akL o6NAZtj+eD4CXXAB0CIf5BtovcNHAVjNhoeGlKR5yXibVTWx01pjTwALi/B4btMuJA65 3SCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=FHQuGPAsx7HYP87vGVnx/78AZl3+QiedtSpkbOjt7EQ=; b=1Fv8fz6yqKMADuR/VhFvOjRe/aJeUHVgkfN9fANDOYB7tw0s21PRAH0VeCbxy4Bf8F 931hvLnhcfWMC01LkHU6lsemQkS4qY/9+QF4Ip9hHJNVX+asTjlMebyDsvgQYtMtxsPg SuLThD5aFKisA28TBWf43S3vFq3ZEa37Ij+jndm+e2/ia8xy7H+3idtuTMXQf4h8KDAk NUurGkeUaYFf4u+7ntvF5bPu2ySZCjNXP0y+h8xwtuvPUPD2bOgdTcM+3qCqw/azjnu3 c0xzYH7R0xem9lxQQiRdHyGrB5OYFQ93j7tUM9Eg7d6wDBrGEI/GZfbklggNFmLovlSS 5aCA== X-Gm-Message-State: AOAM533yuMfi0QjdoHQ5/3YrTn3dK2T/lJfHFrOiv42EooEW21524fYZ tsxa5G0TcWis192haaX0b5aUR9+a3zKyn9py/A== X-Received: from howardchung-p920.tpe.corp.google.com ([2401:fa00:1:10:9751:55fe:4e2:1c04]) (user=howardchung job=sendgmr) by 2002:ad4:4989:: with SMTP id t9mr22237qvx.29.1632743906497; Mon, 27 Sep 2021 04:58:26 -0700 (PDT) Date: Mon, 27 Sep 2021 19:58:01 +0800 Message-Id: <20210927195737.v1.1.Id56e280fc8cac32561e3ea49df34308d26d559c9@changeid> Mime-Version: 1.0 X-Mailer: git-send-email 2.33.0.685.g46640cef36-goog Subject: [PATCH v1] Bluetooth: Fix wrong opcode when LL privacy enabled From: Howard Chung To: linux-bluetooth@vger.kernel.org Cc: Yun-Hao Chung , "David S. Miller" , Jakub Kicinski , Johan Hedberg , Luiz Augusto von Dentz , Marcel Holtmann , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yun-Hao Chung The returned opcode of command status of remove_adv is wrong when LL privacy is enabled. Signed-off-by: Yun-Hao Chung --- Test with following steps: 1. btmgmt --index 0 2. [btmgmt] power off; [btmgmt] exp-privacy on; [btmgmt] power on 3. [btmgmt] rm-adv 1 4. Check if the 'Not supported' message is present in terminal net/bluetooth/mgmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index cea01e275f1ea..87acf0d783a07 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -8222,7 +8222,7 @@ static int remove_advertising(struct sock *sk, struct hci_dev *hdev, * advertising. */ if (hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY)) - return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_ADVERTISING, + return mgmt_cmd_status(sk, hdev->id, MGMT_OP_REMOVE_ADVERTISING, MGMT_STATUS_NOT_SUPPORTED); hci_dev_lock(hdev); -- 2.33.0.685.g46640cef36-goog