Comments (3)
Ok I know how to fix this, but I am not sure if this is the best way to do it. In https://github.com/libimobiledevice/libimobiledevice-glue/blob/fde8946a3988790fd5d3f01fc0a1fd43609ab1d1/src/socket.c#L517
I am setting IPV6_V6ONLY
to 1. Setting this to NO would end up creating a single socket that would also be reachable with IPv4.
I tried this:
diff --git a/src/socket.c b/src/socket.c
index d4dedd1..3375e5b 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -463,6 +463,7 @@ int socket_create(const char* addr, uint16_t port)
{
int sfd = -1;
int yes = 1;
+ int no = 0;
struct addrinfo hints;
struct addrinfo *result, *rp;
char portstr[8];
@@ -514,7 +515,7 @@ int socket_create(const char* addr, uint16_t port)
#if defined(AF_INET6) && defined(IPV6_V6ONLY)
if (rp->ai_family == AF_INET6) {
- if (setsockopt(sfd, IPPROTO_IPV6, IPV6_V6ONLY, (void*)&yes, sizeof(int)) == -1) {
+ if (setsockopt(sfd, IPPROTO_IPV6, IPV6_V6ONLY, (addr) ? (void*)&yes : (void*)&no, sizeof(int)) == -1) {
perror("setsockopt() IPV6_V6ONLY");
}
}
And it will make it work. It would set IPV6_V6ONLY
to 0 only if addr
is NULL but 1 in any other case. Not sure if it would be needed in any other case?
from libusbmuxd.
Oh... the reason for the changes was this: libimobiledevice/libimobiledevice-glue#40
I guess I misunderstood (and subsequently failed to properly test) what NULL would mean for getaddrinfo, and assumed we'd get a single socket capable of listening to both IPv4 and IPv6, but I was wrong apparently... Now the break obviously prevents creating further sockets, and that makes perfect sense, since the function create_socket
returns a single socket and I don't see a way to change it. However, I can just change the code in iproxy to the old behavior, creating two listening sockets.
from libusbmuxd.
That looks great 💯
from libusbmuxd.
Related Issues (20)
- Compile fail if older version installed HOT 1
- Create new release
- compile on MacOs with Xcode But error:#error No reference implementation for getifaddrs available for this platform.
- I believe a new version is needed or a dependency needs to be changed
- make failed for not found for architecture arm64 HOT 2
- usbmuxd_events_unsubscribe is blocked about 2~3 secs HOT 1
- iproxy erroring with RESULT_CONNREFUSED HOT 1
- recv failed: Resource temporarily unavailable
- Syntax error from ./autogen.sh HOT 1
- Connect just one iOS device.
- libusbmuxd and libimobiledevice-glue built for Windows can lockup on a disconnect HOT 2
- Typo in iproxy.c printf (`connecion` -> `connection`) HOT 1
- Inconsistency between libusbmuxd and libimobiledevice in network structure parsing
- waking up process all the time
- Remove, Reset iProxy Ports HOT 1
- Soname
- usbmuxd_send is broken HOT 1
- Fails to build with libplist 2.5.0 HOT 2
- Error connecting to device: Success HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libusbmuxd.