]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commit
Rework DNS and routes in network extension
authorJason A. Donenfeld <Jason@zx2c4.com>
Fri, 28 Dec 2018 18:34:31 +0000 (19:34 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 28 Dec 2018 18:38:03 +0000 (19:38 +0100)
commit0b828f9b963a6a5bb78a8d438efbd7ae8e62b534
treeff725dd9eff814336a424a739e8dc00e84f3b409
parent51a3e5c0b4150ba9ea9ccbf7112bd7a066a2dee8
Rework DNS and routes in network extension

The DNS resolver prior had useless comments, awful nesting, converted
bytes into strings and back into bytes, and generally made no sense.
That's been rewritten now.

But more fundumentally, this commit made the DNS resolver actually
accomplish its objective, by passing AI_ALL to it. It turns out, though,
that the Go library isn't actually using GAI in the way we need for
parsing IP addresses, so we actually need to do another round, this time
with hints flag as zero, so that we get the DNS64 address.

Additionally, since we're now binding sockets to interfaces, we can
entirely remove the excludedRoutes logic.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
WireGuard/WireGuardNetworkExtension/DNSResolver.swift
WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift
WireGuard/WireGuardNetworkExtension/PacketTunnelSettingsGenerator.swift