Skip to content

Update libimobiledevice to fix IPv6 scope ID lookup - #1774

Draft
Minaduki-Shigure wants to merge 1 commit into
altstoreio:marketplacefrom
Minaduki-Shigure:fix/libimobiledevice-scope-id-backport
Draft

Update libimobiledevice to fix IPv6 scope ID lookup#1774
Minaduki-Shigure wants to merge 1 commit into
altstoreio:marketplacefrom
Minaduki-Shigure:fix/libimobiledevice-scope-id-backport

Conversation

@Minaduki-Shigure

Copy link
Copy Markdown

Summary

Update the pinned libimobiledevice submodule to include the IPv6 scope-ID lookup fix from rileytestut/libimobiledevice#1.

Dependency status

This PR depends on rileytestut/libimobiledevice#1 and is intentionally opened as a draft. The current gitlink points to that PR's head commit, af92832ca7bb28dc7d2b7a69367bd021ce86fbf2. It will remain a draft until this commit, or the maintainer's replacement commit, is reachable from rileytestut/libimobiledevice:master.

Problem

AltServer can fail to open Wi-Fi-connected iOS devices on Macs with multiple active IPv6 interfaces. The device may still appear in usbmuxd, and its link-local address may be directly reachable on Lockdown TCP port 62078, while AltServer pauses and ultimately produces an empty device list.

From AltStore, this can surface as a refresh failure reporting that AltStore could not connect to AltServer.

Root cause

The pinned libimobiledevice revision assumes that IPv6 interface scope IDs returned by getifaddrs() are numerically ordered. They are not required to be ordered.

When the requested scope ID appears after a larger interface index, the old lookup exits early and can apply the previous interface's scope ID to the device's link-local IPv6 address. The resulting Lockdown connection is attempted on the wrong interface.

Solution

Advance Dependencies/libimobiledevice from 9b98387dd8c78a3db388f10d0ac9bf980bbab777 to af92832ca7bb28dc7d2b7a69367bd021ce86fbf2, currently the head of rileytestut/libimobiledevice#1. If that PR is rebased or squashed, this gitlink will be updated to the resulting upstream commit before this PR is marked ready.

The dependency change removes the invalid greater-than early exits while retaining the exact scope-ID match exit. It backports libimobiledevice/libimobiledevice-glue@dd242cb.

Why update the dependency

  • The defect is in shared socket code owned by libimobiledevice.
  • Updating the submodule avoids an AltStore-only patch and keeps the dependency's source and behavior consistent.
  • The AltStore change remains a single submodule-pointer update.
  • The underlying fix is already used by the current libimobiledevice-glue implementation.

Validation

  • A deterministic regression harness reproduces both premature-exit paths on the previous pinned revision and passes on the fixed revision.
  • Passed on arm64 and x86_64, both normally and with AddressSanitizer plus UndefinedBehaviorSanitizer.
  • AltServer workspace builds passed for arm64 Debug, x86_64 Debug, and arm64 Release.
  • A fresh clone of this branch initialized Dependencies/libimobiledevice at the expected revision.
  • The locally built AltServer enumerated two physical Wi-Fi-connected iPhones.
  • A physical-device AltStore refresh completed successfully through the fixed AltServer.

Regression harness: Minaduki-Shigure/AltStore:test/libimobiledevice-scope-id-backport

Scope and risk

This PR changes only the libimobiledevice gitlink. The dependency fix is limited to IPv6 scope-ID selection for socket connections; USB, IPv4, and global IPv6 paths are unchanged.

Authorship and provenance

This pull request description and the submitted submodule integration were authored by OpenAI Codex under the direction of Minaduki Shigure. OpenAI Codex also authored the regression harness and performed the local validation.

The underlying socket fix was originally authored by Nikias Bassen in libimobiledevice-glue commit dd242cb and is being brought into the pinned dependency through rileytestut/libimobiledevice#1.

Point AltStore at the backport of libimobiledevice-glue dd242cb so IPv6 interface lookup does not assume monotonically ordered scope IDs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant