Skip to content

net: recover rollback and firstboot state - #134

Merged
Cd1s merged 5 commits into
mainfrom
fix/rollback-firstboot
Oct 17, 2026
Merged

Cd1s merged 5 commits into
mainfrom
fix/rollback-firstboot

Conversation

@Cd1s

@Cd1s Cd1s commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

What

  • Roll back the panel to its original LAN IPv4 binding and normalize BusyBox CGI REMOTE_ADDR centrally: bracket removal, zone handling, and ::ffff: unmapping. API setup, token source allowlists, risk admin-path detection, and login throttling all consume the normalized address.
  • Add table-driven tests for BusyBox's real forms: IPv4, bracketed IPv4-mapped IPv6, bracketed global IPv6, and bracketed link-local IPv6 with %br-lan; reject a WAN link-local source.
  • Make firstboot P5b use a separate squashfs with no factory router.yaml, so the no-/rom branch is exercised for real.
  • Keep the earlier fixes for safe firstboot rendering, generated peer cleanup, rollback service handling, plan removal visibility, and fixed setup errors. Correct the setup recovery text to use serial factory-reset or reflashing.

Why

BusyBox httpd emits bracketed REMOTE_ADDR values when an IPv6 listener is used. The previous panel change therefore made all LAN setup requests return 403 and broke token source allowlists, risk-path detection, and login throttle buckets. The IPv4 panel binding preserves existing exposure behavior while the normalizer keeps every consumer correct for future IPv6 listeners and direct CGI use.

Verification

  • go test -count=1 ./... — passed
  • go vet ./..., gofmt, shell syntax — passed
  • sh tools/ci.sh — ALL CHECKS PASSED
  • build/m3/build.sh — passed with arm64 binfmt
  • build/m3/selftest.sh — passed P1–P8, including real no-/rom P5b
  • Alpine 3.24 BusyBox 1.37 busybox-extras httpd CGI probe confirmed [::ffff:127.0.0.1] and [::1] formats
  • GitHub CI checks for the pushed head are running

Closes #133

@Cd1s

Cd1s commented Oct 17, 2026

Copy link
Copy Markdown
Owner Author

Independent build/selftest rerun for head 25bf2d307e5d816f98374019b8e9ff22d3d60fdb:

  • Build: build/m3/build.sh succeeded; FIT/kernel/DTB matched and both sysupgrade validation passes completed.
  • P1: empty rootfs_data, overlay and persistence — OK.
  • P2: OpenWrt upper ignored — OK.
  • P3: provisioned firstboot render and runlevel reconciliation — OK.
  • P4: factory reset followed by factory configuration recovery — OK.
  • P5: invalid router/secrets rejection, factory render, and marker removal — OK.
  • P5b: genuine no-/rom squashfs firstboot path keeps files and marker — OK.
  • P6: no rootfs_data tmpfs fallback — OK.
  • P7: first boot image program pruning and idempotent next boot — OK.
  • P8: unconfirmed apply rollback at boot — OK.

Full raw logs:

  • runs/2026-10-17-minirouter/pr134-build.log
  • runs/2026-10-17-minirouter/pr134-selftest.log

@Cd1s
Cd1s merged commit 1f003f2 into main Oct 17, 2026
2 checks passed
@Cd1s Cd1s mentioned this pull request Oct 18, 2026
52 tasks done
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.

net: rollback and firstboot recovery can strand router

1 participant