| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
cleanup_rules() relies on the global flag IS_NFT_NOT_SUPPORTED, which
is always False before install_rule is called. Fixed it to always
attempt cleanup for ipt/ip6/nft at startup.
At the same time, implement Drop so that firewall cleanup occurs when
dies due to ?.
|
| |
|
|
| |
This makes windows users able to see the error message.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
It would be better if libc_s did not provide signalfd. The
open_signalfd() function itself has issues, such as sigprocmask being
applied elsewhere before opening it.
|
| |\
| |
| |
| |
| | |
Drop nix and add libc_s wrappers (with nix::fcntl like setsockopt
abstraction).
|
| | |
| |
| |
| |
| | |
This is likely new feature in kernel. (mayby 5.6 or something near
there)
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
Here mmap/munmap wrapper remain unsafe since mmap returns a pointer
causes a memory leak when munmap is not called while dropping, and
munmap has strict rule (PAGE_SIZE aligned) for addr defined on
munmap(2).
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
The existing implementation was unsafe because UB could occur if a
user-space pointer referenced by the struct sock_fprog was incorrectly
passed. Rust safe model allows pointer creation and makes
dereferencing unsafe. In this case, dereferencing happenes in
kernel-space, Rust cannot guarantee this. So it must be handled
separately.
|
| | |
| |
| |
| |
| |
| | |
Treating optval as just a &[u8] in setsockopt() is not appropriate for
usage patterns where a struct is put into optval. Rust treats casting
a struct to &[u8] as unsafe.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | | |
|
| | | |
|
| |/ |
|
| |
|
|
|
|
| |
Keeping poll_once() separate just caused more headaches. It was also
rebuilding the fds array every single time. Since poll() only
overwrites revents, doing that on every loop was totally unnecessary.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
| |
In v1.1, the make dependency was removed so there was no need to
fetch tarball, but it kept patching.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Console is now not insta-terminated now due to pause() on opt.rs.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
UAC elevation spawns a new console that closes when the process
exits, cutting off --help output and error messages. Add a pause
on Windows-only exit paths via _getch().
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
When both fds are ready in the same wakeup, the SYN/ACK that triggered
rx_ready is causally prior to the ClientHello waiting in the nfqueue.
Process the rxring first so HopTab is populated before handle_packet
runs find_hop, reducing the race window for HopLookupError::NotFound
under load.
|
| | |
|
| | |
|
| |
|
|
|
| |
Previously checked `argv == "--loglevel"` by mistake, copied from the
--loglevel deprecation pattern. Now correctly checks `argv == "-D"`.
|