Skip to content

docs: add SAFETY comment to set_ip_hdrincl unsafe block - #111

Merged
lance0 merged 1 commit into
masterfrom
fix/safety-comment-set-ip-hdrincl
Jul 6, 2026
Merged

lance0 merged 1 commit into
masterfrom
fix/safety-comment-set-ip-hdrincl

Conversation

@lance0

@lance0 lance0 commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a SAFETY justification comment to the unsafe block in set_ip_hdrincl (src/probe/rawip.rs) that calls libc::setsockopt.

The unsafe block previously had no // SAFETY: comment explaining why the call is safe, flagged by the weekly review (LAN-179).

Changes

  • Add // SAFETY: comment documenting why the raw fd, option constants, stack c_int pointer, and length are valid for the duration of the setsockopt call.

Testing

  • cargo clippy --lib --bin ttl -- -D warnings clean
  • cargo test passes (full suite via pre-push hook)

Closes LAN-179.

Adds a SAFETY justification comment to the unsafe block in
set_ip_hdrincl (src/probe/rawip.rs) that calls libc::setsockopt.
Documents why the raw fd, option constants, stack c_int pointer, and
length are valid for the duration of the call.

Closes LAN-179.
@lance0
lance0 merged commit 8957764 into master Jul 6, 2026
5 checks passed
@lance0
lance0 deleted the fix/safety-comment-set-ip-hdrincl branch July 6, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant