mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 09:04:39 +00:00
dhcpd: take into account that multple ia-pd can be delegated #7484
This commit is contained in:
parent
3d05730983
commit
a45daec4ab
@ -2,7 +2,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2022-2023 Franco Fichtner <franco@opnsense.org>
|
||||
* Copyright (C) 2022-2024 Franco Fichtner <franco@opnsense.org>
|
||||
* Copyright (C) 2012 Seth Mos <seth.mos@dds.nl>
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -61,7 +61,10 @@ foreach (new SplFileObject($leases_file) as $line) {
|
||||
break;
|
||||
case 'ia-pd':
|
||||
if (!empty($ia_pd) && !empty($active)) {
|
||||
$duid_arr[$duid]['prefix'] = $ia_pd;
|
||||
if (empty($duid_arr[$duid]['prefix'])) {
|
||||
$duid_arr[$duid]['prefix'] = [];
|
||||
}
|
||||
$duid_arr[$duid]['prefix'][] = $ia_pd;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -115,8 +118,10 @@ if (!empty($dhcpd_log)) {
|
||||
/* collect active leases */
|
||||
foreach ($duid_arr as $entry) {
|
||||
if (!empty($entry['prefix']) && !empty($entry['address'])) {
|
||||
/* new or reassigned takes priority */
|
||||
$routes[$entry['prefix']] = $entry['address'];
|
||||
foreach ($entry['prefix'] as $prefix) {
|
||||
/* new or reassigned takes priority */
|
||||
$routes[$prefix] = $entry['address'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user