Commit Graph

20 Commits

Author SHA1 Message Date
Jason A. Donenfeld a266171157 PacketTunnelSettingsGenerator: use 127.0.0.1 as dummy address
It turns out that using 0.0.0.0 somehow conflicts with DNS lookups when
CLAT is in use.
2019-01-08 01:51:12 +01:00
Jason A. Donenfeld 83cc642b34 Avoid dynamic MTU calculations for now 2019-01-07 19:23:39 -05:00
Jason A. Donenfeld 7bf3d7b09d Update copyright 2019-01-07 19:23:39 -05:00
Jason A. Donenfeld 013d603109 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.
2018-12-28 19:38:03 +01:00
Jason A. Donenfeld 0cc55db4cb NetworkExtension: rescope socket instead of tearing down socket 2018-12-26 01:17:55 +01:00
Eric Kuck f39893685f Updated NETunnelProvider save format 2018-12-21 16:42:16 +01:00
Jason A. Donenfeld cab80f8fc0 NE: simplify logic 2018-12-21 15:56:03 +01:00
Roopesh Chander 939e96e5c1 NE: Update listen port only when first interface changes
When handling network path changes, change the listen port
only when the first interface has changed.
2018-12-21 17:32:44 +05:30
Eric Kuck 9c7f27f19f Enabled more swiftlint rules 2018-12-20 11:22:37 -06:00
Roopesh Chander 0a482470bb Avoid using 'VPN' in code where possible 2018-12-13 12:20:10 +05:30
Jason A. Donenfeld f8cbf0ae6d Remove useless whitespace 2018-12-13 05:26:04 +01:00
Eric Kuck 42aeb8636c More formatting nits and cyclomatic complexity fixes 2018-12-12 21:09:52 -06:00
Eric Kuck 965f66e5e2 More linter warnings fixed, enabled more swiftlint rules, project cleanup 2018-12-12 15:33:14 -06:00
Eric Kuck ea29a0c7d1 Tons more swiftlint warnings fixed. Still a few remaining. 2018-12-12 12:28:27 -06:00
Eric Kuck fa558a4019 Added swiftlint and fixed all errors (and a bunch, but not all, warnings) 2018-12-12 11:40:57 -06:00
Jason A. Donenfeld 440073ad9a Supply missing pieces of path change 2018-12-12 01:11:43 +01:00
Eric Kuck 14091de6b6 Fixed a potential race condition, better naming on PacketTunnelSettingsGenerator methods 2018-12-11 16:59:15 -06:00
Eric Kuck 7d387da741 Added an (unfinished) NWPathMonitor implementation for reconnecting on network changes 2018-12-11 16:12:04 -06:00
Roopesh Chander ff64ef79f1 NE: All DNS queries must first go through the VPN's DNS servers 2018-11-23 13:04:55 +05:30
Roopesh Chander 80e563406b Move logic to extension: Refactor PacketTunnelOptionsGenerator into a PacketTunnelSettingsGenerator 2018-11-08 15:44:13 +05:30