src: syle sweep

This commit is contained in:
Franco Fichtner 2025-04-09 13:16:51 +02:00
parent 983a0663b0
commit 7b2ad791ee
3 changed files with 12 additions and 9 deletions

View File

@ -258,10 +258,12 @@ 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",
@ -269,10 +271,12 @@ function _interfaces_bridge_configure($bridge, $ifconfig_details = null)
(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,

View File

@ -50,4 +50,3 @@ foreach (array_keys($ifconfig_details) as $ifname) {
foreach ($current_bridgeifs as $bridge) {
_interfaces_bridge_configure($bridge, $ifconfig_details);
}