| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
| |
| |
| |
| |
| |
| | |
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"`.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |\ |
|
| | | |
|
| | |
| |
| |
| | |
Rename "fragment" to "segmentation".
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
Replace hardcoded [0,1] split with send_split accepting &[Segment].
Segments exceeding payload length are warned and skipped. Add Segment
type to opt.rs with Display/Debug showing [start,end) notation.
|
| | |
| |
| |
| |
| |
| | |
Parse comma-separated split points into sorted segment ranges as
(start, end): pairs. Display shows original input with computed
ranges, e.g. "5,1,0,3 ([5,end), [1,3), [0,1), [3,5))".
|
| |/
|
|
|
|
|
| |
SegmentOrder parses a comma-separated list of u32 split points, sorts
them, and precomputes segment ranges as (start, end) pairs for use in
send_split. The original input string is retained for Display. Parsing
logic is unimplemented and will follow in the next commit.
|
| | |
|
| | |
|
| | |
|