PPPoE WAN: MASTER restarts mpd5 while dialing; BACKUP reports result=partial #16
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
eric/10-wancarp#16
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?
Summary
The script and README describe PPPoE WANs as supported ("typically a WAN with a DHCP/PPPoE address"), but the runtime guards were only designed for and tested with DHCP. On a PPPoE WAN the MASTER branch probably keeps restarting
mpd5, and the BACKUP branch probably reportsresult=partialon every transition. This comes from reading the code; it has not been reproduced on a PPPoE box.Background
For a PPPoE interface,
$config['interfaces']['wan']['if']is the PPP device (e.g.pppoe0), soget_real_interface('wan')returnspppoe0, not the parent NIC.mpd5createspppoe0, and it is only UP and addressed once the session is established.Problem A: MASTER keeps restarting the PPPoE session
iface_is_up()/iface_is_configured()(around lines 353–395) decide whether MASTER skips the interface.iface_is_configured()already has an exception for "DHCP still waiting on a lease" (livedhclientvia/var/run/dhclient.<dev>.pid) so that duplicate events and reconciles don't restart it. PPPoE has no equivalent:mpd5is dialing, or redialing during an ISP outage,pppoe0is missing or not UP, soiface_is_up()returns false.--reconcilethen runslegacy_interface_flags()+interface_configure()again, which restartsmpd5mid-negotiation. A slow PPPoE server, or an outage longer than a minute, gives a restart loop, and each reconcile also logs the "drifted" error.Fix: in the MASTER skip decision, also treat the interface as "configured/pending" when its PPP daemon is alive. OPNsense's mpd pidfile is
/var/run/<type>_<ifkey>.pid(e.g./var/run/pppoe_wan.pid). Verify the exact path ininterfaces.inc(interface_ppps_configure/interface_ppps_reset) on current OPNsense core. Also check whatiface_is_up()should mean whenpppoe0doesn't exist yet; probably check the daemon before the UP flag for PPP-type interfaces ($config['interfaces'][$ifkey]['ipaddr']ispppoe/pptp/l2tp/ppp).Problem B: BACKUP reports
result=partialevery timeBACKUP branch (around lines 789–796):
interface_reset($ifkey)→interface_ppps_reset()killsmpd5, which most likely destroyspppoe0. The "belt-and-suspenders"ifconfig pppoe0 downthen fails ("interface does not exist"),run_cmd()sets$failed, and the END banner saysresult=partialon every BACKUP transition.Fix: skip the
ifconfig down(or treat it as success) when the device no longer exists afterinterface_reset(). For PPP interfaces, consider downing the parent NIC instead. The parent comes from$config['ppps']['ppp'][]['ports'], orinterface_ppps_hardware(), whichinterface_configure()uses to resolve$realhwif.Related
node_role()'s "VHID on a toggled interface" exclusion compares againstpppoe0, not the parent NIC. That's harmless, but worth noting if the parent device ever needs to be included.Acceptance
mpd5is dialing don't callinterface_configure()again.result=ok.[Unreleased]entry.