2004-06-10 18:35:55

by Andreas Gaufer

[permalink] [raw]
Subject: [Bluez-devel] [PATCH] Deleted acl-handles on failed hci_create_connection

Hi,

Heres a patch for hci_event.c to fix the problem that acl-handles are removed
from the kernels connection hash when a hci_create_connection returnes a
command status thats not 0x00.

One of the problems that was caused by this bug was that cc could be issued
even if the peer was already connected. This case leads to the error message
"Too many links" with sdptool and rfcomm for example. This connection could
only be removed if the acl handle was known otherwise or by removing power
from the usb-dongle (unplugg).

Have Fun!

Greetings

Andreas Gaufer



Attachments:
patch-2.4.26-ag1.gz (388.00 B)

2004-06-10 18:53:02

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] Deleted acl-handles on failed hci_create_connection

Hi Andreas,

> Heres a patch for hci_event.c to fix the problem that acl-handles are removed
> from the kernels connection hash when a hci_create_connection returnes a
> command status thats not 0x00.
>
> One of the problems that was caused by this bug was that cc could be issued
> even if the peer was already connected. This case leads to the error message
> "Too many links" with sdptool and rfcomm for example. This connection could
> only be removed if the acl handle was known otherwise or by removing power
> from the usb-dongle (unplugg).

I think your patch is wrong, because in case of the first try through
L2CAP etc. a negative return value must result in a drop of the hci_conn
structure. Check if the attached patch is also working (againt 2.6).

Regards

Marcel


Attachments:
patch (411.00 B)

2004-06-10 20:29:14

by Andreas Gaufer

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] Deleted acl-handles on failed hci_create_connection

Hi Marcel,

Your right (like always ;). I assumed that in case af a negative return in
first try there is no entry created but that was wrong.

Your change works for me, a patch for 2.4.26 is attached

Greetings & Regards

Andreas Gaufer



On Thu, 10 Jun 2004 20:53:02 +0200
Marcel Holtmann <[email protected]> wrote:

> Hi Andreas,
>
> > Heres a patch for hci_event.c to fix the problem that acl-handles are removed
> > from the kernels connection hash when a hci_create_connection returnes a
> > command status thats not 0x00.
> >
> > One of the problems that was caused by this bug was that cc could be issued
> > even if the peer was already connected. This case leads to the error message
> > "Too many links" with sdptool and rfcomm for example. This connection could
> > only be removed if the acl handle was known otherwise or by removing power
> > from the usb-dongle (unplugg).
>
> I think your patch is wrong, because in case of the first try through
> L2CAP etc. a negative return value must result in a drop of the hci_conn
> structure. Check if the attached patch is also working (againt 2.6).
>
> Regards
>
> Marcel
>
>


Attachments:
patch-2.4.26 (504.00 B)