mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
dhcp: we seem to keep repairing this script... #5876
'prefix' was never a key so this got never executed for whatever reason. It remains broken in other projects and the question is if this script really has any useful value.
This commit is contained in:
parent
868c9531cd
commit
5ce587cee8
@ -75,17 +75,16 @@ foreach (new SplFileObject($leases_file) as $line) {
|
||||
}
|
||||
|
||||
$routes = [];
|
||||
|
||||
foreach ($duid_arr as $entry) {
|
||||
if (!empty($entry['ia-pd']) && !empty($entry['ia-na'])) {
|
||||
$routes[$entry['ia-na']] = $entry['ia-pd'];
|
||||
}
|
||||
}
|
||||
|
||||
if (count($routes) > 0) {
|
||||
foreach ($routes as $address => $prefix) {
|
||||
mwexecf('/sbin/route delete -inet6 %s %s', [$prefix, $address], true);
|
||||
mwexecf('/sbin/route add -inet6 %s %s', [$prefix, $address]);
|
||||
}
|
||||
foreach ($routes as $address => $prefix) {
|
||||
mwexecf('/sbin/route delete -inet6 %s %s', [$prefix, $address], true);
|
||||
mwexecf('/sbin/route add -inet6 %s %s', [$prefix, $address]);
|
||||
}
|
||||
|
||||
$dhcpd_log = trim(shell_exec('opnsense-log -n dhcpd'));
|
||||
@ -100,14 +99,10 @@ foreach (new SplFileObject($dhcpd_log) as $line) {
|
||||
if (in_array($expire[1], $routes)) {
|
||||
continue;
|
||||
}
|
||||
$expires[$expire[1]] = $expire[1];
|
||||
$expires[$expire[1]] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (count($expires) > 0) {
|
||||
foreach ($expires as $prefix) {
|
||||
if (isset($prefix['prefix'])) {
|
||||
mwexecf('/sbin/route delete -inet6 %s', [$prefix['prefix']], true);
|
||||
}
|
||||
}
|
||||
foreach (array_keys($expires) as $prefix) {
|
||||
mwexecf('/sbin/route delete -inet6 %s', [$prefix], true);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user