mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 00:07:26 +00:00
src: syle sweep
This commit is contained in:
parent
983a0663b0
commit
7b2ad791ee
@ -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,
|
||||
|
||||
@ -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];
|
||||
|
||||
@ -50,4 +50,3 @@ foreach (array_keys($ifconfig_details) as $ifname) {
|
||||
foreach ($current_bridgeifs as $bridge) {
|
||||
_interfaces_bridge_configure($bridge, $ifconfig_details);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user