Commit 4590b17d authored by Franco Fichtner's avatar Franco Fichtner

system: crash-reported delete race, also move deletion out of conditional

parent a9f41407
......@@ -480,9 +480,13 @@ 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) {
if (isset($gateway['defaultgw'])) {
if ($gateway['ipprotocol'] != "inet6" && (is_ipaddrv4($gateway['gateway']) || $gateway['gateway'] == "dynamic")) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment