summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/interfaces.inc35
-rwxr-xr-xetc/rc.newwanip4
-rwxr-xr-xetc/rc.newwanipv66
3 files changed, 31 insertions, 14 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 9f3d42a..d085ac3 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -3878,7 +3878,7 @@ function interface_get_wireless_clone($wlif) {
}
}
-function get_real_interface($interface = "wan") {
+function get_real_interface($interface = "wan", $family = "all") {
global $config, $g;
$wanif = NULL;
@@ -3918,13 +3918,28 @@ function get_real_interface($interface = "wan") {
$cfg = &$config['interfaces'][$interface];
- // Wireless cloned NIC support (FreeBSD 8+)
- // interface name format: $parentnic_wlanparentnic#
- // example: ath0_wlan0
- if( is_array($cfg['wireless']) || preg_match($g['wireless_regex'], $cfg['if']))
- $wanif = interface_get_wireless_clone($cfg['if']);
- else
- $wanif = $cfg['if'];
+ if ($family == "inet6") {
+ switch ($cfg['ipaddrv6']) {
+ case "6rd":
+ case "6to4":
+ $wanif = "{$interface}_stf";
+ break;
+ default:
+ if( is_array($cfg['wireless']) || preg_match($g['wireless_regex'], $cfg['if']))
+ $wanif = interface_get_wireless_clone($cfg['if']);
+ else
+ $wanif = $cfg['if'];
+ break;
+ }
+ } else {
+ // Wireless cloned NIC support (FreeBSD 8+)
+ // interface name format: $parentnic_wlanparentnic#
+ // example: ath0_wlan0
+ if( is_array($cfg['wireless']) || preg_match($g['wireless_regex'], $cfg['if']))
+ $wanif = interface_get_wireless_clone($cfg['if']);
+ else
+ $wanif = $cfg['if'];
+ }
break;
}
@@ -4471,7 +4486,7 @@ function get_interface_ip($interface = "wan")
return null;
}
-function get_interface_ipv6($interface = "wan")
+function get_interface_ipv6($interface = "wan", $flush = false)
{
global $config;
@@ -4491,7 +4506,7 @@ function get_interface_ipv6($interface = "wan")
return null;
}
- $curip = find_interface_ipv6($realif);
+ $curip = find_interface_ipv6($realif, $flush);
if ($curip && is_ipaddrv6($curip) && ($curip != "::"))
return $curip;
else
diff --git a/etc/rc.newwanip b/etc/rc.newwanip
index 156c8f1..4d0ecf3 100755
--- a/etc/rc.newwanip
+++ b/etc/rc.newwanip
@@ -125,6 +125,10 @@ if ($interface == "lan")
/* check tunneled IPv6 interface tracking */
switch($config['interfaces'][$interface]['ipaddrv6']) {
+ case "slaac":
+ case "dhcp6":
+ interface_dhcpv6_configure($interface, $config['interfaces'][$interface]);
+ break;
case "6to4":
interface_6to4_configure($interface, $config['interfaces'][$interface]);
break;
diff --git a/etc/rc.newwanipv6 b/etc/rc.newwanipv6
index 8204af1..e103c55 100755
--- a/etc/rc.newwanipv6
+++ b/etc/rc.newwanipv6
@@ -69,13 +69,11 @@ sleep(5);
if(empty($argument)) {
$interface = "wan";
$interface_real = get_real_interface($interface);
- $curwanipv6 = get_interface_ipv6($interface);
+ $curwanipv6 = get_interface_ipv6($interface, true);
} else {
$interface_real = $argument;
$interface = convert_real_interface_to_friendly_interface_name($interface_real);
- $curwanipv6 = find_interface_ipv6($interface_real, true);
- if (empty($curwanipv6))
- $curwanipv6 = get_interface_ipv6($interface);
+ $curwanipv6 = get_interface_ipv6($interface, true);
}
if (empty($interface)) {
OpenPOWER on IntegriCloud