diff options
author | Kenny Root <kroot@google.com> | 2012-03-28 15:45:08 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-03-28 15:45:08 -0700 |
commit | 9a77f55aada6c5a8da3d330d858bd04c1c0b6c51 (patch) | |
tree | 160c401d87400f53674eb4dbe807aca216ba6127 /adb | |
parent | dca76e6187c4128a17c8df5bcaca0db6993d91a1 (diff) | |
download | core-9a77f55aada6c5a8da3d330d858bd04c1c0b6c51.tar.gz core-9a77f55aada6c5a8da3d330d858bd04c1c0b6c51.tar.bz2 core-9a77f55aada6c5a8da3d330d858bd04c1c0b6c51.zip |
Revert "add IP checking for adb over TCP"
This reverts commit dca76e6187c4128a17c8df5bcaca0db6993d91a1
Diffstat (limited to 'adb')
-rw-r--r-- | adb/transport_local.c | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/adb/transport_local.c b/adb/transport_local.c index aeca280c2..105c502e5 100644 --- a/adb/transport_local.c +++ b/adb/transport_local.c @@ -21,7 +21,6 @@ #include "sysdeps.h" #include <sys/types.h> -#include <arpa/inet.h> #define TRACE_TAG TRACE_TRANSPORT #include "adb.h" @@ -152,36 +151,10 @@ static void *client_socket_thread(void *x) return 0; } -#if !ADB_HOST -static int is_whitelisted(struct sockaddr_in *addr) -{ - char value[PROPERTY_VALUE_MAX]; - - /* whitelist emulator */ - property_get("ro.kernel.qemu", value, ""); - if(!strcmp(value, "1")) { - return 1; - } - - /* whitelist "eng" and "tests" builds */ - property_get("ro.build.type", value, ""); - if(!strcmp(value, "eng") || !strcmp(value, "tests")) { - return 1; - } - - /* whitelist persist.service.adb.client_ip */ - property_get("persist.service.adb.client_ip", value, ""); - if(!strncmp(value, inet_ntoa(addr->sin_addr), sizeof(value))) { - return 1; - } - return 0; -} -#endif - static void *server_socket_thread(void * arg) { int serverfd, fd; - struct sockaddr_in addr; + struct sockaddr addr; socklen_t alen; int port = (int)arg; @@ -200,16 +173,9 @@ static void *server_socket_thread(void * arg) alen = sizeof(addr); D("server: trying to get new connection from %d\n", port); - fd = adb_socket_accept(serverfd, (struct sockaddr *)&addr, &alen); + fd = adb_socket_accept(serverfd, &addr, &alen); if(fd >= 0) { D("server: new connection on fd %d\n", fd); - #if !ADB_HOST - if(!is_whitelisted(&addr)) { - D("server: connection %d blacklisted and closed\n", port); - adb_close(fd); - continue; - } -#endif close_on_exec(fd); disable_tcp_nagle(fd); register_socket_transport(fd, "host", port, 1); |