summaryrefslogtreecommitdiffhomepage
path: root/talpid-routing/src
AgeCommit message (Collapse)AuthorFilesLines
2025-04-10Fix some compilation errors on macOS for Rust 2024David Lönnhager1-1/+1
2025-04-01Fix incorrect decoding of macOS SCDynStore valueJoakim Hulthe1-48/+52
We were incorrectly reading the `Addresses`-key from the `State:/Network/Global/IPvX`-dictionaries, which do not have it. The correct place to look is `State:/Network/Service/<service_id>/IPvX`
2025-04-01Remove some `unsafe` blocksJoakim Hulthe1-17/+32
2025-02-25Add safety comment in talpid_routing::windows::route_managerJoakim Hulthe1-0/+1
2025-02-25Allow undocumented_unsafe_blocks in some modulesJoakim Hulthe1-0/+2
2025-02-25Fix bad pointer deref in talpid-routing::unix::macos::dataJoakim Hulthe1-1/+6
2025-02-25Fix math in talpid-routing::unix::macos::data (?)Joakim Hulthe1-1/+1
2025-02-25Fix safety comment position in talpid-routing::unix::macos::dataJoakim Hulthe1-4/+4
2025-02-25Add safety comments in talpid_routing::windows::route_managerJoakim Hulthe1-0/+2
2025-02-25Fix position of safety comment in talpid_routing::windowsJoakim Hulthe1-3/+5
2025-02-25Reduce open_tun calls (Establish)David Göransson2-20/+52
Each call to Establish opens a window for leaks on android. By only invoking Establish if the VpnConfig if any of the input has changed and reusing it otherwise we avoid many of these leaks. This commit also waits for android to report back that the routes have been created to ping and verify connectivity to avoid pings going outside the tunnel.
2025-02-12Format workspaceSebastian Holmin2-12/+11
The 2024 edition contains new formatting rules. All of these are not compatible with the 2021 formatting style, but most of them are. To change the formatting to be as close to the new style as possible while remaining compatible with the 2021 edition, I first ran `cargo +beta fmt` with the edition set to 2024, then, with the edition set to 2021, I ran `cargo fmt`.
2025-02-12Fix `unsafe_op_in_unsafe_fn` warningSebastian Holmin2-26/+42
2025-02-12Fix "RPIT lifetime capture rules"Sebastian Holmin1-1/+3
2025-02-12Replace `#[no_mangle]` with `#[unsafe(no_mangle)]`Sebastian Holmin1-1/+1
2025-02-06Request (poll) initial NetworkState at startupMarkus Pettersson2-3/+81
2025-02-06Replace old waitForTunnelUp functionDavid Göransson5-26/+213
After invoking VpnService.establish() we will get a tunnel file descriptor that corresponds to the interface that was created. However, this has no guarantee of the routing table beeing up to date, and we might thus send traffic outside the tunnel. Previously this was done through looking at the tunFd to see that traffic is sent to verify that the routing table has changed. If no traffic is seen some traffic is induced to a random IP address to ensure traffic can be seen. This new implementation is slower but won't risk sending UDP traffic to a random public address at the internet.
2025-01-24Complete leak checker and implement in daemonJoakim Hulthe1-1/+1
2024-08-27Use std LazyLock instead of once_cell LazyDavid Lönnhager1-3/+3
2024-08-20Add interface/mtu change listenerDavid Lönnhager3-0/+47
2024-06-24Run `cargo +nightly fmt`Sebastian Holmin2-3/+2
2024-06-20Use only SCDynamicStore for fetching network service IPsDavid Lönnhager1-53/+42
This fixes a regression due to 9c257c424a5ed4d531fec8e813f44a4ede0baaee
2024-04-30Refactor tun moduleDavid Lönnhager1-2/+1
2024-04-30Simplify interface filteringDavid Lönnhager2-54/+37
2024-04-30Handle already-applied routes gentlyDavid Lönnhager2-6/+17
2024-04-30Add initial split tunneling implementation for macOSDavid Lönnhager4-125/+256
2024-04-22Fix broken lints in rustdocsSebastian Holmin3-3/+3
I ran `cargo doc` and fixed as many broken links as I could find.
2024-04-03Enable single-use-lifetimes rustc lintLinus Färnstrand1-1/+1
Removes superfluous lifetime definitions. Simplifying the code
2024-03-18Make burst guard publicDavid Lönnhager2-1/+3
2024-03-14Simplify route manager handleDavid Lönnhager3-255/+145
2024-03-13Fix recv errorDavid Lönnhager1-1/+1
2024-03-13Recreate routing socket if it has been shut down while readingDavid Lönnhager1-5/+13
2024-03-13Hide wait_for_responseDavid Lönnhager1-1/+1
2024-03-13Add helper for checking if routing socket has been shut downDavid Lönnhager1-0/+17
2024-03-13Log when select functions are called an unusual number of timesDavid Lönnhager3-0/+11
2024-03-11Don't block when dropping route managerDavid Lönnhager1-3/+4
2024-03-11Unify stop method signature between route manager implementationsDavid Lönnhager1-7/+12
2024-03-11Use block_in_place() in drop implAndrej Mihajlov1-3/+3
See: https://github.com/tokio-rs/tokio/issues/5843
2024-03-11Remove unnecessary mutabilityDavid Lönnhager1-4/+4
2024-03-11Simplify unix route monitorDavid Lönnhager1-40/+19
2024-03-11Simplify Windows route monitorDavid Lönnhager1-37/+21
2024-03-11Remove unused error variants in routing::unix::ErrorAndrej Mihajlov1-7/+1
2024-03-08Remove superfluous commentsDavid Lönnhager1-8/+0
2024-03-08Clean up macOS routing data errorsDavid Lönnhager3-54/+59
2024-03-08Print all source errors for macOS routing errorsDavid Lönnhager3-7/+12
2024-03-07Bump nixAndrej Mihajlov2-6/+8
2024-03-07Update bitflags to v2Andrej Mihajlov1-0/+3
2024-03-07routing: use libc constantsAndrej Mihajlov1-58/+57
2024-02-27Replace err_derive with thiserrorJoakim Hulthe7-78/+76
`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-19Fix redundant importsDavid Lönnhager1-7/+0