aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tunnel/defaultroutemonitor.go (follow)
Commit message (Collapse)AuthorAgeFilesLines
* global: update headersJason A. Donenfeld2020-11-221-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: use conn.BindSocketToInterface typeDavid Crawshaw2020-07-141-3/+7
| | | | | Signed-off-by: David Crawshaw <crawshaw@tailscale.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* updater: allow updating from the command lineJason A. Donenfeld2020-04-051-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>
* tunnel: calculate the actual route metric by summing interface and route metricPhilipp Czerner2020-03-291-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>
* tunnel: stop burst timer if we exceed 2 secondsJason A. Donenfeld2019-10-311-0/+1
| | | | | Reported-by: Odd Stranne <odd@mullvad.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: blackhole sockets when there's going to be a sure routing loopJason A. Donenfeld2019-10-211-8/+9
| | | | | | | | 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>
* Revert "tunnel: check for endpoint interfaces and media connection state"Jason A. Donenfeld2019-10-091-3/+1
| | | | | | | | This reverts commit cf6f599a4a65e89929ffc12982346c8e9012552c. It broke people's setups. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: check for endpoint interfaces and media connection stateJason A. Donenfeld2019-10-011-1/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: smooth bursts from windows network notifiersJason A. Donenfeld2019-10-011-5/+25
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: windows does not always add/remove routes with up/down interfaceJason A. Donenfeld2019-10-011-5/+17
| | | | | | | | | | | | | | | | 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>
* tunnel: wait for IP service to attach to wintunJason A. Donenfeld2019-06-181-38/+18
| | | | | | | | 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>
* global: cleanup TODO comment spacingJason A. Donenfeld2019-06-071-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: make tcp/ip waiting explicitJason A. Donenfeld2019-05-311-18/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: logical simplificationJason A. Donenfeld2019-05-291-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: allow for disabled ipv6Jason A. Donenfeld2019-05-291-14/+12
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* winipcfg: importJason A. Donenfeld2019-05-221-22/+23
| | | | | | | | We'll maintain this as part of the same repo here. Later maybe we'll push it into x/sys/windows. Signed-off-by: Simon Rozman <simon@rozman.si> Signed-off-by: Aleksandar Pesic <peske.nis@gmail.com>
* service: split into tunnel and managerJason A. Donenfeld2019-05-201-0/+150
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>