Skip to content

Commit

Permalink
interfaces: fix ambiguity in get_parent_interface()
Browse files Browse the repository at this point in the history
So having changed get_real_interface() to not check edge cases
for existing interfaces has bubbled up this check to the caller
get_parent_interface() which in turn made the check global.

The problem is that get_parent_interface() ran a hypothentical
code path through get_real_interface() and subsequently now
fails for dailup types leaving an empty interface.

That in turn caused some other refactoring to break where
individual device functions would take an argument or reload
all interfaces.  Now that dailup fiddles with get_parent_interface()
and overwrites the result of get_real_interface() in the main
interface_configure() run it would reconfigure previously
configured devices stripping their IP configuration in the
process.

Yikes!  :)

PR: https://forum.opnsense.org/index.php?topic=13442.0
  • Loading branch information
fichtner committed Jul 11, 2019
1 parent b2294ea commit 6ae3566
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/etc/inc/interfaces.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3588,9 +3588,6 @@ function get_parent_interface($interface, $avoidrecurse = false)
$parents = array();

$realif = get_real_interface($interface);
if (!does_interface_exist($realif)) {
return $parents;
}

// If we got a real interface, find it's friendly assigned name
if ($interface == $realif && $avoidrecurse == false) {
Expand Down

0 comments on commit 6ae3566

Please sign in to comment.