mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-18 02:25:05 +00:00
interfaces: prevent reading config.xml garbage
The no prefix is only applicable when 'dhcp6' IPv6 mode is set. PR: https://forum.opnsense.org/index.php?topic=35848.0
This commit is contained in:
parent
633399de85
commit
0bd1280a45
@ -4369,11 +4369,20 @@ function interfaces_addresses($interfaces, $as_subnet = false, $ifconfig_details
|
||||
function interfaces_has_prefix_only($interface)
|
||||
{
|
||||
$interfaces_a = config_read_array('interfaces');
|
||||
$ret = false;
|
||||
|
||||
return empty($interfaces_a[$interface]['adv_dhcp6_config_file_override']) &&
|
||||
((!empty($interfaces_a[$interface]['adv_dhcp6_config_advanced']) &&
|
||||
empty($interfaces_a[$interface]['adv_dhcp6_id_assoc_statement_address_enable'])) ||
|
||||
isset($interfaces_a[$interface]['dhcp6prefixonly']));
|
||||
switch ($interfaces_a[$interface]['ipaddrv6'] ?? '') {
|
||||
case 'dhcp6':
|
||||
$ret = empty($interfaces_a[$interface]['adv_dhcp6_config_file_override']) &&
|
||||
((!empty($interfaces_a[$interface]['adv_dhcp6_config_advanced']) &&
|
||||
empty($interfaces_a[$interface]['adv_dhcp6_id_assoc_statement_address_enable'])) ||
|
||||
isset($interfaces_a[$interface]['dhcp6prefixonly']));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function interfaces_primary_address($interface, $ifconfig_details = null)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user