summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/interfaces.inc46
-rw-r--r--etc/inc/services.inc4
2 files changed, 19 insertions, 31 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 0e4e4ae..b7f76bc 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -3099,21 +3099,21 @@ function interface_track6_configure($interface = "lan", $wancfg) {
}
switch($trackcfg['ipaddrv6']) {
- case "6to4":
- if ($g['debug'])
- log_error("Interface {$interface} configured via {$wancfg['track6-interface']} type {$type}");
- interface_track6_6to4_configure($interface, $wancfg);
- break;
- case "6rd":
- if ($g['debug'])
- log_error("Interface {$interface} configured via {$wancfg['track6-interface']} type {$type}");
- interface_track6_6rd_configure($interface, $wancfg);
- break;
- case "dhcp6":
- if ($g['debug'])
- log_error("Interface {$interface} configured via {$wancfg['track6-interface']} type {$type}");
- interface_track6_dhcp6_configure($interface, $wancfg);
- break;
+ case "6to4":
+ if ($g['debug'])
+ log_error("Interface {$interface} configured via {$wancfg['track6-interface']} type {$type}");
+ interface_track6_6to4_configure($interface, $wancfg);
+ break;
+ case "6rd":
+ if ($g['debug'])
+ log_error("Interface {$interface} configured via {$wancfg['track6-interface']} type {$type}");
+ interface_track6_6rd_configure($interface, $wancfg);
+ break;
+ case "dhcp6":
+ if ($g['debug'])
+ log_error("Interface {$interface} configured via {$wancfg['track6-interface']} type {$type}");
+ interface_track6_dhcp6_configure($interface, $wancfg);
+ break;
}
if (!function_exists('services_dhcpd_configure'))
@@ -4547,17 +4547,7 @@ function get_interface_subnetv6($interface = "wan")
{
global $config;
- if (is_array($config['interfaces'][$interface])) {
- switch($config['interfaces'][$interface]['ipaddrv6']) {
- case "6rd":
- case "6to4":
- $realif = "{$interface}_stf";
- break;
- default:
- $realif = get_real_interface($interface);
- break;
- }
- }
+ $realif = get_real_interface($interface, "inet6");
if (!$realif) {
if (preg_match("/^[a-z0-9]+_vip/i", $interface))
$realif = $interface;
@@ -4634,11 +4624,7 @@ function interface_has_gatewayv6($friendly) {
switch ($ifname['ipaddrv6']) {
case "slaac":
case "dhcp6":
- return true;
- break;
case "6to4":
- return true;
- break;
case "6rd":
return true;
break;
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index 81d2ee6..702ec90 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -893,7 +893,7 @@ function services_dhcpdv6_configure() {
/* we add a fake entry for interfaces that are set to track6 another WAN */
foreach ($Iflist as $ifname) {
$realif = get_real_interface($ifname);
- $ifcfgipv6 = find_interface_ipv6($realif);
+ $ifcfgipv6 = get_interface_ipv6($ifname);
if(!is_ipaddrv6($ifcfgipv6))
continue;
$ifcfgipv6 = Net_IPv6::getNetmask($ifcfgipv6, 64);
@@ -906,6 +906,7 @@ function services_dhcpdv6_configure() {
$dhcpdv6cfg[$ifname]['enable'] = true;
/* range */
$ifcfgipv6arr[7] = "1000";
+ $dhcpdv6cfg[$ifname]['range'] = array();
$dhcpdv6cfg[$ifname]['range']['from'] = Net_IPv6::compress(implode(":", $ifcfgipv6arr));
$ifcfgipv6arr[7] = "2000";
$dhcpdv6cfg[$ifname]['range']['to'] = Net_IPv6::compress(implode(":", $ifcfgipv6arr));;
@@ -914,6 +915,7 @@ function services_dhcpdv6_configure() {
$pdlenmax = $pdlen;
$pdlenhalf = $pdlenmax -1;
$pdlenmin = (64 - ceil($pdlenhalf / 4));
+ $dhcpdv6cfg[$ifname]['prefixrange'] = array();
$dhcpdv6cfg[$ifname]['prefixrange']['prefixlength'] = $pdlenmin;
/* set the delegation start to half the current address block */
OpenPOWER on IntegriCloud