[PR] feat(instance): per-instance identity + reject placeholder next-hop + router-id defaulting #233
Labels
No labels
bug
deploy
documentation
duplicate
enhancement
good first issue
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
femboy/blackwall#233
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Two arming defects surfaced during the 2026-07-31 box work.
1. A second
blackwalldinstance can't coexist with the first. Covering a second ingress path (e.g. a separate IX-peering NIC) with its own daemon was blocked: both instances share three global kernel resources and clobber each other — the nft table (every apply doesadd+flush, so they flush-wipe each other's rules), the deception TPROXY fwmark, and its policy route table (teardown runsip rule del+ip route flush, so one stopping rips out the other's plumbing).2. Arming with a placeholder blackhole next-hop fails silently. An
rtbhnext-hop left at a documentation/discard template value (192.0.2.1,100::1, …) never resolves to a real discard route, so BIRD leaves the/32unreachableand never exports it — the daemon showsEstablishedyet announces nothing.What
instance=<name>(optional top-level directive) →blackwall_core::InstanceIdsderives all three resources per-instance: tableblackwall_<name>, and a fwmark + route-table id taken from independent 32-bit halves of a 64-bit hash of the name (mark bit31 set → never0x1, never == route id; route id ≥0x4000_0000→ never100). Absent = today's exact identity (blackwall/0x1/100) — fully backward-compatible. Threaded through nftrender+apply/teardown(now takes&Policy), plus a newblackwalld teardown --configsubcommand so the runit crash backstop cleans up only its own instance.Placeholder next-hop guard —
RtbhPolicy::placeholder_next_hops()flags RFC 5737 / 3849 / 6666 ranges; the flow daemon refuses to start armed (not-shadow) if any rtbh next-hop is one. Shadow is exempt.Review
An independent review verified both Rust goals correct end-to-end (all three resources namespaced, stamp-mark == match-mark, guard on the live path only, range checks correct, all 14 mechanical
instance: Noneinsertions landed right) and caught two issues, both fixed in33e004e:finishcrash script still hardcoded the default identity → a named instance's crash would wipe the default instance's live dataplane. Now delegates toblackwalld teardown.Tests
InstanceIds derivation (defaults / namespacing / distinctness / stability),
instance=parse (set/default/empty/duplicate), named-instance table rename, placeholder-next-hop detection. Workspaceclippy -D warnings+fmtclean.Still the operator's decision (not in this PR)
The real fleet blackhole next-hop value (#4) — this PR only stops the placeholder shipping silently. Router-id validation in
bird-config(#232) is a noted fast-follow.[PR] feat(instance): per-instance kernel identity + reject placeholder RTBH next-hopto [PR] feat(instance): per-instance identity + reject placeholder next-hop + router-id defaultingAdded a third arming fix (femboyisp/blackwall#232, commit
0acfc5c):router-idis now optional and defaults to the IPv4local-addr(blackwall's own address, distinct from the BIRD peer's router-id by construction), androuter-id == peeris rejected at parse time. This is the code hardening for theBad BGP identifiercollision hit at arming — same fix the box applied live (router-id → container IP). Unit tests: default-from-local-addr, reject-equal-to-peer, error-when-undeterminable. Workspace clippy -D warnings + fmt clean.Moved to Forgejo — superseded by vxug.dev PR #234 (we're off GitHub Actions for CI cost). Branch unchanged.