summaryrefslogtreecommitdiffstats
path: root/src/etc/inc
diff options
context:
space:
mode:
authorLuiz Otavio O Souza <luiz@netgate.com>2015-11-24 19:58:58 -0600
committerLuiz Otavio O Souza <luiz@netgate.com>2015-11-24 19:58:58 -0600
commit5eb59cee0eef140913323c7f48a2639154070964 (patch)
tree8fe7537794ce1d4749f729acc903d3fdc6912597 /src/etc/inc
parent7cc0a76b0d0f10198861e5c305c16389e1e664db (diff)
downloadpfsense-5eb59cee0eef140913323c7f48a2639154070964.zip
pfsense-5eb59cee0eef140913323c7f48a2639154070964.tar.gz
Fix get_interface_ip() to not return an IPv4 for a link-local request.
Fix get_interface_ipv6() to check for link-local prefix in original interface. This fixes the generated unbound config, now it is possible to specify link-local addresses. Ticket #4021
Diffstat (limited to 'src/etc/inc')
-rw-r--r--src/etc/inc/interfaces.inc13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc
index 272f8de..64f5d91 100644
--- a/src/etc/inc/interfaces.inc
+++ b/src/etc/inc/interfaces.inc
@@ -5267,12 +5267,11 @@ function get_interface_ip($interface = "wan") {
return null;
}
- if (substr($realif, 0, 4) == '_vip') {
+ if (substr($interface, 0, 4) == '_vip') {
return get_configured_carp_interface_list($realif, 'inet', 'ip');
- }
-
- if (strstr($realif, "_vip")) {
- return get_configured_carp_interface_list($realif);
+ } else if (substr($interface, 0, 5) == '_lloc') {
+ /* No link-local address for v4. */
+ return null;
}
$curip = find_interface_ip($realif);
@@ -5291,9 +5290,9 @@ function get_interface_ipv6($interface = "wan", $flush = false) {
return null;
}
- if (substr($realif, 0, 4) == '_vip') {
+ if (substr($interface, 0, 4) == '_vip') {
return get_configured_carp_interface_list($realif, 'inet6', 'ip');
- } else if (substr($realif, 0, 5) == '_lloc') {
+ } else if (substr($interface, 0, 5) == '_lloc') {
return get_interface_linklocal($interface);
}
OpenPOWER on IntegriCloud