summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-06-21 00:28:50 +0000
committerErmal Luçi <eri@pfsense.org>2008-06-21 00:28:50 +0000
commitb6db92176273cdd9b1dfbf6b44b42e55a35ee7af (patch)
treedd6c6916b9443469466dfa3f1c09cd70f0a9a002 /etc
parent19604f5d9680dad1a5e12d1bea8d7e5aa9f37193 (diff)
downloadpfsense-b6db92176273cdd9b1dfbf6b44b42e55a35ee7af.zip
pfsense-b6db92176273cdd9b1dfbf6b44b42e55a35ee7af.tar.gz
Continue interface improvements.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/interfaces.inc18
-rw-r--r--etc/inc/system.inc9
-rwxr-xr-xetc/rc.linkup7
3 files changed, 14 insertions, 20 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 2e263dc..d4c91b4 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -234,12 +234,14 @@ function interfaces_lan_configure() {
}
function interfaces_optional_configure() {
- global $config, $g;
- global $bridgeconfig;
+ global $g;
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- interfaces_optional_configure_if($i);
- }
+ /* XXX: unify with wan when pppoe/pptp fixups are done. */
+ /* optional interface if list */
+ $iflist = get_configured_interface_list(true);
+
+ foreach($iflist as $if => $ifname)
+ interfaces_optional_configure_if($if);
if (!$g['booting']) {
/* reconfigure static routes (kernel may have deleted them) */
@@ -270,13 +272,13 @@ function interfaces_optional_configure_if($opti) {
$bridges_total = get_next_available_bridge_interface();
- $optcfg = $config['interfaces']['opt' . $opti];
+ $optcfg = $config['interfaces'][$opti];
if ($g['booting']) {
$optdescr = "";
if ($optcfg['descr'])
$optdescr = " ({$optcfg['descr']})";
- print "\tOPT{$opti}{$optdescr}... ";
+ print "\t{$opti}{$optdescr}... ";
}
if(file_exists("/tmp/{$optcfg['if']}_router"))
@@ -372,7 +374,7 @@ function interfaces_optional_configure_if($opti) {
} else {
/* if user has selected DHCP type then act accordingly */
if($optcfg['ipaddr'] == "dhcp") {
- interfaces_opt_dhcp_configure("opt{$opti}");
+ interfaces_opt_dhcp_configure($opti);
} else {
mwexec("/sbin/ifconfig " . escapeshellarg($optcfg['if']) . " " .
escapeshellarg($optcfg['ipaddr'] . "/" . $optcfg['subnet']));
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index d7da50e..ab7a5ee 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -214,14 +214,7 @@ function system_routing_configure() {
}
/* if list */
- if ($config['interfaces']['lan']) {
- $iflist = array("lan", "wan");
- } else {
- $iflist = array("wan");
- }
-
- for ($i = 1; isset($config['interfaces']['opt' . $i]['enable']); $i++)
- $iflist['opt' . $i] = "opt{$i}";
+ $iflist = get_configured_interface_list();
$dont_remove_route = false;
foreach ($iflist as $ifent => $ifname) {
diff --git a/etc/rc.linkup b/etc/rc.linkup
index bbf44d6..e840f19 100755
--- a/etc/rc.linkup
+++ b/etc/rc.linkup
@@ -93,10 +93,9 @@
interfaces_lan_configure();
break;
default:
- $int = str_replace("opt", "", $interface);
- interfaces_optional_configure_if($int);
- echo "interfaces_optional_configure_if($int);\n";
- log_error("HOTPLUG: Configuring optional interface {$interface} - opt{$int}");
+ interfaces_optional_configure_if($interface);
+ echo "interfaces_optional_configure_if($interface);\n";
+ log_error("HOTPLUG: Configuring optional interface {$interface}");
break;
}
}
OpenPOWER on IntegriCloud