Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp440380pxj; Thu, 13 May 2021 08:23:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzD38Jbdz2IvMjEs84bPV02oqZDVSR/AzYTTrrURZHol5KyEYM82+pNC+kGTFAJU/iaKyaW X-Received: by 2002:a05:6402:3109:: with SMTP id dc9mr51530495edb.13.1620919411036; Thu, 13 May 2021 08:23:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620919411; cv=none; d=google.com; s=arc-20160816; b=udDrneEAslL00yB3k88TAwN6+OY9xK/1RKoU8D6lzrsB+0RJ5Oehbo4hRh/V/3mRpr E9o+0oDasDBMnG8ar10QvM8FBlWzqnDt19AonZI1Yf+LqQZbKkSSzjLo6MJGfEzlabyg pw6azK1PZk/qIT+NCpkJUX5GdPZM5fzRV63kGENEUUcgdCFLqEQ/42k0R+aLL71MfIWV W1Z7hDbRItZQTLSTGsBjfWqa8opjVZnD1EhigGiPRbXOeFeHNtTp9ImJbYK1cP/dGt96 OdtKf2+Cc11GKL5u/RxPPfL9uMqX2c49KldJgbvVcU8LbkBNkXBvNvCDFSEH30o6IunV 2WIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=nuKXk+AbmhTQmAK1Lb2x76oxNSGRwcJNetDyA2Iea9g=; b=bhF9smx8SlPfaoWjsRAoaro6KuNBPGIe/9f1On0/VgYfQjU4CXbhGrmnOewnTSkWM4 a933zUa0q8Osa2XggLNRnP38cVsL4x9UdxC7cipKh4xq31vSGnIxl9szOtgKh12K8zpa UR8H2eOYG02M4Ke+jjnA2A0qEaYoewn1ytWBT/sSF5IJ2EKRe21otlbKsd3OPO8LpZgj j67QH+0+qUnX+V7tL3AILeC80fhwsD6Gs2KkzXa8ra0W2wvS3Z24xVxrZ+IX5RMO7A4m yCGr7c6NjQFj8Yb92t1W8Exuv+/iVWSVwMg/CYfZST8eFkev5FBMV0l6Ung7+O8DbyaV DnVA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si3224892edc.575.2021.05.13.08.23.08; Thu, 13 May 2021 08:23:31 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232518AbhEMPWJ convert rfc822-to-8bit (ORCPT + 99 others); Thu, 13 May 2021 11:22:09 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:53762 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234847AbhEMPWB (ORCPT ); Thu, 13 May 2021 11:22:01 -0400 Received: from smtpclient.apple (p4fefc9d6.dip0.t-ipconnect.de [79.239.201.214]) by mail.holtmann.org (Postfix) with ESMTPSA id E72ABCED28; Thu, 13 May 2021 17:28:40 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.80.0.2.43\)) Subject: Re: [Bluez PATCH v2] btmgmt: Fix enable adding irk when turining privacy on From: Marcel Holtmann In-Reply-To: Date: Thu, 13 May 2021 17:20:48 +0200 Cc: Sathish Narasimman , "linux-bluetooth@vger.kernel.org" , Chethan T N , "Srivatsa, Ravishankar" Content-Transfer-Encoding: 8BIT Message-Id: <3C68E006-1F89-4E77-BF4B-4DD4B625A14F@holtmann.org> References: <20210504111454.29697-1-sathish.narasimman@intel.com> To: Luiz Augusto von Dentz X-Mailer: Apple Mail (2.3654.80.0.2.43) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Luiz, >>>> Unable to add the IRK in btmgmt when need to be updated. The option is >>>> enabled now. >>>> >>>> Signed-off-by: Sathish Narasimman >>>> --- >>>> tools/btmgmt.c | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/tools/btmgmt.c b/tools/btmgmt.c >>>> index 02fec1dca184..bf3b460d0f04 100644 >>>> --- a/tools/btmgmt.c >>>> +++ b/tools/btmgmt.c >>>> @@ -5277,7 +5277,7 @@ static const struct bt_shell_menu main_menu = { >>>> cmd_advertising, "Toggle LE advertising", }, >>>> { "bredr", "", >>>> cmd_bredr, "Toggle BR/EDR support", }, >>>> - { "privacy", "", >>>> + { "privacy", " [irk]", >>>> cmd_privacy, "Toggle privacy support" }, >>> >>> I wonder why you didn't incorporate in the first parameter though >>> given that things like privacy off [irk] makes no send, or perhaps >>> have a dedicated command for setting the irk so it would persist >>> between privacy on/off. >> >> that is not how the kernel API works. If you want to enable Privacy, you need to also provide the IRK. We just simplified the tool to use /dev/urandom in case it is not provided. > > Just to be clear I was suggesting to use a dedicated command for setting an irk: > >> irk > > That way it is persisted, that way the tool remembers what was the > last set irk in case privacy needs to be toggled for some reason. but btmgmt has no storage facility. It can’t remember its own name if its life depended on it ;) Regards Marcel