diff options
author | Matthew Jordan <mjordan@digium.com> | 2013-01-17 02:32:34 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2013-01-17 02:32:34 +0000 |
commit | ea78b7cbc8e8806f1d55ba30726a8588391ffb00 (patch) | |
tree | d29e91b9799859885c013d31606118e09ae0d7cc /addons/chan_mobile.c | |
parent | ad7353664781e4356fcbd9b5306b59f362febcb2 (diff) |
Fix issue where chan_mobile fails to bind to first available port
Per the bluez API, in order to bind to the first available port, the rc_channel
field of the socket addressing structure used to bind the socket should be set
to 0. Previously, Asterisk had set the rc_channel field set to 1, causing it
to connect to whatever happens to be on port 1.
We could probably not explicitly set rc_channel to 0 since we memset the struct
earlier, but explicitly setting it will hopefully prevent someone from coming
in and setting it to some explicit port in the future.
(closes issue ASTERISK-16357)
Reported by: challado
Tested by: Alexander Heinz, Nikolay Ilduganov, benjamin, eliafino, David van Geyn
patches:
ASTERISK-16357.diff uploaded by Nikolay Ilduganov (license 6253)
........
Merged revisions 379342 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 379343 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'addons/chan_mobile.c')
-rw-r--r-- | addons/chan_mobile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/chan_mobile.c b/addons/chan_mobile.c index 7a60a4cb6..26e4abd7d 100644 --- a/addons/chan_mobile.c +++ b/addons/chan_mobile.c @@ -1389,7 +1389,7 @@ static int rfcomm_connect(bdaddr_t src, bdaddr_t dst, int remote_channel) memset(&addr, 0, sizeof(addr)); addr.rc_family = AF_BLUETOOTH; bacpy(&addr.rc_bdaddr, &src); - addr.rc_channel = (uint8_t) 1; + addr.rc_channel = (uint8_t) 0; if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) { ast_debug(1, "bind() failed (%d).\n", errno); close(s); |