mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 17:44:41 +00:00
system: crash-reported delete race, also move deletion out of conditional
This commit is contained in:
parent
a9f41407a9
commit
4590b17dd2
@ -480,10 +480,14 @@ function system_routing_configure($interface = '')
|
||||
$foundgwv6 = false;
|
||||
$fargw = false;
|
||||
|
||||
/* XXX eventually this file-based workaround must be removed */
|
||||
foreach (glob('/tmp/*_defaultgw{,v6}', GLOB_BRACE) as $to_delete) {
|
||||
@unlink($to_delete);
|
||||
}
|
||||
|
||||
/* tack on all the hard defined gateways as well */
|
||||
if (isset($config['gateways']['gateway_item'])) {
|
||||
array_map('unlink', glob('/tmp/*_defaultgw{,v6}', GLOB_BRACE));
|
||||
foreach ($config['gateways']['gateway_item'] as $gateway) {
|
||||
foreach ($config['gateways']['gateway_item'] as $gateway) {
|
||||
if (isset($gateway['defaultgw'])) {
|
||||
if ($gateway['ipprotocol'] != "inet6" && (is_ipaddrv4($gateway['gateway']) || $gateway['gateway'] == "dynamic")) {
|
||||
if(strstr($gateway['gateway'], ":")) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user