summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/services.inc27
-rw-r--r--usr/local/www/services_dhcpv6.php15
-rw-r--r--usr/local/www/services_dhcpv6_edit.php2
3 files changed, 34 insertions, 10 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index b65c0fc..d4ad63a 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -96,7 +96,18 @@ function services_rtadvd_configure() {
$rtadvdconf .= "{$realif}:\\\n";
$rtadvdconf .= "\t:addr=\"{$subnetv6}\":\\\n";
$rtadvdconf .= "\t:prefixlen#{$ifcfgsnv6}:\\\n";
- $rtadvdconf .= "\t:raflags#192:\n";
+ switch($dhcpv6ifconf['mode']) {
+ case "managed":
+ $rtadvdconf .= "\t:raflags#64:\n";
+ break;
+ case "assist":
+ $rtadvdconf .= "\t:raflags#192:\n";
+ break;
+ default:
+ $rtadvdconf .= "\t:raflags#0:\n";
+ break;
+
+ }
$rtadvdconf .= "\n";
}
@@ -697,13 +708,13 @@ EOD;
}
*/
- $realif = escapeshellcmd(get_real_interface($dhcpv6if));
- $dhcpdv6ifs[] = $realif;
- /* Create link local address for bridges */
- if(stristr("$realif", "bridge")) {
- exec("ifconfig {$realif}|awk '/ether/ {print \$2}'", $mac);
- $autoaddress = generate_ipv6_from_mac(trim($mac[0]));
- mwexec("$ifconfig {$realif} inet6 fe80::{autoaddress}/64");
+ if($config['dhcpdv6'][$dhcpv6if]['mode'] <> "unmanaged") {
+ $realif = escapeshellcmd(get_real_interface($dhcpv6if));
+ $dhcpdv6ifs[] = $realif;
+ /* Create link local address for bridges */
+ if(stristr("$realif", "bridge")) {
+ mwexec("$ifconfig {$realif} inet6 fe80::/64 eui64");
+ }
}
}
diff --git a/usr/local/www/services_dhcpv6.php b/usr/local/www/services_dhcpv6.php
index 7d00b0c..701d87e 100644
--- a/usr/local/www/services_dhcpv6.php
+++ b/usr/local/www/services_dhcpv6.php
@@ -138,6 +138,7 @@ if (is_array($config['dhcpdv6'][$if])){
$pconfig['range_from'] = $config['dhcpdv6'][$if]['range']['from'];
$pconfig['range_to'] = $config['dhcpdv6'][$if]['range']['to'];
}
+ $pconfig['mode'] = $config['dhcpdv6'][$if]['mode'];
$pconfig['deftime'] = $config['dhcpdv6'][$if]['defaultleasetime'];
$pconfig['maxtime'] = $config['dhcpdv6'][$if]['maxleasetime'];
$pconfig['gateway'] = $config['dhcpdv6'][$if]['gateway'];
@@ -190,6 +191,8 @@ function is_inrange($test, $start, $end) {
return false;
}
+$modes = array("unmanaged" => "Unmanaged", "managed" => "Managed", "assist" => "Assisted");
+
if ($_POST) {
unset($input_errors);
@@ -304,6 +307,7 @@ if ($_POST) {
if (!is_array($config['dhcpdv6'][$if]['range']))
$config['dhcpdv6'][$if]['range'] = array();
+ $config['dhcpdv6'][$if]['mode'] = $_POST['mode'];
$config['dhcpdv6'][$if]['range']['from'] = $_POST['range_from'];
$config['dhcpdv6'][$if]['range']['to'] = $_POST['range_to'];
$config['dhcpdv6'][$if]['defaultleasetime'] = $_POST['deftime'];
@@ -415,7 +419,7 @@ include("head.inc");
<script type="text/javascript" language="JavaScript">
function enable_change(enable_over) {
var endis;
- endis = !(document.iform.enable.checked || enable_over);
+ endis = !(document.iform.enable.checked || enable_over || (document.iform.mode.select == "unmanaged"));
document.iform.range_from.disabled = endis;
document.iform.range_to.disabled = endis;
document.iform.dns1.disabled = endis;
@@ -536,6 +540,15 @@ include("head.inc");
"interface"),htmlspecialchars($iflist[$if]));?></strong></td>
</tr>
<tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Operating Mode");?></td>
+ <td width="78%" class="vtable">
+ <select name="mode" id="mode">
+ <?php foreach($modes as $name => $value) { ?>
+ <option value="<?=$name ?>" <?php if ($pconfig['mode'] == $name) echo "selected"; ?> > <?=$value ?></option>
+ <?php } ?>
+ <strong><?php printf(gettext("Select the Operating Mode. Use Unmanaged for Router Advertising only, Managed for DHCPv6 only, Assisted for Combined"));?></strong></td>
+ </tr>
+ <tr>
<td width="22%" valign="top" class="vtable">&nbsp;</td>
<td width="78%" class="vtable">
<input name="denyunknown" id="denyunknown" type="checkbox" value="yes" <?php if ($pconfig['denyunknown']) echo "checked"; ?>>
diff --git a/usr/local/www/services_dhcpv6_edit.php b/usr/local/www/services_dhcpv6_edit.php
index bc51f83..5ff0dcf 100644
--- a/usr/local/www/services_dhcpv6_edit.php
+++ b/usr/local/www/services_dhcpv6_edit.php
@@ -48,7 +48,7 @@ function staticmapcmp($a, $b) {
function staticmaps_sort($ifgui) {
global $g, $config;
- usort($config['dhcpd'][$ifgui]['staticmap'], "staticmapcmp");
+ usort($config['dhcpdv6'][$ifgui]['staticmap'], "staticmapcmp");
}
require_once('globals.inc');
OpenPOWER on IntegriCloud