Revision 927eecf3
Added by k-paulius about 10 years ago
etc/inc/interfaces.inc | ||
---|---|---|
4852 | 4852 |
return null; |
4853 | 4853 |
} |
4854 | 4854 |
|
4855 |
/* |
|
4856 |
* NOTE: On the case when only the prefix is requested, |
|
4857 |
* the communication on WAN will be done over link-local. |
|
4858 |
*/ |
|
4859 | 4855 |
if (is_array($config['interfaces'][$interface])) { |
4860 | 4856 |
switch ($config['interfaces'][$interface]['ipaddr']) { |
4861 | 4857 |
case 'pppoe': |
... | ... | |
4866 | 4862 |
$realif = get_real_interface($interface, "inet6", true); |
4867 | 4863 |
break; |
4868 | 4864 |
} |
4869 |
if (isset($config['interfaces'][$interface]['dhcp6prefixonly'])) { |
|
4870 |
$curip = find_interface_ipv6_ll($realif, $flush); |
|
4871 |
if ($curip && is_ipaddrv6($curip) && ($curip != "::")) |
|
4872 |
return $curip; |
|
4873 |
} |
|
4874 | 4865 |
} |
4875 | 4866 |
|
4876 | 4867 |
$curip = find_interface_ipv6($realif, $flush); |
4877 | 4868 |
if ($curip && is_ipaddrv6($curip) && ($curip != "::")) |
4878 | 4869 |
return $curip; |
4879 |
else |
|
4880 |
return null; |
|
4870 |
else { |
|
4871 |
/* |
|
4872 |
* NOTE: On the case when only the prefix is requested, |
|
4873 |
* the communication on WAN will be done over link-local. |
|
4874 |
*/ |
|
4875 |
if (is_array($config['interfaces'][$interface]) && isset($config['interfaces'][$interface]['dhcp6prefixonly'])) { |
|
4876 |
$curip = find_interface_ipv6_ll($realif, $flush); |
|
4877 |
if ($curip && is_ipaddrv6($curip) && ($curip != "::")) { |
|
4878 |
return $curip; |
|
4879 |
} |
|
4880 |
} |
|
4881 |
} |
|
4882 |
return null; |
|
4881 | 4883 |
} |
4882 | 4884 |
|
4883 | 4885 |
function get_interface_linklocal($interface = "wan") { |
Also available in: Unified diff
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