mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
dhcpv6: do not overwrite config in override for #2633
This provides a manual override track interface to be enabled or disabled in dhcpv6 as we do not meddle with the enable flag anymore. It's not super-useful but it makes sense to follow the enabled flag in this case. Suggested by: @marjohn56
This commit is contained in:
parent
13fb116b52
commit
96bebb13a3
@ -1104,9 +1104,10 @@ function services_dhcpdv6_configure($blacklist = array(), $verbose = false)
|
||||
$trackifname = $config['interfaces'][$ifname]['track6-interface'];
|
||||
$trackcfg = $config['interfaces'][$trackifname];
|
||||
$pdlen = calculate_ipv6_delegation_length($trackifname);
|
||||
$dhcpdv6cfg[$ifname] = array();
|
||||
$dhcpdv6cfg[$ifname]['enable'] = true;
|
||||
if (!isset($config['interfaces'][$ifname]['dhcpd6track6allowoverride']) || !isset($config['dhcpdv6'][$ifname]['enable'])) {
|
||||
if (!isset($config['interfaces'][$ifname]['dhcpd6track6allowoverride'])) {
|
||||
$dhcpdv6cfg[$ifname] = array();
|
||||
$dhcpdv6cfg[$ifname]['enable'] = true;
|
||||
|
||||
/* fixed range */
|
||||
$ifcfgipv6arr = $ifcfgipv6arr = explode(':', $ifcfgipv6);
|
||||
$ifcfgipv6arr[7] = '1000';
|
||||
@ -1136,14 +1137,10 @@ function services_dhcpdv6_configure($blacklist = array(), $verbose = false)
|
||||
}
|
||||
} else {
|
||||
/* get config entry and marry it to the live prefix */
|
||||
$dhcpdv6cfg[$ifname]['range'] = array();
|
||||
$dhcpdv6cfg[$ifname]['range']['from'] = make_ipv6_64_address($ifcfgipv6, $config['dhcpdv6'][$ifname]['range']['from']);
|
||||
$dhcpdv6cfg[$ifname]['range']['to'] = make_ipv6_64_address($ifcfgipv6, $config['dhcpdv6'][$ifname]['range']['to']);
|
||||
|
||||
$dhcpdv6cfg[$ifname]['prefixrange'] = array();
|
||||
$dhcpdv6cfg[$ifname]['prefixrange']['prefixlength'] = $config['dhcpdv6'][$ifname]['prefixrange']['prefixlength'];
|
||||
$dhcpdv6cfg[$ifname]['prefixrange']['from'] = $config['dhcpdv6'][$ifname]['prefixrange']['from'];
|
||||
$dhcpdv6cfg[$ifname]['prefixrange']['to'] = $config['dhcpdv6'][$ifname]['prefixrange']['to'];
|
||||
$dhcpdv6cfg[$ifname]['range'] = array(
|
||||
'from' => make_ipv6_64_address($ifcfgipv6, $dhcpdv6cfg[$ifname]['range']['from']),
|
||||
'to' => make_ipv6_64_address($ifcfgipv6, $dhcpdv6cfg[$ifname]['range']['to']),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1186,7 +1183,6 @@ EOD;
|
||||
$dhcpv6num = 0;
|
||||
|
||||
foreach ($dhcpdv6cfg as $dhcpv6if => $dhcpv6ifconf) {
|
||||
$ifcfgv6 = $config['interfaces'][$dhcpv6if];
|
||||
$newzone = array();
|
||||
|
||||
if (!isset($dhcpv6ifconf['enable']) || !isset($Iflist[$dhcpv6if])) {
|
||||
@ -1227,7 +1223,7 @@ EOD;
|
||||
if (is_ipaddrv6($ifcfgipv6)) {
|
||||
$dhcpdv6conf .= "\nsubnet6 {$subnetv6}/{$ifcfgsnv6}";
|
||||
} elseif (!empty($dhcpv6ifconf['range']['from'])) {
|
||||
$subnet6 = gen_subnetv6($dhcpv6ifconf['range']['from'], '64', !isset($dhcpdv6cfg[$ifname]['dhcpd6track6allowoverride']));
|
||||
$subnet6 = gen_subnetv6($dhcpv6ifconf['range']['from'], '64', !isset($config['interfaces'][$dhcpv6if]['dhcpd6track6allowoverride']));
|
||||
$dhcpdv6conf .= "\nsubnet6 {$subnet6}/64";
|
||||
}
|
||||
$dhcpdv6conf .= " {\n";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user