summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-03-14 21:57:01 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-03-14 21:57:01 +0000
commit303831c699a29280fd39218efcc5058a9bec65a9 (patch)
tree9052944c009fbc3dacc013a82aa951edaa147fc6 /etc
parent58d58eb10d2e5db217fd8c781dde3890bce22c64 (diff)
downloadpfsense-303831c699a29280fd39218efcc5058a9bec65a9.zip
pfsense-303831c699a29280fd39218efcc5058a9bec65a9.tar.gz
*REALLY* convert LAN and WAN to their real interface.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/pfsense-utils.inc21
1 files changed, 10 insertions, 11 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 00f86d9..e8a8f46 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -516,16 +516,16 @@ function execute_command_return_output($command) {
function convert_friendly_interface_to_real_interface_name($interface) {
global $config;
$lc_interface = strtolower($interface);
- if($config['interfaces'][$interface]['if'] <> "")
- return $config['interfaces'][$interface]['if'];
+ if($lc_interface == "lan") return $config['interfaces']['lan']['if'];
+ if($lc_interface == "wan") return $config['interfaces']['wan']['if'];
$i = 0;
- $ifdescrs = array('wan','lan');
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
- $ifdescrs['opt' . $j] = "opt" . $j;
- }
+ $ifdescrs = array();
+ for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++)
+ $ifdescrs['opt' . $j] = "opt" . $j;
foreach ($ifdescrs as $ifdescr => $ifname) {
- if($config['interfaces'][$ifname]['descr'] == $lc_interface or
- $config['interfaces'][$ifname]['descr'] == $interface)
+ if(strtolower($ifname) == $lc_interface)
+ return $config['interfaces'][$ifname]['if'];
+ if(strtolower($config['interfaces'][$ifname]['descr']) == $lc_interface)
return $config['interfaces'][$ifname]['if'];
}
return $interface;
@@ -538,9 +538,8 @@ function convert_real_interface_to_friendly_interface_name($interface) {
global $config;
$i = 0;
$ifdescrs = array('wan', 'lan');
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
- $ifdescrs['opt' . $j] = "opt" . $j;
- }
+ for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++)
+ $ifdescrs['opt' . $j] = "opt" . $j;
foreach ($ifdescrs as $ifdescr => $ifname) {
$int = filter_translate_type_to_real_interface($ifname);
if($ifname == $interface) return $ifname;
OpenPOWER on IntegriCloud