diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 3570f05a0..5a33801cb 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -258,21 +258,25 @@ function _interfaces_bridge_configure($bridge, $ifconfig_details = null) $section_members = explode(',', $bridge[$section] ?? ''); foreach ($members as $member => $device) { $flag = $section == 'static' ? 'sticky' : $section; - if (str_starts_with($section, 'auto') && ( + if ( + str_starts_with($section, 'auto') && ( !isset($current_members[$device]) || in_array($flag, $current_members[$device]['flags']) == in_array($member, $section_members) - )) { + ) + ) { /* in list equals off for tags starting with "auto" */ mwexecf(sprintf( "/sbin/ifconfig %s %s %s", $bridgeif, - (in_array($member, $section_members) ? '-' : ''). $flag, + (in_array($member, $section_members) ? '-' : '') . $flag, $device )); - } elseif (!str_starts_with($section, 'auto') && ( + } elseif ( + !str_starts_with($section, 'auto') && ( !isset($current_members[$device]) || in_array($flag, $current_members[$device]['flags']) != in_array($member, $section_members) - )) { + ) + ) { mwexecf(sprintf( "/sbin/ifconfig %s %s %s", $bridgeif, diff --git a/src/etc/inc/interfaces.lib.inc b/src/etc/inc/interfaces.lib.inc index a8f553647..a759b9788 100644 --- a/src/etc/inc/interfaces.lib.inc +++ b/src/etc/inc/interfaces.lib.inc @@ -508,15 +508,15 @@ function legacy_interfaces_details($intf = null) $result[$current_interface]["members"][$matches[1]] = [ "flags" => explode(",", strtolower($matches[2])) ]; - } elseif (preg_match("/\tnd6 options=\w+<(.*)>/", $line, $matches)) { + } elseif (preg_match("/\tnd6 options=\w+<(.*)>/", $line, $matches)) { $result[$current_interface]["nd6"] = [ "flags" => explode(",", strtolower($matches[1])) ]; - } elseif (preg_match("/\tid ([\w\:]+) priority (\d+) hellotime (\d+) fwddelay (\d+).*/", $line, $matches)) { + } elseif (preg_match("/\tid ([\w\:]+) priority (\d+) hellotime (\d+) fwddelay (\d+).*/", $line, $matches)) { $result[$current_interface]["priority"] = $matches[2]; $result[$current_interface]["hellotime"] = $matches[3]; $result[$current_interface]["fwddelay"] = $matches[4]; - } elseif (preg_match("/\tmaxage (\d+) holdcnt (\d+) proto (\w+) maxaddr (\d+) timeout (\d+).*/", $line, $matches)) { + } elseif (preg_match("/\tmaxage (\d+) holdcnt (\d+) proto (\w+) maxaddr (\d+) timeout (\d+).*/", $line, $matches)) { $result[$current_interface]["maxage"] = $matches[1]; $result[$current_interface]["holdcnt"] = $matches[2]; $result[$current_interface]["proto"] = $matches[3]; diff --git a/src/opnsense/scripts/interfaces/reconfigure_bridges.php b/src/opnsense/scripts/interfaces/reconfigure_bridges.php index a0a9d5b67..984b64370 100755 --- a/src/opnsense/scripts/interfaces/reconfigure_bridges.php +++ b/src/opnsense/scripts/interfaces/reconfigure_bridges.php @@ -50,4 +50,3 @@ foreach (array_keys($ifconfig_details) as $ifname) { foreach ($current_bridgeifs as $bridge) { _interfaces_bridge_configure($bridge, $ifconfig_details); } -