mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
interfaces: upon reload request also generate the $realhwif; closes #5819
This goes for all "known" devices. We need to be careful of reload loops that create a device and then reload it which could trigger another interface configure, but at the moment at least all $reload consumers are outside of the plugin device code / single action driggers. Also see: 90f471cb19
This commit is contained in:
parent
82b11d3b5f
commit
7aecb367c8
@ -2116,7 +2116,7 @@ function interfaces_addresses_flush($realif, $family = 4, $ifconfig_details = nu
|
||||
}
|
||||
}
|
||||
|
||||
function interface_configure($verbose = false, $interface = 'wan', $reload = false, $linkupevent = false)
|
||||
function interface_configure($verbose = false, $interface = 'wan', $reload = false, $linkup = false)
|
||||
{
|
||||
global $config;
|
||||
|
||||
@ -2146,6 +2146,19 @@ function interface_configure($verbose = false, $interface = 'wan', $reload = fal
|
||||
break;
|
||||
}
|
||||
|
||||
if ($reload) {
|
||||
foreach (plugins_devices() as $device) {
|
||||
if (empty($device['function']) || empty($device['names'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (in_array($realhwif, $device['names'])) {
|
||||
log_msg("Device $realhwif requires reload for $interface, configuring now", LOG_ERR);
|
||||
call_user_func_array($device['function'], [$realhwif]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ifconfig_details = legacy_interfaces_details();
|
||||
if (
|
||||
(strpos($realhwif, '/') === false && empty($ifconfig_details[$realhwif])) ||
|
||||
@ -2170,7 +2183,7 @@ function interface_configure($verbose = false, $interface = 'wan', $reload = fal
|
||||
interfaces_addresses_flush($realifv6, 6, $ifconfig_details);
|
||||
}
|
||||
|
||||
if (!$linkupevent) {
|
||||
if (!$linkup) {
|
||||
/* XXX wireless configuration: shouldn't live in interface config */
|
||||
interface_wireless_configure($realif, $wancfg);
|
||||
}
|
||||
@ -2255,13 +2268,13 @@ function interface_configure($verbose = false, $interface = 'wan', $reload = fal
|
||||
}
|
||||
break;
|
||||
case '6rd':
|
||||
interface_6rd_configure($interface, $wancfg, $reload || $linkupevent);
|
||||
interface_6rd_configure($interface, $wancfg, $reload || $linkup);
|
||||
break;
|
||||
case '6to4':
|
||||
interface_6to4_configure($interface, $wancfg, $reload || $linkupevent);
|
||||
interface_6to4_configure($interface, $wancfg, $reload || $linkup);
|
||||
break;
|
||||
case 'track6':
|
||||
interface_track6_configure($interface, $wancfg, $reload || $linkupevent);
|
||||
interface_track6_configure($interface, $wancfg, $reload || $linkup);
|
||||
break;
|
||||
default:
|
||||
if (!isset($wancfg['dhcp6usev4iface'])) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user