net: change address for finding base port 57/150357/1
authorMunkyu Im <munkyu.im@samsung.com>
Fri, 15 Sep 2017 07:27:40 +0000 (16:27 +0900)
committerMunkyu Im <munkyu.im@samsung.com>
Fri, 15 Sep 2017 08:24:00 +0000 (17:24 +0900)
The latest version of emulator uses INADDR_ANY address
instead of INADDR_LOOPBACK to find base port.
Thereforei, if not correct this,
different emulators can set the same base port.
It causes sdb connection failure.
Also, remove unused function.

Change-Id: Ib799578e8c34ec13aa3d33f9b78756b729b84002
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
(cherry picked from commit ddfea1719b3f06559e2e653ba94062586a7118a5)

tizen/src/util/sdb.c
tizen/src/util/sdb.h

index 7ba0d14cfab17bddfea2b9527905bf90ed6d4454..c76d4fd536c6f2cddb9db97a6418e65c972baecf 100644 (file)
@@ -121,7 +121,7 @@ int check_port_bind_listen(uint32_t port)
     memset(&addr, 0, addrlen);
 
     addr.sin_family = AF_INET;
-    addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+    addr.sin_addr.s_addr = htonl(INADDR_ANY);
     addr.sin_port = htons(port);
 
     s = qemu_socket(AF_INET, SOCK_STREAM, 0);
index 98ec33d3b5a1597bbcfce8920bbdb5caebc71023..7be0ee3914dbdead35d308183ac35d2756c2cf67 100644 (file)
@@ -58,7 +58,6 @@ int inet_strtoip(const char*  str, uint32_t  *ip);
 int socket_send(int fd, const void*  buf, int  buflen);
 void socket_close(int fd);
 int check_port_bind_listen(uint32_t port);
-int sdb_loopback_client(int port, int type);
 
 void start_sdb_noti_server(int server_port);