summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authork-paulius <k.dash.paulius@gmail.com>2015-03-29 14:44:26 -0500
committerRenato Botelho <garga@FreeBSD.org>2015-05-30 10:25:42 -0300
commit927eecf3e31eea8ce431317664ab78e8bea524da (patch)
treefc5d71aafda672169f3bdeede13751e1a5f891b5 /etc
parentebddb93661147c9a5dd61b46d77d877afaf4bb94 (diff)
downloadpfsense-927eecf3e31eea8ce431317664ab78e8bea524da.zip
pfsense-927eecf3e31eea8ce431317664ab78e8bea524da.tar.gz
Return link-local address when we are only requesting IPv6 prefix only if there is no global IPv6 address. In some cases global SLAAC IPv6 address might be present when using DHCPv6. Fixes #4483
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/interfaces.inc24
1 files changed, 13 insertions, 11 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index c2425a0..8c4c45a 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -4852,10 +4852,6 @@ function get_interface_ipv6($interface = "wan", $flush = false) {
return null;
}
- /*
- * NOTE: On the case when only the prefix is requested,
- * the communication on WAN will be done over link-local.
- */
if (is_array($config['interfaces'][$interface])) {
switch ($config['interfaces'][$interface]['ipaddr']) {
case 'pppoe':
@@ -4866,18 +4862,24 @@ function get_interface_ipv6($interface = "wan", $flush = false) {
$realif = get_real_interface($interface, "inet6", true);
break;
}
- if (isset($config['interfaces'][$interface]['dhcp6prefixonly'])) {
- $curip = find_interface_ipv6_ll($realif, $flush);
- if ($curip && is_ipaddrv6($curip) && ($curip != "::"))
- return $curip;
- }
}
$curip = find_interface_ipv6($realif, $flush);
if ($curip && is_ipaddrv6($curip) && ($curip != "::"))
return $curip;
- else
- return null;
+ else {
+ /*
+ * NOTE: On the case when only the prefix is requested,
+ * the communication on WAN will be done over link-local.
+ */
+ if (is_array($config['interfaces'][$interface]) && isset($config['interfaces'][$interface]['dhcp6prefixonly'])) {
+ $curip = find_interface_ipv6_ll($realif, $flush);
+ if ($curip && is_ipaddrv6($curip) && ($curip != "::")) {
+ return $curip;
+ }
+ }
+ }
+ return null;
}
function get_interface_linklocal($interface = "wan") {
OpenPOWER on IntegriCloud