Skip to content

fix(cli): forkd doctor no longer warns on idle TAP (admin-UP + no peer)#155

Merged
WaylandYang merged 1 commit into
mainfrom
fix/doctor-tap-admin-up
May 23, 2026
Merged

fix(cli): forkd doctor no longer warns on idle TAP (admin-UP + no peer)#155
WaylandYang merged 1 commit into
mainfrom
fix/doctor-tap-admin-up

Conversation

@WaylandYang
Copy link
Copy Markdown
Contributor

Summary

The tap-device check was reading only `/sys/class/net//operstate`. For a TUN/TAP device the natural idle state is admin-UP + operstate=DOWN (NO-CARRIER) — operstate only flips to up/unknown when a peer attaches (a firecracker process). On a properly-configured host with no live sandbox, doctor was emitting a false WARN.

Before

```
⚠ tap device forkd-tap0 (down)
→ sudo ip link set forkd-tap0 up — or rerun scripts/host-tap.sh
```

After

```
✓ tap device forkd-tap0 (admin-UP, idle)
```

When a sandbox IS live and a peer is attached:
```
✓ tap device forkd-tap0 (up, peer attached)
```

Implementation

Also read `/sys/class/net//flags` and check bit 0 (`IFF_UP`). If admin says UP, PASS regardless of operstate. The check still FAILs if the device doesn't exist and WARNs if it exists but admin is DOWN.

Why now

About to use the doctor output in a Show HN launch screenshot — the false-warn made the "14 checks all pass" claim a lie on the cold dev box. Worth fixing for actual users too.

🤖 Generated with Claude Code

… peer)

The tap device check was reading only /sys/class/net/<dev>/operstate.
For a TUN/TAP device the natural idle state is admin-UP + operstate=
DOWN (NO-CARRIER) — operstate only flips to up/unknown when a peer
attaches (firecracker process). The check now also reads
/sys/class/net/<dev>/flags and treats IFF_UP set + any operstate as
PASS. False-warns on a freshly-set-up host with no live sandbox go
away.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@WaylandYang WaylandYang merged commit d176444 into main May 23, 2026
2 checks passed
@WaylandYang WaylandYang deleted the fix/doctor-tap-admin-up branch May 23, 2026 07:17
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