From 0d800465dafba89352f4acefd24515461b041a64 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 6 Jun 2020 19:14:41 +0200 Subject: 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. --- src/idevice.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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; -- cgit v1.1-32-gdbae