From bd942860594ecf3383ac39eb203ce3c73d4c59d2 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 17 Feb 2014 12:19:41 -0300 Subject: Use correct parameter (bootfile-url) to configure netboot on DHCPdv6, it fixes #3421 --- etc/inc/services.inc | 13 +++++-------- usr/local/www/services_dhcpv6.php | 27 +++++++-------------------- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/etc/inc/services.inc b/etc/inc/services.inc index f6078bc..b778e7a 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -1042,6 +1042,9 @@ function services_dhcpdv6_configure() { } } + if(isset($dhcpv6ifconf['netboot']) && !empty($dhcpv6ifconf['bootfile_url'])) + $custoptionsv6 .= "option dhcp6.bootfile-url code 59 = string;\n"; + $dhcpdv6conf = << "") { - $dhcpdv6conf .= " next-server {$dhcpv6ifconf['nextserver']};\n"; - } - if ($dhcpv6ifconf['filename'] <> "") { - $dhcpdv6conf .= " filename \"{$dhcpv6ifconf['filename']}\";\n"; - } - if ($dhcpv6ifconf['rootpath'] <> "") { - $dhcpdv6conf .= " option root-path \"{$dhcpv6ifconf['rootpath']}\";\n"; + if (!empty($dhcpv6ifconf['bootfile_url'])) { + $dhcpdv6conf .= " option dhcp6.bootfile-url \"{$dhcpv6ifconf['bootfile_url']}\";\n"; } } diff --git a/usr/local/www/services_dhcpv6.php b/usr/local/www/services_dhcpv6.php index b123e12..e9e9b8d 100644 --- a/usr/local/www/services_dhcpv6.php +++ b/usr/local/www/services_dhcpv6.php @@ -117,9 +117,7 @@ if (is_array($config['dhcpdv6'][$if])){ $pconfig['tftp'] = $config['dhcpdv6'][$if]['tftp']; $pconfig['ldap'] = $config['dhcpdv6'][$if]['ldap']; $pconfig['netboot'] = isset($config['dhcpdv6'][$if]['netboot']); - $pconfig['nextserver'] = $config['dhcpdv6'][$if]['nextserver']; - $pconfig['filename'] = $config['dhcpdv6'][$if]['filename']; - $pconfig['rootpath'] = $config['dhcpdv6'][$if]['rootpath']; + $pconfig['bootfile_url'] = $config['dhcpdv6'][$if]['bootfile_url']; $pconfig['netmask'] = $config['dhcpdv6'][$if]['netmask']; $pconfig['numberoptions'] = $config['dhcpdv6'][$if]['numberoptions']; $pconfig['dhcpv6leaseinlocaltime'] = $config['dhcpdv6'][$if]['dhcpv6leaseinlocaltime']; @@ -216,8 +214,8 @@ if ($_POST) { $input_errors[] = gettext("A valid domain name must be specified for the DNS domain."); if ($_POST['tftp'] && !is_ipaddr($_POST['tftp']) && !is_domain($_POST['tftp']) && !is_URL($_POST['tftp'])) $input_errors[] = gettext("A valid IPv6 address or hostname must be specified for the TFTP server."); - if (($_POST['nextserver'] && !is_ipaddrv6($_POST['nextserver']))) - $input_errors[] = gettext("A valid IPv6 address must be specified for the network boot server."); + if (($_POST['bootfile_url'] && !is_URL($_POST['bootfile_url']))) + $input_errors[] = gettext("A valid URL must be specified for the network bootfile."); // Disallow a range that includes the virtualip if (is_array($config['virtualip']['vip'])) { @@ -316,9 +314,7 @@ if ($_POST) { $config['dhcpdv6'][$if]['tftp'] = $_POST['tftp']; $config['dhcpdv6'][$if]['ldap'] = $_POST['ldap']; $config['dhcpdv6'][$if]['netboot'] = ($_POST['netboot']) ? true : false; - $config['dhcpdv6'][$if]['nextserver'] = $_POST['nextserver']; - $config['dhcpdv6'][$if]['filename'] = $_POST['filename']; - $config['dhcpdv6'][$if]['rootpath'] = $_POST['rootpath']; + $config['dhcpdv6'][$if]['bootfile_url'] = $_POST['bootfile_url']; $config['dhcpdv6'][$if]['dhcpv6leaseinlocaltime'] = $_POST['dhcpv6leaseinlocaltime']; // Handle the custom options rowhelper @@ -416,9 +412,7 @@ include("head.inc"); //document.iform.tftp.disabled = endis; document.iform.ldap.disabled = endis; document.iform.netboot.disabled = endis; - document.iform.nextserver.disabled = endis; - document.iform.filename.disabled = endis; - document.iform.rootpath.disabled = endis; + document.iform.bootfile_url.disabled = endis; } function show_shownumbervalue() { @@ -753,15 +747,8 @@ display_top_tabs($tab_array);

- - - -
- -

- - -
- + + -- cgit v1.1