fix: CreateTap rejects a non-tap device squatting on the tap name #34

Closed
opened 2026-07-04 15:44:38 +00:00 by a73x · 1 comment
a73x commented 2026-07-04 15:44:38 +00:00 (Migrated from git.a73x.sh)

[claude 2026-07-04] Fixes bf898ffe (DEF-5). When the existence probe finds a link, isTap (default: /sys/class/net//tun_flags stat — no error-string parsing; injectable field per DI convention) must hold or CreateTap fails loudly naming the conflict. TDD: reject-non-tap (asserts no enslave commands), accept-real-tap, prior idempotency test updated to inject the probe. E2E in sandbox pass: pre-create a dummy link with the VM's tap name -> VM terminal-fails with the explicit conflict error. make ci green.


Migrated from git-collab patche 8f3f43bbe6441ea0de6a56597e5414a3787b1142.

Original author: a73x dev@a73x.sh.

Fixes git-collab issue bf898ffe

Historical merged patch. The original head and merge commits were not recorded. Forgejo cannot display a pull request without a head commit, so this record is preserved as a closed issue. The original diff is unavailable; no commit was guessed.

Original branches: fix/def5-tap-type-check → main.

[claude 2026-07-04] Fixes bf898ffe (DEF-5). When the existence probe finds a link, isTap (default: /sys/class/net/<name>/tun_flags stat — no error-string parsing; injectable field per DI convention) must hold or CreateTap fails loudly naming the conflict. TDD: reject-non-tap (asserts no enslave commands), accept-real-tap, prior idempotency test updated to inject the probe. E2E in sandbox pass: pre-create a dummy link with the VM's tap name -> VM terminal-fails with the explicit conflict error. make ci green. --- Migrated from git-collab patche `8f3f43bbe6441ea0de6a56597e5414a3787b1142`. Original author: a73x <dev@a73x.sh>. Fixes git-collab issue `bf898ffe` **Historical merged patch.** The original head and merge commits were not recorded. Forgejo cannot display a pull request without a head commit, so this record is preserved as a closed issue. The original diff is unavailable; no commit was guessed. Original branches: `fix/def5-tap-type-check` → `main`.
a73x commented 2026-07-04 17:59:56 +00:00 (Migrated from git.a73x.sh)

Original review: comment (revision not recorded)

[claude 2026-07-04] Reviewer verdict: approve — applied the two follow-ups in-branch: un-swallowed the lost-restart CreateTap error (conflict now reports its own message, not an illegible Boot failure), IFF_TAP bit check (0x0002) instead of bare tun_flags existence (rejects an L3 TUN), and marked the conflict Permanent() so it terminal-fails at once (composes with DEF-2). Reviewer verified tun_flags reliability and no-enslave-on-conflict. E2E in sandbox: killed a running VM's CH, replaced its tap with a dummy link — reconcile terminal-failed with 'link eit-... exists but is not a TAP device' surfaced verbatim through the API. Merging per session goal.

**Original review: comment** (revision not recorded) [claude 2026-07-04] Reviewer verdict: approve — applied the two follow-ups in-branch: un-swallowed the lost-restart CreateTap error (conflict now reports its own message, not an illegible Boot failure), IFF_TAP bit check (0x0002) instead of bare tun_flags existence (rejects an L3 TUN), and marked the conflict Permanent() so it terminal-fails at once (composes with DEF-2). Reviewer verified tun_flags reliability and no-enslave-on-conflict. E2E in sandbox: killed a running VM's CH, replaced its tap with a dummy link — reconcile terminal-failed with 'link eit-... exists but is not a TAP device' surfaced verbatim through the API. Merging per session goal.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
a73x/eitri#34
No description provided.