Revision 909de400
Added by Ermal LUÇI over 12 years ago
etc/inc/interfaces.inc | ||
---|---|---|
4490 | 4490 |
{ |
4491 | 4491 |
global $config; |
4492 | 4492 |
|
4493 |
$realif = get_failover_interface($interface); |
|
4494 |
if (is_array($config['interfaces'][$interface])) { |
|
4495 |
switch($config['interfaces'][$interface]['ipaddrv6']) { |
|
4496 |
case "6rd": |
|
4497 |
case "6to4": |
|
4498 |
$realif = "{$interface}_stf"; |
|
4499 |
break; |
|
4500 |
} |
|
4501 |
} |
|
4493 |
$realif = get_failover_interface($interface, "inet6"); |
|
4502 | 4494 |
if (!$realif) { |
4503 | 4495 |
if (preg_match("/^[a-z0-9]+_vip/i", $interface)) |
4504 | 4496 |
$realif = $interface; |
... | ... | |
4928 | 4920 |
return 0; |
4929 | 4921 |
} |
4930 | 4922 |
|
4931 |
function get_failover_interface($interface) { |
|
4923 |
function get_failover_interface($interface, $family = "all") {
|
|
4932 | 4924 |
global $config; |
4933 | 4925 |
/* shortcut to get_real_interface if we find it in the config */ |
4934 | 4926 |
if(is_array($config['interfaces'][$interface])) { |
4935 |
$wanif = get_real_interface($interface); |
|
4927 |
$wanif = get_real_interface($interface, $family);
|
|
4936 | 4928 |
return $wanif; |
4937 | 4929 |
} |
4938 | 4930 |
|
... | ... | |
4948 | 4940 |
return $wanif; |
4949 | 4941 |
} |
4950 | 4942 |
/* fall through to get_real_interface */ |
4951 |
$wanif = get_real_interface($interface); |
|
4943 |
$wanif = get_real_interface($interface, $family);
|
|
4952 | 4944 |
return $wanif; |
4953 | 4945 |
} |
4954 | 4946 |
|
Also available in: Unified diff
Try to remove as much as possible _stf special case through the code