How to handle IPv6 link-local addresses in iOS 16?

Our (legacy) code to communicate with peripherals on local IPv6 networks (LAN) adds the zone identifier / interface name ("%en0") to link-local IP addresses (FE80::/10) discovered via SSDP. SSDP is implemented using CocoaAsyncSocket - yes, that part of our code is old... (from before the introduction of the iOS 12+ Network framework). We use these modified IP addresses as the host component of a URL in a URLSession.dataTask.

To insert the zone identifier we are using URLComponents (we modify the host and then request the string). This worked fine in iOS 15 and below, but no longer works in iOS 16 (Beta 1/2/3); the host is empty after inserting %en0 in the most recent beta.

We have reported this via FB10549269, but from the answer it is unclear to me whether Apple is planning to fix this ("Resolution: Potential fix identified"), or we are doing it wrong.

How should we handle IPv6 link-local addresses in iOS 16? (when using URLSession instead of Network)

PS: We recently dropped support for iOS 12, but we still need to support iOS 13 and up

Answered by DTS Engineer in 720699022

but from the answer it is unclear to me whether Apple is planning to fix this

This is definitely our bug to fix. That status means that we know what’s gone wrong but the fix isn’t in any currently seeded release. You should be notified when that changes, that is, when the fix makes it into a seed.

How should we handle IPv6 link-local addresses in iOS 16?

Use Bonjour? (-:

Seriously though, Bonjour makes this all much better because the remote peer has a mDNS host name, and you can pass that to URL rather than monkey around with IP addresses.

But, yeah, I realise that you’re hands are tied by the accessory only supporting SSDP )-:

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

but from the answer it is unclear to me whether Apple is planning to fix this

This is definitely our bug to fix. That status means that we know what’s gone wrong but the fix isn’t in any currently seeded release. You should be notified when that changes, that is, when the fix makes it into a seed.

How should we handle IPv6 link-local addresses in iOS 16?

Use Bonjour? (-:

Seriously though, Bonjour makes this all much better because the remote peer has a mDNS host name, and you can pass that to URL rather than monkey around with IP addresses.

But, yeah, I realise that you’re hands are tied by the accessory only supporting SSDP )-:

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

@eskimo Can you expand on the following please?

Seriously though, Bonjour makes this all much better because the remote peer has a mDNS host name, and you can pass that to URL rather than monkey around with IP addresses.

How can I go from a NWBrowser.Result (or NWEndpoint) to a URL? I'm guessing it's simple/obvious, but I'm totally missing it.

My particular use case is discovering a service on my local network — which in my case is returning an IPv6 link local address — and making a HTTP GET request to it. I'm at a loss how to construct a URL to do so.

I'm totally missing it.

No, you’ve just hit a speed bump in our current Network framework story. See this post for a workaround, and the other post on that thread for more context.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

How to handle IPv6 link-local addresses in iOS 16?
 
 
Q