Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp907561pxk; Thu, 10 Sep 2020 01:34:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6ej9upkxU5AQw8+/Z3JbFL+j1sidwImItKiwF6ISfsCrt/lCZo+AHY8D++nhxBwknwnZx X-Received: by 2002:aa7:d7ca:: with SMTP id e10mr7834805eds.191.1599726898806; Thu, 10 Sep 2020 01:34:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599726898; cv=none; d=google.com; s=arc-20160816; b=hWJgvm2x87bGjTXaftPoi52prlBatIWBO9EiXSP4K5hjDMeBILkNmFsMQZoz2ZL6SK p16xlvY644AatGFQ6K7MB2UC+X3c1hvHRAliauwDv546RnMIZSaXkNxHgJ+HekwG+oMO sAxCHv3uzgctycoA6wGyVObwgHMcb6QO36GgjwlVRhY+UpCKTKrB2ko38ro2jYQf7Oia Q3S6KCgkLA+QRJ/WDRcX5ryJUPVpSkotajYnsyEPo/0lkmeIyhGVVIKY2x/meHiYsaIg 42+K3AgDRshr9tOv8zakMNkrPh+WoKwgkwXbrCADcCUz9ya/Z/bkUtW+ih6W5Bnr1Nn6 7PmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ekBGjmQ4KfHrvOG4cigb9GiCP/C2jvwCp4+Kz+u1kPM=; b=MHUlIvYtdyn/0Wput4aW6aMFSFh8hNzcxBQZ5kT5zp++xSoJDGShLntLP9refj/8YM XYzo3aoc7xWE5aERUYQHNAPNRwsAeuD1T5L/uYc4sWlSpPNifpVHpWO3gfY6hvsJISOV bQQxQPdg2G7hDdvAyc3iugMFsIz9Vo+1JFPtlvtyRAUsaVVp2WtQXQeRG/M6dJuS8FYq Kand1P7LX/uNc3fLriNSSC1lW+seEki0FgdUFpNrQjVqpyZ7CxjgEymcdrMInQiJCDWJ 5lG3qLuKeoFbRQlF3VyDPwApckCMnGJWki6ZZugCfPRvKv/GV9nPNxNOkpbVeNxFFvks MMzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kMedj2nq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si3317036ejm.633.2020.09.10.01.34.17; Thu, 10 Sep 2020 01:34:58 -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; dkim=pass header.i=@kernel.org header.s=default header.b=kMedj2nq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730170AbgIJIdp (ORCPT + 99 others); Thu, 10 Sep 2020 04:33:45 -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: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@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 >