public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] patch for: RFComm dynamic channel allocation
@ 2004-07-08 14:52 Collin R. Mulliner
  2004-07-08 17:37 ` Marcel Holtmann
  0 siblings, 1 reply; 5+ messages in thread
From: Collin R. Mulliner @ 2004-07-08 14:52 UTC (permalink / raw)
  To: bluez-devel

[-- Attachment #1: Type: text/plain, Size: 422 bytes --]

Hi,

just found and fixed the problem with dynamic rfcomm channel allocation.
My code binds to a specific local bdaddr, the rfcomm tool binds to ANY.
This case was not handled correctly. The fix is simple, see attachment.


... Collin

-- 
Collin R. Mulliner <collin@betaversion.net>
BETAVERSiON Systems [www.betaversion.net]
info/pgp: finger collin@betaversion.net
Just don't create a file called -rf.  :-)  --Larry Wall

[-- Attachment #2: rfcomm_dynamic_channel_alloc_fix.patch --]
[-- Type: application/octet-stream, Size: 382 bytes --]

--- sock.c_orig	2004-07-08 16:39:29.000000000 +0200
+++ sock.c	2004-07-08 16:47:28.000000000 +0200
@@ -407,7 +407,7 @@
 		write_lock_bh(&rfcomm_sk_list.lock);
 
 		for (channel = 1; channel < 31; channel++)
-			if (!__rfcomm_get_sock_by_addr(channel, src)) {
+			if (!__rfcomm_get_sock_by_channel(0, channel, src)) {
 				rfcomm_pi(sk)->channel = channel;
 				err = 0;
 				break;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-devel] patch for: RFComm dynamic channel allocation
  2004-07-08 14:52 [Bluez-devel] patch for: RFComm dynamic channel allocation Collin R. Mulliner
@ 2004-07-08 17:37 ` Marcel Holtmann
  2004-07-08 18:08   ` Collin R. Mulliner
  0 siblings, 1 reply; 5+ messages in thread
From: Marcel Holtmann @ 2004-07-08 17:37 UTC (permalink / raw)
  To: Collin R. Mulliner; +Cc: BlueZ Mailing List

Hi Collin,

> just found and fixed the problem with dynamic rfcomm channel allocation.
> My code binds to a specific local bdaddr, the rfcomm tool binds to ANY.
> This case was not handled correctly. The fix is simple, see attachment.

I don't get the point of your fix, because bind() to a specific BD_ADDR
and to BDADDR_ANY are totally different and can result in different
dynamic channel allocations.

Regards

Marcel




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-devel] patch for: RFComm dynamic channel allocation
  2004-07-08 17:37 ` Marcel Holtmann
@ 2004-07-08 18:08   ` Collin R. Mulliner
  2004-07-08 18:36     ` Marcel Holtmann
  0 siblings, 1 reply; 5+ messages in thread
From: Collin R. Mulliner @ 2004-07-08 18:08 UTC (permalink / raw)
  To: bluez-devel

Hi Marcel,

> I don't get the point of your fix, because bind() to a specific
> BD_ADDR and to BDADDR_ANY are totally different and can result in
> different dynamic channel allocations.

I understand why binding to BDADDR_ANY could lead to a different
channel, e.g. when having multiple BT devices but the current code
doesn't work when binding to a specific BD_ADDR. I only talk about
dynamic rfcomm channel allocation which takes place when calling
listen()! Not about the general bind().

... Collin

-- 
Collin R. Mulliner <collin@betaversion.net>
BETAVERSiON Systems [www.betaversion.net]
info/pgp: finger collin@betaversion.net
Success is a journey, not a destination. So stop running.


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-devel] patch for: RFComm dynamic channel allocation
  2004-07-08 18:08   ` Collin R. Mulliner
@ 2004-07-08 18:36     ` Marcel Holtmann
       [not found]       ` <20040709012301.5a966440@coredump>
  0 siblings, 1 reply; 5+ messages in thread
From: Marcel Holtmann @ 2004-07-08 18:36 UTC (permalink / raw)
  To: Collin R. Mulliner; +Cc: BlueZ Mailing List

Hi Collin,

> > I don't get the point of your fix, because bind() to a specific
> > BD_ADDR and to BDADDR_ANY are totally different and can result in
> > different dynamic channel allocations.
> 
> I understand why binding to BDADDR_ANY could lead to a different
> channel, e.g. when having multiple BT devices but the current code
> doesn't work when binding to a specific BD_ADDR. I only talk about
> dynamic rfcomm channel allocation which takes place when calling
> listen()! Not about the general bind().

the code works, because the scope of a specific BD_ADDR is different
from BDADDR_ANY and both start with channel 1. I am not going to mix
them two in the kernel, because this is an application specific problem
you are trying to solve.

Regards

Marcel




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-devel] patch for: RFComm dynamic channel allocation
       [not found]       ` <20040709012301.5a966440@coredump>
@ 2004-07-09 10:15         ` Marcel Holtmann
  0 siblings, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2004-07-09 10:15 UTC (permalink / raw)
  To: Collin R. Mulliner; +Cc: BlueZ Mailing List

Hi Collin,

> what happens if one program binds to BDADDR_ANY channel 1 and a second
> program binds to SPECIFIC_BDADDR channel 1 (thru dynamic channel
> allocation). Which program gets the incoming connection to channel one
> (with just one BT device).

try this out, but the program that listens on the specific BD_ADDR
should get the incoming connection.

Regards

Marcel




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-07-09 10:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-08 14:52 [Bluez-devel] patch for: RFComm dynamic channel allocation Collin R. Mulliner
2004-07-08 17:37 ` Marcel Holtmann
2004-07-08 18:08   ` Collin R. Mulliner
2004-07-08 18:36     ` Marcel Holtmann
     [not found]       ` <20040709012301.5a966440@coredump>
2004-07-09 10:15         ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox