summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-12-27 21:02:50 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-12-27 21:02:50 +0000
commit7695ef3ff969344b158cf6d606450d20ad7ab4a7 (patch)
treeef81b710c95db9af7ab0317d17be0f4fee3fdfa5 /etc
parent08a04c620a0d507671b08874542dead6cc85f262 (diff)
downloadpfsense-7695ef3ff969344b158cf6d606450d20ad7ab4a7.zip
pfsense-7695ef3ff969344b158cf6d606450d20ad7ab4a7.tar.gz
Show VLAN capable interfaces before VLAN assignment. Alert user when no VLAN capable parent interfaces are available.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/config.inc32
1 files changed, 21 insertions, 11 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index e80fea2..48b15c1 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -962,16 +962,6 @@ EOD;
if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) {
- echo "\n\nReal interfaces available:\n";
- if(!is_array($iflist)) {
- echo "No interfaces found!\n";
- } else {
- foreach ($iflist as $iface => $ifa) {
- echo sprintf("% -8s%s%s\n", $iface, $ifa['mac'],
- $ifa['up'] ? " (up)" : "");
- }
- }
-
echo "\n\nVLAN interfaces:\n\n";
$i = 0;
foreach ($config['vlans']['vlan'] as $vlan) {
@@ -1208,6 +1198,26 @@ EOD;
while (1) {
$vlan = array();
+ echo "\n\nVLAN Capable interfaces:\n\n";
+ if(!is_array($iflist)) {
+ echo "No interfaces found!\n";
+ } else {
+ $vlan_capable=0;
+ foreach ($iflist as $iface => $ifa) {
+ if (array_key_exists($vlan['if'], $iflist) or
+ is_jumbo_capable($vlan['if'])) {
+ echo sprintf("% -8s%s%s\n", $iface, $ifa['mac'],
+ $ifa['up'] ? " (up)" : "");
+ $vlan_capable++;
+ }
+ }
+ }
+
+ if($vlan_capable == 0) {
+ echo "No VLAN capable interfaces detected.\n";
+ return;
+ }
+
echo "\nEnter the parent interface name for the new VLAN (or nothing if finished): ";
$vlan['if'] = chop(fgets($fp));
@@ -1393,4 +1403,4 @@ function start_devd() {
exec("/sbin/devd");
}
-?>
+?> \ No newline at end of file
OpenPOWER on IntegriCloud