* [Bluez-devel] [PATCH] Deleted acl-handles on failed hci_create_connection
@ 2004-06-10 18:35 Andreas Gaufer
2004-06-10 18:53 ` Marcel Holtmann
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Gaufer @ 2004-06-10 18:35 UTC (permalink / raw)
To: Bluez Devel
[-- Attachment #1: Type: text/plain, Size: 569 bytes --]
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
[-- Attachment #2: patch-2.4.26-ag1.gz --]
[-- Type: application/octet-stream, Size: 388 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Bluez-devel] [PATCH] Deleted acl-handles on failed hci_create_connection
2004-06-10 18:35 [Bluez-devel] [PATCH] Deleted acl-handles on failed hci_create_connection Andreas Gaufer
@ 2004-06-10 18:53 ` Marcel Holtmann
2004-06-10 20:29 ` Andreas Gaufer
0 siblings, 1 reply; 3+ messages in thread
From: Marcel Holtmann @ 2004-06-10 18:53 UTC (permalink / raw)
To: Andreas Gaufer; +Cc: Bluez Devel
[-- Attachment #1: Type: text/plain, Size: 785 bytes --]
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
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 411 bytes --]
===== net/bluetooth/hci_event.c 1.13 vs edited =====
--- 1.13/net/bluetooth/hci_event.c 2004-05-31 22:15:12 +02:00
+++ edited/net/bluetooth/hci_event.c 2004-06-10 20:48:55 +02:00
@@ -358,7 +358,7 @@
status, batostr(&cp->bdaddr), conn);
if (status) {
- if (conn) {
+ if (conn && conn->state == BT_CONNECT) {
conn->state = BT_CLOSED;
hci_proto_connect_cfm(conn, status);
hci_conn_del(conn);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Bluez-devel] [PATCH] Deleted acl-handles on failed hci_create_connection
2004-06-10 18:53 ` Marcel Holtmann
@ 2004-06-10 20:29 ` Andreas Gaufer
0 siblings, 0 replies; 3+ messages in thread
From: Andreas Gaufer @ 2004-06-10 20:29 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: andreas.gaufer, bluez-devel
[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]
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 <marcel@holtmann.org> 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
>
>
[-- Attachment #2: patch-2.4.26 --]
[-- Type: application/octet-stream, Size: 504 bytes --]
diff --unified --recursive -I /rootgauf/ --new-file linux-2.4.26/net/bluetooth/hci_event.c linux-2.4.26-mh/net/bluetooth/hci_event.c
--- linux-2.4.26/net/bluetooth/hci_event.c Wed Feb 18 14:36:32 2004
+++ linux-2.4.26-mh/net/bluetooth/hci_event.c Thu Jun 10 22:13:07 2004
@@ -320,7 +320,7 @@
status, batostr(&cc->bdaddr), conn);
if (status) {
- if (conn) {
+ if (conn && conn->state == BT_CONNECT) {
conn->state = BT_CLOSED;
hci_proto_connect_cfm(conn, status);
hci_conn_del(conn);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-06-10 20:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-10 18:35 [Bluez-devel] [PATCH] Deleted acl-handles on failed hci_create_connection Andreas Gaufer
2004-06-10 18:53 ` Marcel Holtmann
2004-06-10 20:29 ` Andreas Gaufer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox