huberf / pybluez

Automatically exported from code.google.com/p/pybluez
0 stars 0 forks source link

_get_available_port() should try to bind() with a supplied address instead of "" #45

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Call bind("addr", 0)
2. bind() calls _get_available_port(RFCOMM) to obtain a valid port
3. _get_available_port() tries to bind() with "" instead of "addr" so may 
return a port which is not available on "addr"
4. bind("addr", _get_available_port()) will throw out an "address already in 
use" error.

What is the expected output? What do you see instead?
_get_available_port() should return an available port on a specified bdaddr, if 
one is given to bind().

What version of the product are you using? On what operating system?
Debian 6.0

Original issue reported on code.google.com by andrefcruz on 11 Jun 2011 at 11:16

GoogleCodeExporter commented 8 years ago
Patch attached.

Original comment by andrefcruz on 11 Jun 2011 at 11:54

Attachments: