Add reference instead of copying also remove bogus comment and code that relies on interfaces named carp which should not happen anymore.

This commit is contained in:
Ermal 2010-08-03 11:41:15 +00:00
parent b635c0601c
commit 9fd16ce49e

View File

@ -2535,18 +2535,10 @@ function convert_real_interface_to_friendly_interface_name($interface = "wan") {
return $vip['interface'];
}
}
} else if (stristr($interface, "carp")) {
$index = intval(substr($interface, 4));
foreach ($config['virtualip']['vip'] as $counter => $vip) {
if ($vip['mode'] == "carpdev-dhcp" || $vip['mode'] == "carp") {
if ($index == $counter)
return $vip['interface'];
}
}
}
/* XXX: For speed reasons reference directly the interface array */
$ifdescrs = $config['interfaces'];
$ifdescrs =& $config['interfaces'];
//$ifdescrs = get_configured_interface_list(false, true);
foreach ($ifdescrs as $if => $ifname) {
@ -2556,7 +2548,6 @@ function convert_real_interface_to_friendly_interface_name($interface = "wan") {
if (get_real_interface($if) == $interface)
return $if;
/* XXX: ermal - The 3 lines below are totally bogus code. */
$int = interface_translate_type_to_real($if);
if ($int == $interface)
return $ifname;