diff options
author | Ermal Luçi <eri@pfsense.org> | 2009-06-08 22:23:40 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2009-06-08 22:23:40 +0000 |
commit | 305c847d674b40a3f11c53f377bb607d6c2fe133 (patch) | |
tree | c42ff9e674db8737a64a1b5986e7d10e9453bbe1 /etc | |
parent | e1c449c0362c89b1d7c4ab2a1a860e88938cfcde (diff) | |
download | pfsense-305c847d674b40a3f11c53f377bb607d6c2fe133.zip pfsense-305c847d674b40a3f11c53f377bb607d6c2fe133.tar.gz |
Use $RealIf.vlan$tag interface names for vlans. This makes them more userfriendly.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/config.inc | 4 | ||||
-rw-r--r-- | etc/inc/interfaces.inc | 11 |
2 files changed, 8 insertions, 7 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc index 6dd751d..3b8922c 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -815,7 +815,7 @@ EOD; echo sprintf("% -8s%s\n", "vlan{$vlan['tag']}", "VLAN tag {$vlan['tag']}, interface {$vlan['if']}"); - $iflist['vlan' . $vlan['tag']] = array(); + $iflist[$vlan['if'] . '.vlan' . $vlan['tag']] = array(); } } @@ -1146,7 +1146,7 @@ EOD; echo "Enter the VLAN tag (1-4094): "; $vlan['tag'] = chop(fgets($fp)); - $vlan['vlanif'] = "vlan{$vlan['tag']}"; + $vlan['vlanif'] = "{$vlan['if']}.vlan{$vlan['tag']}"; if (!is_numericint($vlan['tag']) || ($vlan['tag'] < 1) || ($vlan['tag'] > 4094)) { echo "\nInvalid VLAN tag '{$vlan['tag']}'\n"; continue; diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 72fb3a1..63d36e7 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -90,7 +90,7 @@ function interfaces_vlan_configure() { if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) { foreach ($config['vlans']['vlan'] as $vlan) { if(empty($vlan['vlanif'])) - $vlan['vlanif'] = "vlan{$vlan['tag']}"; + $vlan['vlanif'] = "{$vlan['if']}.vlan{$vlan['tag']}"; /* XXX: Maybe we should report any errors?! */ interface_vlan_configure($vlan); } @@ -105,7 +105,7 @@ function interface_vlan_configure($vlan) { return; } $if = $vlan['if']; - $vlanif = empty($vlan['vlanif']) ? "vlan{$vlan['tag']}" : $vlan['vlanif']; + $vlanif = empty($vlan['vlanif']) ? "{$if}.vlan{$vlan['tag']}" : $vlan['vlanif']; $tag = $vlan['tag']; if(empty($if)) { @@ -132,9 +132,10 @@ function interface_vlan_configure($vlan) { to retain previous behavior and avoid regressions */ if($carpcount < 1) mwexec("/sbin/ifconfig {$vlanif} destroy"); - mwexec("/sbin/ifconfig {$vlanif} create"); - } else - $vlanif = exec("/sbin/ifconfig vlan create"); + //mwexec("/sbin/ifconfig {$vlanif} create"); + } + $tmpvlanif = exec("/sbin/ifconfig vlan create"); + mwexec("/sbin/ifconfig {$tmpvlanif} name {$vlanif}"); mwexec("/sbin/ifconfig {$vlanif} vlan " . escapeshellarg($tag) . " vlandev " . |