[Bluez-devel] patch for: RFComm dynamic channel allocation

Collin R. Mulliner
2004-07-08T14:52:19Z

[-- 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;