summaryrefslogtreecommitdiffhomepage
path: root/talpid-wireguard/src/lib.rs
AgeCommit message (Collapse)AuthorFilesLines
2024-09-24Lower MTU during ephemeral peer negotiation on WindowsDavid Lönnhager1-0/+27
2024-09-23Generalize error that could occur while negotiating an ephemeral peerMarkus Pettersson1-8/+10
2024-09-20Refactor obfuscation setupDavid Lönnhager1-145/+28
2024-09-18Fix bug where allowed ips would not be patched if DAITA was enabledMarkus Pettersson1-4/+6
2024-09-18Fix negotiation of ephemeral peer failing due to timeoutMarkus Pettersson1-24/+188
Address a race condition in `WireguardMonitor::start` where a Wireguard-GO tunnel would be started but try to serve traffic before actually being ready to do so. This is probably a latent issue on all platforms using Wireguard-GO, but it was mostly noticeable on Android.
2024-09-02Fix a lingering panic by using a stricter typeMax Zettlmeißl1-1/+1
The functions `request_ephemeral_peer` and consecutively `new_client` accepted an `IpAddr`, but due to only ever preparing a v4 socket this lead to panic due to an `EAFNOSUPPORT` error if an IPv6 was provided. It would also have made sense to change `new_client` to create either an IPv4 or IPv6 socket depending on the type of the address, but the tuncfg service is currently not accepting IPv6 connections, therefore this was the cleaner change.
2024-08-27Use std LazyLock instead of once_cell LazyDavid Lönnhager1-5/+3
2024-08-20Move MTU helpers to talpid-net crateDavid Lönnhager1-2/+0
2024-08-16Add Shadowsocks obfuscation support to mullvad-daemonDavid Lönnhager1-42/+58
2024-08-16Add Shadowsocks to tunnel-obfuscation crateDavid Lönnhager1-2/+2
2024-06-28Remove pointless firewall updateDavid Lönnhager1-52/+40
2024-06-25Add `daita` as a Cargo cfg variableMarkus Pettersson1-9/+10
Gate DAITA compilation on `"cargo::rustc-cfg=daita"` emitted in build files per platform.
2024-06-25Enable constant packet size for wireguard-goMarkus Pettersson1-1/+1
Activate the setting when DAITA is enabled and write constant packet size to WG config string. Co-authored-by: Sebastian Holmin <sebastian.holmin@mullvad.net>
2024-06-25Use Wireguard-go when DAITA is enabledMarkus Pettersson1-17/+48
2024-06-25Add a safe FFI wrapper in `wireguard-go-rs`Sebastian Holmin1-22/+35
- Add local wireguard go import - Activate DAITA and add `wgActivateDaita` and `wgReceiveEvent` FFI - Implement `start_daita` on Wireguard-go tunnel type - Mention DAITA in `wireguard-go-rs` description - Do not compile `wireguard-go-rs` on Windows - Handle DAITA closed on `nil` event - Handle daita action timeouts in libwg - Remove noisy log lines - Remove `maybenot_on_action` callback - Remove unused link to `../build/lib` for `talpid-wireguard` - Bump the `wireguard-go` submodule to a signed release tag in Mullvad's `wireguard-go` fork. - Update path to `libwg/go.sum` in verification script Also: - Use u64 instead of *mut void as log context - Make Tunnel::set_config take a &mut self - Use dyn Error instead of i32s for wg errors Co-authored-by: Joakim Hulthe <joakim@hulthe.net>
2024-04-16Add DAITA to relay selectionDavid Lönnhager1-1/+1
2024-04-16Add DAITA Windows client and updated tuncfgDavid Lönnhager1-33/+70
2024-03-14Simplify route manager handleDavid Lönnhager1-1/+1
2024-02-27Replace err_derive with thiserrorJoakim Hulthe1-42/+40
`err_derive` is unmaintained and will probably stop working with rust edition 2024. `thiserror` is almost a drop-in replacement. This commit simply replaces all occurences of `derive(err_derive::Error)` with `derive(thiserror::Error)` and fixes the attributes, but the Error and Display impls should be identical.
2024-02-12Move MTU detection to separate moduleSebastian Holmin1-177/+16
2024-02-12Enable MTU detection on macosSebastian Holmin1-7/+7
2024-02-12Increase socket buffer size for MTU pinger on macosDavid Lönnhager1-3/+20
2024-02-09Add windows MTU detection implementation.Sebastian Holmin1-11/+28
2024-02-08Add `proptest` dependencySebastian Holmin1-5/+27
2024-02-08Enable automatic MTU detection on linuxSebastian Holmin1-0/+30
2024-02-08Add automatic MTU detectionSebastian Holmin1-0/+103
2024-02-08Add `set_mtu` for linuxSebastian Holmin1-0/+2
2024-02-08Move constantsSebastian Holmin1-6/+4
2024-01-31Simplify retry logic in connecting stateDavid Lönnhager1-1/+33
2024-01-31Coalesce tunnel device errors on WindowsDavid Lönnhager1-0/+5
2024-01-25Set default route MTU when using multihop on macOS. This prevents fragmentationDavid Lönnhager1-8/+13
2024-01-25Hardcode a low MTU/MSS for the tunnel config client socketDavid Lönnhager1-54/+6
2024-01-04Add workspace level lintsLinus Färnstrand1-1/+0
2023-12-04Remove hidden assumptions from WireGuard configDavid Lönnhager1-40/+19
2023-12-04Subtract multihop overhead from default route MTU on LinuxDavid Lönnhager1-0/+27
2023-10-20Move talpid-windows-net into talpid-windowsDavid Lönnhager1-3/+3
2023-08-31Add compile-time flag for wireguard-goDavid Lönnhager1-3/+3
2023-08-31Hide implementation-specific wg stats parsersDavid Lönnhager1-4/+2
2023-08-31Remove userspace wg module on WindowsDavid Lönnhager1-34/+25
2023-08-30Fix clippy lintsEmīls1-3/+3
2023-08-04Replace all use of `lazy_static` with `once_cell`Markus Pettersson1-10/+6
To align more with the upcoming standardizations within the Rust ecosystem which started with the release of `1.70.0` and the inevitable deprecation of `lazy_static`.
2023-06-09Exclude tunnel sockets after PSK exchangeDavid Lönnhager1-2/+28
2023-06-09Route everything via the tunnel during PSK exchange on Android, but drop ↵David Lönnhager1-10/+13
everything not destined for the gateway
2023-06-05Rework macOS routingDavid Lönnhager1-39/+4
2023-06-05Attempt to setup routes the other wayEmīls1-2/+38
2023-05-11Do not replace default routes on AndroidTommy Webb1-2/+2
Keep default routes as-is on Android, just as they are kept as-is for Linux. This allows Android 11+ to recognize Mullvad as an isolated VPN, properly preventing remote-initiated traffic from other interfaces.
2023-05-02Remove superfluous mut bindingLinus Färnstrand1-1/+1
2023-04-21Apply clippy --fix fixesLinus Färnstrand1-2/+2
This commit does not contain everything that `cargo clippy --fix` changed on Windows. But the least controversial and simplest subset. The remaining fixes I felt could use some manual cleanup also.
2023-04-17Use more pessimistic timeouts for PSK exchange (due to the large payload)David Lönnhager1-2/+2
2023-04-17Set MSS for PSK exchange when multihop is enabledDavid Lönnhager1-3/+34