From: Stephen Crane <steve.crane@rococosoft.com>
To: bluez-devel@lists.sourceforge.net
Cc: jim.oleary@rococosoft.com, marcel@holtmann.org
Subject: Re: [Bluez-devel] Re: Small fix for L2CAP MTU
Date: Wed, 25 May 2005 16:02:39 +0100 [thread overview]
Message-ID: <1117033359.5854.62.camel@baroque.rococosoft.com> (raw)
In-Reply-To: <1117032403.30044.218.camel@pegasus>
[-- Attachment #1: Type: text/plain, Size: 1501 bytes --]
(Oops, mea culpa. diff -Naur attached.)
On Wed, 2005-05-25 at 16:46 +0200, Marcel Holtmann wrote:
> Hi Steve,
>
> > I've attached a small change to the L2CAP layer which causes it to
> > better adhere to a sender's choice of MTU.
> >
> > The background is that we have a test here where the client asks for an
> > omtu of 50 and tries to send more than this to the server, which in turn
> > checks that only 50 bytes were sent.
> >
> > With the current kernel code, the omtu is always returned as the default
> > MTU (672) which causes our test to fail.
> >
> > I've attached a patch against 2.6.11.10 (proposed by my colleague Jim
> > O'Leary) which assigns omtu from that proposed by the peer, iff we don't
> > care about the omtu.
>
> please use unified diff. I am unable to read context diffs.
>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate
> online with coworkers and clients while avoiding the high cost of travel and
> communications. There is no equipment to buy and you can meet as often as
> you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
--
Stephen Crane, Rococo Software Ltd. http://www.rococosoft.com
steve.crane@rococosoft.com +353-1-6601315 (ext 209)
[-- Attachment #2: l2cap.patch --]
[-- Type: text/x-patch, Size: 764 bytes --]
--- net/bluetooth/l2cap.c- 2005-05-25 15:35:10.000000000 +0100
+++ net/bluetooth/l2cap.c 2005-05-25 15:37:45.000000000 +0100
@@ -1356,12 +1356,13 @@
/* Configure output options and let the other side know
* which ones we don't like. */
- if (pi->conf_mtu < pi->omtu) {
- l2cap_add_conf_opt(ptr, L2CAP_CONF_MTU, 2, pi->omtu);
- result = L2CAP_CONF_UNACCEPT;
- } else {
- pi->omtu = pi->conf_mtu;
- }
+ if (pi->omtu == 0) {
+ /* If we don't care about the MTU, use peer's proposal */
+ pi->omtu = pi->conf_mtu;
+ } else if (pi->conf_mtu < pi->omtu) {
+ l2cap_add_conf_opt(ptr, L2CAP_CONF_MTU, 2, pi->omtu);
+ result = L2CAP_CONF_UNACCEPT;
+ }
BT_DBG("sk %p result %d", sk, result);
return result;
next prev parent reply other threads:[~2005-05-25 15:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-25 14:41 Small fix for L2CAP MTU Stephen Crane
2005-05-25 14:46 ` [Bluez-devel] " Marcel Holtmann
2005-05-25 15:02 ` Stephen Crane [this message]
2005-05-25 15:59 ` Marcel Holtmann
2005-05-26 10:13 ` Stephen Crane
2005-05-26 10:31 ` Marcel Holtmann
2005-05-26 10:45 ` [Bluez-devel] Output power Pieter De Mil
2005-05-26 10:48 ` Marcel Holtmann
2005-05-27 18:34 ` Pieter De Mil
2005-05-27 18:44 ` Marcel Holtmann
2005-05-26 13:55 ` [Bluez-devel] Re: Small fix for L2CAP MTU Stephen Crane
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=1117033359.5854.62.camel@baroque.rococosoft.com \
--to=steve.crane@rococosoft.com \
--cc=bluez-devel@lists.sourceforge.net \
--cc=jim.oleary@rococosoft.com \
--cc=marcel@holtmann.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