linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Hendrik Sattler <post@hendrik-sattler.de>
Cc: Jaganath Kanakkassery <jaganath.k@samsung.com>,
	linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH obexd 2/2] gobex: Fix ABORT request not processing
Date: Fri, 13 Jan 2012 13:21:11 +0200	[thread overview]
Message-ID: <20120113112111.GA5880@x220> (raw)
In-Reply-To: <8d043367426e37a570df29ff2f4b298b@mail.hendrik-sattler.de>

Hi Hendrik,

On Fri, Jan 13, 2012, Hendrik Sattler wrote:
>>>> 		opcode = obex->rx_last_op;
>>>> 		/* Unexpected response -- fail silently */
>>>>-		if (opcode > 0x1f && opcode < 0xff) {
>>>>+		if (opcode > G_OBEX_OP_ABORT && opcode < 0xff) {
>>>> 			obex->rx_data = 0;
>>>> 			return TRUE;
>>>> 		}
>>>
>>>This one always evaluates to false because 0xff == G_OBEX_OP_ABORT |
>>>FINAL_BIT.
>>
>> The value of obex->rx_last_op is stored with the final bit cleared,
>> so the < 0xff part could also be removed from the test. The value
>> 0x1f has been picked because the IrDA OBEX specification defines 0x10
>> - 0x1f as a user-definable range, so anything between 0x1f and 0x7f
>> isn't actually valid. The correct test would then become:
>>
>>	if (opcode > 0x1f && opcode != G_OBEX_OP_ABORT)
>>
>> Jaganath, with the above change the patch should be ok, but the more
>> surprising thing to me here is that this implies we're missing one or
>> more unit tests for Abort. Could you create a patch to add those too?
>> (if we're really strict those tests should go in before this patch so
>> that it's actually possible to see that the patch makes a
>> difference).
> 
> User-definable does not mean invalid. It only means that these can be
> used for custom commands. These are still bound to the rules of the
> OBEX protocol. I've never seen one using that, though.

Exactly. You might want to re-read what I said and the test I proposed.

> Else you'd also have to filter 0x04 and the range 0x08-0x0f because
> these are marked as "reserved".

With the test I proposed we filter neither reserved (since they might
get meaning in new spec versions) nor user-defined opcodes.

Johan

  reply	other threads:[~2012-01-13 11:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13  9:56 [PATCH obexd 2/2] gobex: Fix ABORT request not processing Jaganath Kanakkassery
2012-01-13 10:29 ` Hendrik Sattler
2012-01-13 10:54   ` Johan Hedberg
2012-01-13 11:07     ` Hendrik Sattler
2012-01-13 11:21       ` Johan Hedberg [this message]
2012-01-13 12:27         ` Hendrik Sattler
2012-01-13 13:01           ` Johan Hedberg
2012-01-13 13:36             ` Hendrik Sattler

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=20120113112111.GA5880@x220 \
    --to=johan.hedberg@gmail.com \
    --cc=jaganath.k@samsung.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=post@hendrik-sattler.de \
    /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;
as well as URLs for NNTP newsgroup(s).