Linux bluetooth development
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 3/6] profiles/network: Use send ctrl rsp to unknown BNEP ctrl cmd
Date: Thu, 26 Feb 2015 10:37:22 +0100	[thread overview]
Message-ID: <2722972.0T73ov4ygU@uw000953> (raw)
In-Reply-To: <1424355399-10015-3-git-send-email-grzegorz.kolodziejczyk@tieto.com>

Hi Grzegorz,

On Thursday 19 of February 2015 15:16:36 Grzegorz Kolodziejczyk wrote:
> Use dedicated control response function instead of assembling and
> sending raw packet over socket.
> ---
>  profiles/network/server.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/profiles/network/server.c b/profiles/network/server.c
> index ebbe056..37bfba4 100644
> --- a/profiles/network/server.c
> +++ b/profiles/network/server.c
> @@ -307,14 +307,10 @@ static gboolean bnep_setup(GIOChannel *chan,
>  	/* Highest known Control command ID
>  	 * is BNEP_FILTER_MULT_ADDR_RSP = 0x06 */
>  	if (req->type == BNEP_CONTROL &&
> -				req->ctrl > BNEP_FILTER_MULT_ADDR_RSP) {
> -		uint8_t pkt[3];
> -
> -		pkt[0] = BNEP_CONTROL;
> -		pkt[1] = BNEP_CMD_NOT_UNDERSTOOD;
> -		pkt[2] = req->ctrl;
> -
> -		send(sk, pkt, sizeof(pkt), 0);
> +					req->ctrl > BNEP_FILTER_MULT_ADDR_RSP) {
> +		error("cmd not understood");
> +		bnep_send_ctrl_rsp(sk, BNEP_CONTROL, BNEP_CMD_NOT_UNDERSTOOD,
> +								req->ctrl);
>  
>  		return FALSE;
>  	}

As discussed offline, this is not correct since we need to handle
BNEP_CMD_NOT_UNDERSTOOD special case in bnep_send_ctrl_rsp.
 

-- 
Best regards, 
Szymon Janc

  reply	other threads:[~2015-02-26  9:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-19 14:16 [PATCH 1/6] profiles/network: Minor style fix Grzegorz Kolodziejczyk
2015-02-19 14:16 ` [PATCH 2/6] android/pan: Return correct error value Grzegorz Kolodziejczyk
2015-02-26  9:31   ` Szymon Janc
2015-02-19 14:16 ` [PATCH 3/6] profiles/network: Use send ctrl rsp to unknown BNEP ctrl cmd Grzegorz Kolodziejczyk
2015-02-26  9:37   ` Szymon Janc [this message]
2015-02-26  9:39     ` Grzegorz Kolodziejczyk
2015-02-19 14:16 ` [PATCH 4/6] profiles/network: Integrate get and check bnep setup services roles Grzegorz Kolodziejczyk
2015-02-19 14:16 ` [PATCH 5/6] profiles/network: Move bnep connection setup logic to bnep Grzegorz Kolodziejczyk
2015-02-19 14:16 ` [PATCH 6/6] profiles/network: Handle ctrl rsp after conn setup by bnep Grzegorz Kolodziejczyk
2015-02-26  9:32 ` [PATCH 1/6] profiles/network: Minor style fix Szymon Janc

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=2722972.0T73ov4ygU@uw000953 \
    --to=szymon.janc@tieto.com \
    --cc=grzegorz.kolodziejczyk@tieto.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