summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMunkyu Im <munkyu.im@samsung.com>2017-09-15 16:27:40 +0900
committerMunkyu Im <munkyu.im@samsung.com>2017-09-15 17:20:44 +0900
commitddfea1719b3f06559e2e653ba94062586a7118a5 (patch)
tree2e629b23ac02447a8d76ad461e9ac8a70c5a5156
parentbccd1079eb9224d594e4bf7bb0d61dfac7c33246 (diff)
downloadqemu-ddfea1719b3f06559e2e653ba94062586a7118a5.tar.gz
qemu-ddfea1719b3f06559e2e653ba94062586a7118a5.tar.bz2
qemu-ddfea1719b3f06559e2e653ba94062586a7118a5.zip
net: change address for finding base port
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>
-rw-r--r--tizen/src/util/sdb.c23
-rw-r--r--tizen/src/util/sdb.h1
2 files changed, 1 insertions, 23 deletions
diff --git a/tizen/src/util/sdb.c b/tizen/src/util/sdb.c
index 35db58b97d..9dbc775973 100644
--- a/tizen/src/util/sdb.c
+++ b/tizen/src/util/sdb.c
@@ -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);
@@ -221,27 +221,6 @@ void sdb_setup(void)
INFO( "Port(%d/tcp) listen for SDB\n", number);
}
-int sdb_loopback_client(int port, int type)
-{
- struct sockaddr_in addr;
- int s;
-
- memset(&addr, 0, sizeof(addr));
- addr.sin_family = AF_INET;
- addr.sin_port = htons(port);
- addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
-
- s = socket(AF_INET, type, 0);
- if(s < 0) return -1;
-
- if(connect(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
- close(s);
- return -1;
- }
-
- return s;
-}
-
/*
* SDB Notification server
*/
diff --git a/tizen/src/util/sdb.h b/tizen/src/util/sdb.h
index 98ec33d3b5..7be0ee3914 100644
--- a/tizen/src/util/sdb.h
+++ b/tizen/src/util/sdb.h
@@ -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);