summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2020-06-06 19:14:41 +0200
committerGravatar Martin Szulecki2020-06-06 19:14:41 +0200
commit0d800465dafba89352f4acefd24515461b041a64 (patch)
tree04d97bcb53e49f4e9dac2556cdba564d92107d83
parente4fb7014c416916f0c9d4f582ccc0da4b5a55e83 (diff)
downloadlibimobiledevice-0d800465dafba89352f4acefd24515461b041a64.tar.gz
libimobiledevice-0d800465dafba89352f4acefd24515461b041a64.tar.bz2
idevice: Revert not copying scope id for IPv6 addresses from usbmuxd again
This should still catch the more common case when using usbmuxd on the same host. Not copying the scope id in that case actually removes vital routing information.
-rw-r--r--src/idevice.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/idevice.c b/src/idevice.c
index 1f8972f..a14fae1 100644
--- a/src/idevice.c
+++ b/src/idevice.c
@@ -446,8 +446,8 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_connect(idevice_t device, uint16_t
else if (((char*)device->conn_data)[1] == 0x1E) { // AF_INET6 (bsd)
#ifdef AF_INET6
saddr->sa_family = AF_INET6;
- /* copy just the address without the scope id as it might be from a different host */
- memcpy(&saddr->sa_data[0], (char*)device->conn_data + 2, 22);
+ /* copy the address and the host dependent scope id */
+ memcpy(&saddr->sa_data[0], (char*)device->conn_data + 2, 26);
#else
debug_info("ERROR: Got an IPv6 address but this system doesn't support IPv6");
return IDEVICE_E_UNKNOWN_ERROR;