From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 944D7C43461 for ; Thu, 10 Sep 2020 08:33:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4001F2076C for ; Thu, 10 Sep 2020 08:33:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599726835; bh=+uYj31dIE6aLQLGtOUfoRlwyftNHQyhq7bqNm1EFOzs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=lWPFdGrg2ztWMN9kyHSQfm1Z0w8znvbkmN/sD64QGJzqYCqVPLf76nlx3qxEPifxn Mpj1ur+E/41NhTPQKm+JCRufhafVFksPv/tMsBAzpblL8da6QiLwBiApUqZANWCnyw MEEKbU3ZsC+p48rSLua1L/oHbEssl2YoXhtChyyQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730578AbgIJIds (ORCPT ); Thu, 10 Sep 2020 04:33:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:46546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730273AbgIJIUf (ORCPT ); Thu, 10 Sep 2020 04:20:35 -0400 Received: from pali.im (pali.im [31.31.79.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9878720732; Thu, 10 Sep 2020 08:20:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599726002; bh=+uYj31dIE6aLQLGtOUfoRlwyftNHQyhq7bqNm1EFOzs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kMedj2nqh7AnwsubKUx2cDGygfPeMZ/DC22/dIFpecBdxjizUINcIlzCJEoaIbbIN UWw0szHE23w4EXoWTQS5bdHpXZJn+r4Qn69vCnYUsWm6z4fAaxGT/Xg3uOtH4R0Mwv MHIGn/OTGcDdKwWYo8ufZTdtJgupVMoBGdzsB9ys= Received: by pali.im (Postfix) id 736C6582; Thu, 10 Sep 2020 10:20:00 +0200 (CEST) Date: Thu, 10 Sep 2020 10:20:00 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Joseph Hwang Cc: linux-bluetooth@vger.kernel.org, marcel@holtmann.org, luiz.dentz@gmail.com, chromeos-bluetooth-upstreaming@chromium.org, josephsih@google.com, Alain Michaud , Abhishek Pandit-Subedi , "David S. Miller" , Jakub Kicinski , Johan Hedberg , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v3 2/2] Bluetooth: sco: new getsockopt options BT_SNDMTU/BT_RCVMTU Message-ID: <20200910082000.aiw74ll3z776yqgh@pali> References: <20200910060403.144524-1-josephsih@chromium.org> <20200910140342.v3.2.I03247d3813c6dcbcdbeab26d068f9fd765edb1f5@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200910140342.v3.2.I03247d3813c6dcbcdbeab26d068f9fd765edb1f5@changeid> User-Agent: NeoMutt/20180716 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thursday 10 September 2020 14:04:02 Joseph Hwang wrote: > This patch defines new getsockopt options BT_SNDMTU/BT_RCVMTU > for SCO socket to be compatible with other bluetooth sockets. > These new options return the same value as option SCO_OPTIONS > which is already present on existing kernels. > > Reviewed-by: Alain Michaud > Reviewed-by: Abhishek Pandit-Subedi > Signed-off-by: Joseph Hwang Looks good, Reviewed-by: Pali Rohár > --- > > Changes in v3: > - Fixed the commit message. > > Changes in v2: > - Used BT_SNDMTU/BT_RCVMTU instead of creating a new opt name. > - Used the existing conn->mtu instead of creating a new member > in struct sco_pinfo. > - Noted that the old SCO_OPTIONS in sco_sock_getsockopt_old() > would just work as it uses sco_pi(sk)->conn->mtu. > > net/bluetooth/sco.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c > index dcf7f96ff417e6..79ffcdef0b7ad5 100644 > --- a/net/bluetooth/sco.c > +++ b/net/bluetooth/sco.c > @@ -1001,6 +1001,12 @@ static int sco_sock_getsockopt(struct socket *sock, int level, int optname, > err = -EFAULT; > break; > > + case BT_SNDMTU: > + case BT_RCVMTU: > + if (put_user(sco_pi(sk)->conn->mtu, (u32 __user *)optval)) > + err = -EFAULT; > + break; > + > default: > err = -ENOPROTOOPT; > break; > -- > 2.28.0.618.gf4bc123cb7-goog >