diff options
author | Nikias Bassen | 2024-03-26 22:31:43 +0100 |
---|---|---|
committer | Nikias Bassen | 2024-03-26 22:31:43 +0100 |
commit | 303ece5fa462713552e0013b48b66a08955a12d4 (patch) | |
tree | 047efc46e5da9975873d268115db0f564e9f3123 /tools | |
parent | a435ebf661dfe76347e034f0e2e69a5168492384 (diff) | |
download | libusbmuxd-303ece5fa462713552e0013b48b66a08955a12d4.tar.gz libusbmuxd-303ece5fa462713552e0013b48b66a08955a12d4.tar.bz2 |
iproxy: Use updated socket_create API to listen on IPv4 and IPv6 with a single socket
Diffstat (limited to 'tools')
-rw-r--r-- | tools/iproxy.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/tools/iproxy.c b/tools/iproxy.c index 6b8a345..1bb9e77 100644 --- a/tools/iproxy.c +++ b/tools/iproxy.c @@ -377,7 +377,7 @@ int main(int argc, char **argv) for (i = 0; i < num_pairs; i++) { printf("Creating listening port %d for device port %d\n", listen_port[i], device_port[i]); if (!source_addr) { - listen_sock[num_listen].fd = socket_create("127.0.0.1", listen_port[i]); + listen_sock[num_listen].fd = socket_create(NULL, listen_port[i]); if (listen_sock[num_listen].fd < 0) { int j; fprintf(stderr, "Error creating socket for listen port %u: %s\n", listen_port[i], strerror(errno)); @@ -390,21 +390,6 @@ int main(int argc, char **argv) } listen_sock[num_listen].index = i; num_listen++; -#if defined(AF_INET6) - listen_sock[num_listen].fd = socket_create("::1", listen_port[i]); - if (listen_sock[num_listen].fd < 0) { - int j; - fprintf(stderr, "Error creating socket for listen port %u: %s\n", listen_port[i], strerror(errno)); - free(source_addr); - free(device_udid); - for (j = num_listen; j >= 0; j--) { - socket_close(listen_sock[j].fd); - } - return -errno; - } - listen_sock[num_listen].index = i; - num_listen++; -#endif } else { listen_sock[num_listen].fd = socket_create(source_addr, listen_port[i]); if (listen_sock[num_listen].fd < 0) { |