BACKUP branch: interface_configure() after unsetting enable is a no-op #17
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#17
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
In the BACKUP branch, the
interface_configure()call that followsunset($config['interfaces'][$ifkey]['enable'])returns immediately and does nothing. The comment and dry-run text suggest it does real work.Where
10-wancarp, BACKUP branch (around lines 789–799):and the dry-run line
"DRYRUN: would interface_reset('{$ifkey}'), unset enable (in-memory), interface_configure(), ifconfig {$realif} down."Why it's a no-op
Current OPNsense core (
src/etc/inc/interfaces.inc,interface_configure()) begins with:config_read_array()reads the global$config(config.inc), so after theunsetthe function returns before the$reloadhandling or anything else.Fix
Either:
unset+interface_configure()lines and update the dry-run message and any header/README text that lists it (README "On BACKUP: resets each interface, forces the link down, ..." is already accurate), orBefore removing it, check that nothing later in the same process relies on
enablebeing unset in memory. Nothing in this script does, butinterface_reset()andsystem_routing_configure()read$config. Keeping only theunset(to stop in-process routing code from treating WAN as enabled) is a reasonable middle ground.Acceptance
php -lpasses; behaviour unchanged on a live BACKUP transition (WAN down,result=ok).[Unreleased]entry.