mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
dhcp6c Advanced Config prefix interface
Currently, when using dhcp6c advanced configuration the prefix interface is WAN, this is not very useful!
The changes here allow the user to select the interface that the PD will be applied on..
(cherry picked from commit 58a185aede)
This commit is contained in:
parent
1528ee4e95
commit
ccf8bd86b8
@ -4168,10 +4168,11 @@ function DHCP6_Config_File_Advanced($interface, $wancfg, $wanif) {
|
||||
}
|
||||
$id_assoc_statement_prefix .= ";";
|
||||
}
|
||||
|
||||
|
||||
$realif = get_real_interface($wancfg['adv_dhcp6_prefix_selected_interface']);
|
||||
if (is_numeric($wancfg['adv_dhcp6_prefix_interface_statement_sla_id'])) {
|
||||
$id_assoc_statement_prefix .= "\n\tprefix-interface";
|
||||
$id_assoc_statement_prefix .= " {$wanif}";
|
||||
$id_assoc_statement_prefix .= " {$realif}";
|
||||
$id_assoc_statement_prefix .= " {\n";
|
||||
$id_assoc_statement_prefix .= "\t\tsla-id {$wancfg['adv_dhcp6_prefix_interface_statement_sla_id']};\n";
|
||||
if (($wancfg['adv_dhcp6_prefix_interface_statement_sla_len'] >= 0) &&
|
||||
|
||||
@ -121,6 +121,7 @@ if (!is_array($config['gateways']['gateway_item'])) {
|
||||
|
||||
$a_gateways = &$config['gateways']['gateway_item'];
|
||||
|
||||
$interfaces = get_configured_interface_with_descr();
|
||||
$wancfg = &$config['interfaces'][$if];
|
||||
$old_wancfg = $wancfg;
|
||||
$old_wancfg['realif'] = get_real_interface($if);
|
||||
@ -259,6 +260,7 @@ $pconfig['adv_dhcp6_id_assoc_statement_prefix_vltime'] = $wancfg['adv_dhcp6_id_a
|
||||
|
||||
$pconfig['adv_dhcp6_prefix_interface_statement_sla_id'] = $wancfg['adv_dhcp6_prefix_interface_statement_sla_id'];
|
||||
$pconfig['adv_dhcp6_prefix_interface_statement_sla_len'] = $wancfg['adv_dhcp6_prefix_interface_statement_sla_len'];
|
||||
$pconfig['adv_dhcp6_prefix_selected_interface'] = $wancfg['adv_dhcp6_prefix_selected_interface'];
|
||||
|
||||
$pconfig['adv_dhcp6_authentication_statement_authname'] = $wancfg['adv_dhcp6_authentication_statement_authname'];
|
||||
$pconfig['adv_dhcp6_authentication_statement_protocol'] = $wancfg['adv_dhcp6_authentication_statement_protocol'];
|
||||
@ -1085,6 +1087,7 @@ if ($_POST['apply']) {
|
||||
|
||||
unset($wancfg['adv_dhcp6_prefix_interface_statement_sla_id']);
|
||||
unset($wancfg['adv_dhcp6_prefix_interface_statement_sla_len']);
|
||||
unset($wancfg['adv_dhcp6_prefix_selected_interface']);
|
||||
|
||||
unset($wancfg['adv_dhcp6_authentication_statement_authname']);
|
||||
unset($wancfg['adv_dhcp6_authentication_statement_protocol']);
|
||||
@ -1348,7 +1351,9 @@ if ($_POST['apply']) {
|
||||
if (is_numericint($_POST['adv_dhcp6_prefix_interface_statement_sla_len'])) {
|
||||
$wancfg['adv_dhcp6_prefix_interface_statement_sla_len'] = $_POST['adv_dhcp6_prefix_interface_statement_sla_len'];
|
||||
}
|
||||
|
||||
if (!empty($_POST['adv_dhcp6_prefix_selected_interface'])) {
|
||||
$wancfg['adv_dhcp6_prefix_selected_interface'] = $_POST['adv_dhcp6_prefix_selected_interface'];
|
||||
}
|
||||
if (!empty($_POST['adv_dhcp6_authentication_statement_authname'])) {
|
||||
$wancfg['adv_dhcp6_authentication_statement_authname'] = $_POST['adv_dhcp6_authentication_statement_authname'];
|
||||
}
|
||||
@ -2361,6 +2366,14 @@ $group->add(new Form_Input(
|
||||
|
||||
$section->add($group);
|
||||
|
||||
$group = new Form_Group('Select prefix interface');
|
||||
$section->addInput(new Form_Select(
|
||||
'adv_dhcp6_prefix_selected_interface',
|
||||
'Prefix Interface',
|
||||
$pconfig['adv_dhcp6_prefix_selected_interface'],
|
||||
$interfaces
|
||||
))->setHelp('Select the interface on which to apply the prefix delegation.');
|
||||
|
||||
$group = new Form_Group('Authentication statement');
|
||||
|
||||
$group->add(new Form_Input(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user