Linux bluetooth development
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: "Frédéric Dalleau" <frederic.dalleau@linux.intel.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 2/5] Bluetooth: Add setsockopt for SCO socket mode
Date: Thu, 17 Jan 2013 06:12:10 -0800	[thread overview]
Message-ID: <1358431930.3059.16.camel@aeonflux> (raw)
In-Reply-To: <1358426389-25903-3-git-send-email-frederic.dalleau@linux.intel.com>

Hi Fred,

> This patch implements setsockopt().

not acceptable commit message.

> ---
>  net/bluetooth/sco.c |   44 ++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
> 
> diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
> index bdb21b2..22ad5fa 100644
> --- a/net/bluetooth/sco.c
> +++ b/net/bluetooth/sco.c
> @@ -678,6 +678,47 @@ static int sco_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
>  	return bt_sock_recvmsg(iocb, sock, msg, len, flags);
>  }
>  
> +static int sco_sock_setsockopt_old(struct socket *sock, int optname,
> +				   char __user *optval, unsigned int optlen)
> +{
> +	struct sock *sk = sock->sk;
> +	struct sco_options opts;
> +	int len, err = 0;
> +
> +	BT_DBG("sk %p", sk);
> +
> +	lock_sock(sk);
> +
> +	switch (optname) {
> +	case SCO_OPTIONS:
> +		if (sk->sk_state != BT_OPEN &&
> +		    sk->sk_state != BT_BOUND &&
> +		    sk->sk_state != BT_CONNECT2) {
> +			err = -EINVAL;
> +			break;
> +		}
> +
> +		opts.mode = SCO_MODE_CVSD;

Don't we need to set a opts.mtu here as well? This is user input. So we
need to be 100% sure to verify it.

Regards

Marcel



  reply	other threads:[~2013-01-17 14:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-17 12:39 [PATCH 0/5] sco: SCO socket option for mode Frédéric Dalleau
2013-01-17 12:39 ` [PATCH 1/5] Bluetooth: Add option for SCO socket mode Frédéric Dalleau
2013-01-17 14:09   ` Marcel Holtmann
2013-01-17 15:36     ` Frédéric Dalleau
2013-01-17 12:39 ` [PATCH 2/5] Bluetooth: Add setsockopt " Frédéric Dalleau
2013-01-17 14:12   ` Marcel Holtmann [this message]
2013-01-17 12:39 ` [PATCH 3/5] Bluetooth: Use mode when accepting SCO connection Frédéric Dalleau
2013-01-17 14:15   ` Marcel Holtmann
2013-01-17 12:39 ` [PATCH 4/5] Bluetooth: Parameters for outgoing SCO connections Frédéric Dalleau
2013-01-17 14:17   ` Marcel Holtmann
2013-01-17 12:39 ` [PATCH 5/5] Bluetooth: Fallback transparent SCO from T2 to T1 Frédéric Dalleau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1358431930.3059.16.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=frederic.dalleau@linux.intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox