Skip to content

net: a stopped PPPoE service always gets its PADT out (reboot with a slow ISP) - #177

Merged
Cd1s merged 1 commit into
mainfrom
fix/pppoe-padt-on-stop
Oct 25, 2026
Merged

Cd1s merged 1 commit into
mainfrom
fix/pppoe-padt-on-stop

Conversation

@Cd1s

@Cd1s Cd1s commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Closes #176

Based on #175 (the lab ISP simulator additions it uses: wire log, --echo); #175 goes first, then this one.

What

  • rootfs/usr/libexec/mr/pppoe-dial: pppd starts with lcp-max-terminate 1. On SIGTERM it sends one LCP Terminate-Request and sends the PADT as soon as the ISP answers, or after lcp-restart (3 s) when it does not. The default (2 requests) needed 6 s.
  • rootfs/etc/init.d/mr-pppoe: retry="SIGTERM/10", so supervise-daemon waits for pppd to exit instead of declaring the service stopped after 5 s.
  • Docs: docs/modules/net.md (what a stop / restart / reboot does to the PPPoE sessions, and what cannot send a PADT).
  • Lab: scenario 15-pppoe-reboot-padt; TestPPPoEStopLeavesTimeForPADT keeps the two numbers consistent.

Why

Investigation of the reboot path (details in #176):

  • reboot → busybox init → /sbin/openrc shutdown. mr-pppoe.* is stopped first, before the firewall is unloaded or any link is touched (mr-network has no stop action; serial console order: Stopping mr-pppoe.wan … Unloading firewall … Unmounting). The AX6000 image builds on the same Alpine inittab / OpenRC (build/m3/build-rootfs.sh only drops the tty lines); kexec is only sysupgrade, which stops mr-pppoe.* itself first; nothing in the repo reboots with -f.
  • With an ISP that answers, both LCP Terminate and PADT already leave ~1.2 s after reboot.
  • With an ISP that is slow or silent the PADT was lost: rc-service mr-pppoe.wan stop returned after exactly 5 s (supervise-daemon's default) while pppd was still waiting (Terminate-Requests at 0 s and 3 s, PADT at 6 s, observed with pppd still alive after the "stopped" service). In a reboot the system was gone before the PADT. The ISP keeps counting the old session, which is how a reboot turns into walled-garden sessions at an ISP with a concurrent limit. A guard redial (rc-service … restart) has the same stop path.
  • Could not be tested on the AX6000 itself or the user's router. Power loss, hangs and watchdog resets cannot send a PADT.

Verification

Lab (id 8), two sessions on one port, ISP wire log (pppoe-watch.py):

Before (this PR's parent): not ok 8 - B: wan's session ended with PADT although the ISP never answered; the ISP saw, after the reboot command with its pppd frozen,

LCP-TERM-REQ from=02:00:00:08:00:02 … LCP-TERM-REQ (3 s later) … PADT from=02:00:00:08:00:02   (6 s, the system was still up)
LCP-TERM-REQ from=52:54:00:08:01:01 (wan)        — and no PADT from wan, the reboot came first

After: 10/10 ok

ok 4 - A: wan's session ended with LCP Terminate + PADT
ok 5 - A: wan2's session ended with LCP Terminate + PADT
ok 6 - A: mr-pppoe.wan2 was stopped before the firewall was unloaded
ok 8 - B: wan's session ended with PADT although the ISP never answered
ok 9 - B: wan2's session ended with PADT although the ISP never answered
194.055 LCP-TERM-REQ wan2 → 197.067 PADT wan2;  197.081 LCP-TERM-REQ wan → 200.093 PADT wan   (3 s per silent session; 0.09 s when the ISP answers)

cd mr && go test ./... and sh tools/ci.sh: ALL CHECKS PASSED.

🤖 Generated with Claude Code

@Cd1s
Cd1s changed the base branch from fix/public-ip-retry to main October 25, 2026 20:20
@Cd1s
Cd1s force-pushed the fix/pppoe-padt-on-stop branch from 066b849 to 59180b9 Compare October 25, 2026 20:39
`reboot` stops mr-pppoe.* first, but supervise-daemon declares the service stopped after 5 s while pppd still
waits for the ISP's LCP Terminate-Ack (2 requests x 3 s) before it sends the PADT; the reboot goes on and the
PADT is lost whenever the ISP is slow or silent. The ISP then keeps counting the old session (AIS: the next dial
lands in a walled garden).

- pppoe-dial starts pppd with lcp-max-terminate 1: the PADT leaves at once when the ISP answers, after 3 s when
  it does not.
- mr-pppoe: retry="SIGTERM/10", supervise-daemon waits for pppd to exit.
- Test: TestPPPoEStopLeavesTimeForPADT (the two numbers stay consistent); lab scenario 15-pppoe-reboot-padt
  (two sessions, a responsive and a silent ISP: LCP Terminate + PADT for every session, mr-pppoe.* stopped
  before the firewall unloads).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Cd1s
Cd1s force-pushed the fix/pppoe-padt-on-stop branch from 59180b9 to 3f62ff2 Compare October 25, 2026 20:41
@Cd1s
Cd1s merged commit a72b249 into main Oct 25, 2026
2 checks passed
@Cd1s
Cd1s deleted the fix/pppoe-padt-on-stop branch October 25, 2026 20:47
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.

PPPoE: a reboot loses the PADT when the ISP is slow to answer LCP Terminate (old sessions stay counted at the ISP)

1 participant