summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2024-03-26 22:31:43 +0100
committerGravatar Nikias Bassen2024-03-26 22:31:43 +0100
commit303ece5fa462713552e0013b48b66a08955a12d4 (patch)
tree047efc46e5da9975873d268115db0f564e9f3123
parenta435ebf661dfe76347e034f0e2e69a5168492384 (diff)
downloadlibusbmuxd-303ece5fa462713552e0013b48b66a08955a12d4.tar.gz
libusbmuxd-303ece5fa462713552e0013b48b66a08955a12d4.tar.bz2
iproxy: Use updated socket_create API to listen on IPv4 and IPv6 with a single socket
-rw-r--r--configure.ac2
-rw-r--r--tools/iproxy.c17
2 files changed, 2 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac
index 36df4b4..ec2cade 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,7 @@ fi
dnl Minimum package versions
LIBPLIST_VERSION=2.2.0
-LIMD_GLUE_VERSION=1.0.0
+LIMD_GLUE_VERSION=1.2.0
AC_SUBST(LIBPLIST_VERSION)
AC_SUBST(LIMD_GLUE_VERSION)
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) {