Skip to content

fix: Remove dead BsdAsyncIcmpSocket::new; live BSD IPv6 validation (FreeBSD 14.3 + OpenBSD 7.7)#51

Merged
dweekly merged 1 commit into
mainfrom
docs/bsd-live-validation
Jul 18, 2026
Merged

fix: Remove dead BsdAsyncIcmpSocket::new; live BSD IPv6 validation (FreeBSD 14.3 + OpenBSD 7.7)#51
dweekly merged 1 commit into
mainfrom
docs/bsd-live-validation

Conversation

@dweekly

@dweekly dweekly commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Live-validated ftr v0.9.0 IPv6 support on real BSD hardware: two arm64 Parallels VMs bridged onto the same Sonic fiber LAN as the existing macOS/Linux/Windows validation environments.

What was validated

FreeBSD 14.3-RELEASE (arm64)FreeBSD freebsd143 14.3-RELEASE ... GENERIC arm64

  • External IPv6: yes. Global SLAAC 2001:5a8:4681:2c00:21c:42ff:fed9:7283, v6 default route via vtnet0, ping6 google.com 0% loss (replies from 2607:f8b0:4005:808::200e, hlim=109, ~3.3ms).
  • Build: rust/cargo/cc present, git absent (source shipped as a v0.9.0 tarball); cargo build --release → exit 0, 1,163,584-byte binary.
  • Non-root permission path validated (verbatim):
    $ ./target/release/ftr --version
    ftr 0.9.0
    $ ./target/release/ftr -6 ::1        # exit 1
    Error: ftr requires root privileges on freebsd
    This platform does not support unprivileged traceroute.
    $ ./target/release/ftr 8.8.8.8       # exit 1
    Error: ftr requires root privileges on freebsd
    This platform does not support unprivileged traceroute.
    

OpenBSD 7.7 (arm64) — first-ever compile of the cfg(target_os = "openbsd") armOpenBSD openbsd7.localdomain 7.7 GENERIC.MP#2 arm64

  • External IPv6: no. Only ::1, no global v6, no v6 default route; ping6 google.com 100% loss (ret=-1). OpenBSD v6 traces on this host are limited to loopback.
  • Build (headline): the OpenBSD bsd_v6.rs arm compiled for the first time ever, and clean. git clone --branch v0.9.0 + cargo build --release → exit 0 in 2m20s, 1,251,000-byte binary. It emitted exactly one warning — dead code in the shared IPv4 path (see below).

The dead-code fix

The OpenBSD (and any BSD) release build flagged:

warning: associated function `new` is never used
  --> src/socket/bsd.rs:35:12
warning: `ftr` (lib) generated 1 warning

BsdAsyncIcmpSocket::new() had a single caller — its own #[cfg(test)] unit test — so a non-test release build on a BSD flags it. It went unnoticed because CI's FreeBSD job builds in test profile (where the test uses it) and clippy -D warnings runs on Linux/macOS, where bsd.rs is not compiled at all. This is the same class of platform-gated dead code cleaned up earlier for the macOS and Windows arms. The fix removes the redundant new() and points its test at new_with_config(TimingConfig::default()) — the constructor the socket factory actually uses. After the patch, cargo build --release finishes warning-free on both OpenBSD (33.85s) and FreeBSD (7.50s), confirmed by rebuild on the live VMs.

What remains untested (honest)

The live root-gated multi-hop trace was not run this session. Raw ICMPv6 requires root on the BSDs; direct root SSH is disabled on both VMs and no host-sanctioned privilege-escalation path was available, so the run that would finally observe a router-originated ICMPv6 Time Exceeded on FreeBSD first-hand is deferred to a maintainer (recorded in docs/IPV6_DESIGN.md). FreeBSD has confirmed external v6, so the trace is achievable there; OpenBSD's VM has no external v6. Root cargo test on the VMs likewise pending.

Validation

  • Host gates: cargo fmt, cargo clippy --all-targets -D warnings, cargo test (228+20+doctests pass), RUSTDOCFLAGS=-D warnings cargo doc — all green. (cargo check --target x86_64-unknown-freebsd fails on openssl-sys header cross-compile, unrelated to this change; bsd.rs isn't reached.)
  • Real-hardware: warning-free release rebuild on both FreeBSD 14.3 and OpenBSD 7.7. CI's FreeBSD VM job exercises the changed bsd.rs.

🤖 Generated with Claude Code

Live-validated ftr v0.9.0 IPv6 support on real BSD hardware (two arm64
Parallels VMs bridged onto Sonic fiber): FreeBSD 14.3-RELEASE and
OpenBSD 7.7.

Headline: the OpenBSD `cfg(target_os = "openbsd")` arm of bsd_v6.rs
compiled for the first time ever, and clean. The v0.9.0 release build
succeeds on both FreeBSD and OpenBSD, and the non-root permission path
(typed InsufficientPermissions instead of a raw-socket attempt) is
validated live on FreeBSD.

The OpenBSD release build surfaced one dead-code warning:
`BsdAsyncIcmpSocket::new()` in the shared IPv4 path had only one caller,
its own #[cfg(test)] test, so any non-test *release* build on a BSD flags
it. It went unnoticed because CI's FreeBSD job builds in test profile
(where the test uses it) and `clippy -D warnings` runs on Linux/macOS,
where bsd.rs is not compiled at all — the same class of platform-gated
dead code cleaned up earlier for the macOS and Windows arms. Remove the
redundant `new()` and point its test at `new_with_config(...)`, the
constructor the factory actually uses. After the patch, `cargo build
--release` finishes warning-free on both OpenBSD and FreeBSD.

FreeBSD has confirmed external IPv6; OpenBSD's VM does not. The live
root-gated multi-hop trace (which would finally observe a router-
originated ICMPv6 Time Exceeded on FreeBSD first-hand) was NOT run this
session — raw ICMPv6 needs root, root SSH is disabled on the VMs, and no
host-sanctioned escalation path was available. It is recorded in
docs/IPV6_DESIGN.md for a maintainer to run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.31%. Comparing base (9be8a93) to head (e58b1b9).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #51   +/-   ##
=======================================
  Coverage   84.31%   84.31%           
=======================================
  Files          36       36           
  Lines        6663     6663           
=======================================
  Hits         5618     5618           
  Misses       1045     1045           
Flag Coverage Δ
unittests 84.31% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9be8a93...e58b1b9. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dweekly
dweekly merged commit 58c46b5 into main Jul 18, 2026
16 checks passed
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