| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
| |
To publish dpibreak to there
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Query the service state with `sc query windivert` at startup, as this
is observed to resolve the bad state described in commit 168a88b8
("windows: fix some kind of race").
This is a defensive measure against the driver uninstall introduced by
that commit. Normally the uninstall is attempted only after all
handles opened by the current process are closed, but if another
process still holds an open WinDivert handle at that point, the driver
can remain stuck in a bad state on subsequent runs.
Link: https://github.com/basil00/WinDivert/issues/406
|
| | |
|
| |
|
|
|
|
| |
This is pulled from cargo cache:
cp -r ~/.cargo/registry/src/index.crates.io-*/windivert-0.6.0 \
crates/windivert
|
| |
|
|
|
|
|
|
|
| |
While solving it, introduced Pkt abstraction so that advance() is
automatically executed upon dropping it.
This change still allows access to mmapped pointers within the
Pkt.net() and enables the addition of other slice fields (such as mac)
later.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
When I updated nix to 0.31, `nix::fcntl::flock` became deprecated and
unusable. At first I try to refactor `lock_pid_file()` to use the
`lock` method of the `nix::fcntl::Flock` struct, but a situation arose
where `set_len(0)` could not be called due to ownership issues. Linux
system calls are fundamentally simple, stable, and backward
compatible. Therefore, a compat layer is not necessary.
Anticipating that this might happen again, this commit introduce the
`libc_s`, which handles simple error processing for unsafe ffis in
libc syscall bindings.
|
| | |
|
| |
|
|
|
|
| |
This integrates well with the main poll loop and removes the global
AtomicBool RUNNING, which previously did nothing but detect interrupts
before entering the loop.
|
| | |
|
| |
|
|
|
|
|
|
| |
The hot loop in src/platform/linux.rs uses if-let chains:(`if cond &&
let Some(x) = expr`), stabilised in Rust 1.88. Older toolchains fail
with a cryptic E0658 feature-gate error; declaring rust-version
surfaces a clear "package requires rustc 1.88 or newer" message at
cargo invocation time instead.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
Replace generic spawn_recv with recv_loop macro that encapsulates the
buffer allocation and receive loop. Divert handle now runs directly on
the main thread, while sniff handle spawns a dedicated thread only when
fake_autottl is enabled. This eliminates the mpsc channel, Event enum,
and the race condition where concurrent open_handle calls during driver
initialization could cause error 1058.
|
| |
|
|
|
|
|
| |
Conditionally initialize rxring only when fake_autottl is enabled.
Extract poll_once() using libc::poll directly; fd=-1 trick eliminates
the need for conditional branching on optional rxring fd, as poll sets
revents=0 for negative fds per POSIX. Drop nix poll feature.
|
| |
|
|
| |
100 lines of JSON soup -> 16 lines of actual nftables
|
| | |
|
| | |
|
| |
|
|
| |
24 KiB is precious :)
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
Revert lock_handle()
send_to_raw cannot get a mutex since lock is not released per
iteration.
commit e08b57d281d8368dc02f06e3b6cd43edf88b2438
|
| |
|
|
|
| |
Closes: #2
Link: https://github.com/dilluti0n/dpibreak/issues/2
|
| | |
|
| |
|
|
| |
Closes: https://github.com/dilluti0n/dpibreak/issues/12
|
| | |
|
| | |
|
| |
|
|
| |
Introduce minimal iptables wrapper.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
nftables-rs didn’t fit use case, so it was decoupled, and logging was
improved.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Introduce nftables rules under a dedicated "dpibreak" table and
chain. Traffic on TCP port 443 is queued using NFQUEUE. If nftables
is not supported, fall back to the existing iptables-based rules
for both IPv4 and IPv6.
Also update cleanup logic to remove nftables table if used, or
iptables rules otherwise.
|
| | |
|