Development discussion of WireGuard
 help / color / mirror / Atom feed
* Wireguard iOS crashes after upgrading to XCode 14
@ 2022-09-13 12:41 Houman
  2022-09-22  8:31 ` Andrej Mihajlov
  0 siblings, 1 reply; 9+ messages in thread
From: Houman @ 2022-09-13 12:41 UTC (permalink / raw)
  To: WireGuard mailing list

My existing Wireguard iOS implementation stopped working after
upgrading to Xcode 14 today.
When trying to connect to servers that support only IPv4, then it's
fine. But if the server supports both IPv6 and IPv4 then the tunnel
crashes:

This IPv6 extension in
wireguard-apple/Sources/WireGuardKit/IPAddress+AddrInfo.swift crashes
with a Fatal Error at addrInfo.ai_addr.withMemoryRebound()

The whole extension below:

extension IPv6Address {
    init?(addrInfo: addrinfo) {
        guard addrInfo.ai_family == AF_INET6 else { return nil }

        let addressData = addrInfo.ai_addr.withMemoryRebound(to:
sockaddr_in6.self, capacity: MemoryLayout<sockaddr_in6>.size) { ptr ->
Data in
            return Data(bytes: &ptr.pointee.sin6_addr, count:
MemoryLayout<in6_addr>.size)
        }
        self.init(addressData)
    }
}

Has anyone else experienced this problem?

Thanks,

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-12-05 17:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-13 12:41 Wireguard iOS crashes after upgrading to XCode 14 Houman
2022-09-22  8:31 ` Andrej Mihajlov
2022-09-22  8:56   ` Houman
2022-09-22  9:38     ` Jason A. Donenfeld
2022-09-22  9:39       ` Houman
2022-12-05 17:15       ` Houman
2022-12-05 17:40         ` Jason A. Donenfeld
2022-09-22  9:44     ` Andrej Mihajlov
2022-09-22  9:46       ` Houman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).