From cf4b806dff1003e56b8219367bbb29cb01c3f619 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Wed, 18 Nov 2026 00:32:05 +0100 Subject: Convert network device address in conn_data to native sockaddr layout usbmuxd reports the network address of a device as a BSD sockaddr ([sa_len][sa_family]...), even when it runs on a different OS than the client (e.g. macOS usbmuxd reached over TCP from Linux). libusbmuxd passed it through unchanged, so consumers casting conn_data to struct sockaddr (like libimobiledevice) got the wrong family on Linux and Windows. Convert the address when parsing it, so conn_data holds a native sockaddr for the platform the library runs on. On macOS nothing changes, on the other BSDs only the family value is adjusted. iproxy and inetcat now use conn_data directly and require this version of the library. The format is documented in usbmuxd.h. --- include/usbmuxd.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/usbmuxd.h') diff --git a/include/usbmuxd.h b/include/usbmuxd.h index 859fccd..8403c69 100644 --- a/include/usbmuxd.h +++ b/include/usbmuxd.h @@ -56,6 +56,9 @@ enum usbmux_connection_type { * The relevant 'handle' should be passed to 'usbmuxd_connect()', to * start a proxy connection. The value 'handle' should be considered * opaque and no presumption made about the meaning of its value. + * The conn_data member, for CONNECTION_TYPE_NETWORK devices, holds the + * device address as a native struct sockaddr (sockaddr_in or sockaddr_in6) + * of the platform the library runs on. */ typedef struct { uint32_t handle; -- cgit v1.1-32-gdbae