diff options
author | Pavlin Radoslavov <pavlin@google.com> | 2015-09-24 13:34:35 -0700 |
---|---|---|
committer | Pavlin Radoslavov <pavlin@google.com> | 2015-09-25 00:17:42 +0000 |
commit | 4cac544da367d7458129631ddef6db4e3312cef7 (patch) | |
tree | 93e9711af24d149d576975ff32d3987fb369e391 /hci/src/hci_inject.c | |
parent | bb2a4faddd9a7f03d13d37a23eb0da1ef52f9088 (diff) | |
download | android_system_bt-4cac544da367d7458129631ddef6db4e3312cef7.tar.gz android_system_bt-4cac544da367d7458129631ddef6db4e3312cef7.tar.bz2 android_system_bt-4cac544da367d7458129631ddef6db4e3312cef7.zip |
Disable opening network debug ports for security reasons
By default, we open up to three TCP ports that are used
for debugging purpose:
* TCP port 8872 - used for forwarding btsnoop logs at real time
Note: the port is open only if "Bluetooth HCI snoop log" is enabled
in the Developer options
* TCP port 8873 - used for HCI debugging
* TCP port 8879 - used for debugging the Bluetooth counters
Those ports are disabled by default.
To enable, the following #define should be added at the top of the
corresponding file(s): btcore/src/counter.c hci/src/btsnoop_net.c
hci/src/hci_inject.c
#define BT_NET_DEBUG TRUE
Bug: 24371736
Change-Id: I5cb43af1a5d29c331eb5ef61a24dccbe95df6f40
Diffstat (limited to 'hci/src/hci_inject.c')
-rw-r--r-- | hci/src/hci_inject.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hci/src/hci_inject.c b/hci/src/hci_inject.c index a17a3d3b7..8ba5f989a 100644 --- a/hci/src/hci_inject.c +++ b/hci/src/hci_inject.c @@ -61,6 +61,10 @@ static void read_ready(socket_t *socket, void *context); static void client_free(void *ptr); bool hci_inject_open(const hci_t *hci_interface) { +#if (!defined(BT_NET_DEBUG) || (BT_NET_DEBUG != TRUE)) + return true; // Disable using network sockets for security reasons +#endif + assert(listen_socket == NULL); assert(thread == NULL); assert(clients == NULL); @@ -92,6 +96,10 @@ error:; } void hci_inject_close(void) { +#if (!defined(BT_NET_DEBUG) || (BT_NET_DEBUG != TRUE)) + return; // Disable using network sockets for security reasons +#endif + socket_free(listen_socket); list_free(clients); thread_free(thread); |