aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tunnel (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-07-14tunnel: use conn.BindSocketToInterface typeDavid Crawshaw1-3/+7
Signed-off-by: David Crawshaw <crawshaw@tailscale.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-06-09winipcfg: add missing error case to dns domain settingJason A. Donenfeld1-1/+3
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-06-07tunnel: unset dns search if none is specifiedJason A. Donenfeld1-7/+9
This doesn't get automatically cleared in the same way that nameservers do. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-06-05tunnel: support setting dns domain suffixJason A. Donenfeld2-0/+36
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-04-07firewall: remove unused ExemptBuiltinAdministratorsJason A. Donenfeld1-17/+0
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-04-05updater: allow updating from the command lineJason A. Donenfeld1-1/+1
The administrator user may run `wireguard.exe /update`, which will check for updates and install it if available. A log file may be written using `wireguard.exe /update path\to\log\file.txt`. Requested-by: Elliot Saba <staticfloat@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-29tunnel: calculate the actual route metric by summing interface and route metricPhilipp Czerner1-2/+8
I had some issues setting up WireGuard behind another VPN. Curiously, it bound the physical interface instead of the other VPN, which was the default route. According to MSDN "the actual route metric used to compute the route preference is the summation of interface metric specified in the Metric member of the MIB_IPINTERFACE_ROW structure and the route metric offset specified in this member" (documentation for MIB_IPFORWARD_ROW2), but the code did not seem to consider this. After I changed the calculation, I got the expected behaviour. Signed-off-by: Philipp Czerner <suyjuris.gi@nicze.de> Link: https://docs.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_ipforward_row2 [zx2c4: fixed up commit message, removed semicolon] Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-01-24tunnel: deduplicate addresses from configJason A. Donenfeld1-0/+1
Windows doesn't like it when passing these off to its config. Reported-by: Jonathan Tooker <jonathan.tooker@netprotect.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-16tunnel: use real on-link routesJason A. Donenfeld1-21/+10
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-11firewall: add escape hatch for same-process adminsJason A. Donenfeld1-0/+17
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-11firewall: fix urlsJason A. Donenfeld3-9/+9
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-11tunnel: add wintun ordered unit testJason A. Donenfeld1-0/+202
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-10-31tunnel: stop burst timer if we exceed 2 secondsJason A. Donenfeld1-0/+1
Reported-by: Odd Stranne <odd@mullvad.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-10-21tunnel: blackhole sockets when there's going to be a sure routing loopJason A. Donenfeld2-9/+49
This prevents against common mishaps when changing from a wifi network that supports v6 to one that doesn't. Reported-by: Jonathan Tooker <jonathan.tooker@netprotect.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-10-17mod: bumpJason A. Donenfeld1-1/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-10-09Revert "tunnel: check for endpoint interfaces and media connection state"Jason A. Donenfeld1-3/+1
This reverts commit cf6f599a4a65e89929ffc12982346c8e9012552c. It broke people's setups. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-10-09tunnel: print wintun version in debug logJason A. Donenfeld1-0/+6
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-10-04mod: bump versionsJason A. Donenfeld2-2/+2
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-10-01tunnel: check for endpoint interfaces and media connection stateJason A. Donenfeld1-1/+3
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-10-01tunnel: smooth bursts from windows network notifiersJason A. Donenfeld1-5/+25
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-10-01tunnel: windows does not always add/remove routes with up/down interfaceJason A. Donenfeld3-25/+45
On Linux, we're used to routes being added after an interface is up, and routes being removed as a consequence of an interface going down. On Windows, this isn't always the case, at least not from the perspective of the route notifiers. In order to work around this and make a multi-interface model coherent, we search for a new default route not only whenever the routing table changes but also whenever any interface link parameters change, such as up/down. The practical consequence is that now WireGuard connects properly when wifi is disconnected and then reconnected. Reported-by: Nenad Kozul <me@nenadkozul.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-09-27winipcfg: make Unregister wait for callbacks to completeJason A. Donenfeld4-31/+61
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-09-27winipcfg: port more granular locking from route change to othersJason A. Donenfeld2-22/+36
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-09-27winipcfg: ensure we're passing copy to go routinesJason A. Donenfeld3-3/+6
The windows-allocated one gets freed. Reported-by: Odd Stranne <odd@mullvad.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-09-27mod: bump versionsJason A. Donenfeld2-2/+2
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-09-23global: use SECURITY_DESCRIPTOR apis from x/sys/windowsJason A. Donenfeld7-99/+62
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-09-23firewall: remove unused wrappersJason A. Donenfeld2-32/+0
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-09-13tunnel: device->interfaceJason A. Donenfeld1-1/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-09-01winipcfg: launch callbacks in goroutines to prevent deadlockJason A. Donenfeld3-3/+3
ret: setupLock interfaceChangeLock trigger: interfaceChangeLock setupLock Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-08-30winipcfg: use upstream helper function for elevation testJason A. Donenfeld1-16/+9
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-08-30manager: fix nits in adapter cleanup logic and also handle ā€˜%sā€™ uniformlyJason A. Donenfeld1-1/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-08-30tunnel: allow disabling deterministic GUIDs for external consumersJason A. Donenfeld1-21/+31
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-08-26tunnel: do not query real interface nameJason A. Donenfeld1-7/+0
We want to enforce the relation between the socket name and the service name, especially since the wintun adapter name might get a 1 or 2 appended depending on weird Nci duplication detection. So we just stick with the configuration-given name throughout. Also, the user can change the adapter name at runtime, which is all the more reason why maybe we shouldn't care about it so much. Reported-by: Nenad Kozul <me@nenadkozul.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-08-26firewall: use RtlGetNtVersionNumbers for kernel compat checksJason A. Donenfeld1-3/+2
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-08-24version: use upstream RtlGetVersionJason A. Donenfeld1-7/+3
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-08-24tunnel: move Run into own module to reduce file sizeJason A. Donenfeld1-2/+14
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-08-05elevate: move service/token into proper moduleJason A. Donenfeld1-1/+2
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-08-03tunnel: styleJason A. Donenfeld1-1/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-07-19tunnel: extract owner of config file for pipe daclJason A. Donenfeld2-0/+60
If the config file is unencrypted and its owner is not Local System, then we allow the runtime named pipe to be accessed by that owner, since generally the private key is already stored in the config file. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-06-18tunnel: wait for IP service to attach to wintunJason A. Donenfeld6-125/+268
This helps fix startup races without needing to poll, as well as reconfiguring interfaces after wintun destroys and re-adds. It also deals gracefully with IPv6 being disabled. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-06-13firewall: adjust loopback rule for better matchingOdd Stranne2-17/+14
Signed-off-by: Odd Stranne <odd@mullvad.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-06-13tunnel: clearer GUID encoding schemeJason A. Donenfeld1-24/+38
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-06-11winipcfg: prefer own methods over direct API callsSimon Rozman1-2/+2
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-06-10tunnel: generate GUIDs deterministicallyJason A. Donenfeld2-1/+74
This allows NLA profiles to securely bind public keys to firewall profiles, a considerable improvement on the usual insecure Windows situation. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-06-09tunnel: SCM lock status is upstream nowJason A. Donenfeld1-32/+11
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-06-07tunnel: release SCM locks by faking an early start before wintun initJason A. Donenfeld1-0/+35
Otherwise creating the wintun service deadlocks the entire SCM on Windows 8.1. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-06-07firewall: GUID generation is now upstreamJason A. Donenfeld2-16/+2
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-06-07global: cleanup TODO comment spacingJason A. Donenfeld5-6/+6
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-06-07tunnel: perform full stop on shutdownSimon Rozman1-2/+2
The services which do not advertise they accept shutdown signal from SCM are killed on shutdown. This commit establishes a full tunnel cleanup (i.e. delete the adapter) on shutdown. Otherwise, the Wintun adapter is deleted on next boot as a part of the regular sanitation procedure. Signed-off-by: Simon Rozman <simon@rozman.si>
2019-06-07tunnel: retain SeLoadDriverPrivilegeJason A. Donenfeld1-2/+2
This is a big loss. We'll need to revisit this. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>