diff options
author | Ermal Luçi <eri@pfsense.org> | 2008-10-23 20:57:05 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2008-10-23 20:57:05 +0000 |
commit | cb00b7342f39a96ddbffd3a53965c780359e2d3b (patch) | |
tree | 6af6c4529dfbff728bc465b421dbc2d3c575ad00 | |
parent | 4d18eb07e7f303686806a6a49333513180386826 (diff) | |
download | pfsense-cb00b7342f39a96ddbffd3a53965c780359e2d3b.zip pfsense-cb00b7342f39a96ddbffd3a53965c780359e2d3b.tar.gz |
Improve vlan interface code to try to activate as much as possible on the parent, this allows to not maintain a supported list.
-rw-r--r-- | etc/inc/interfaces.inc | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 9853ffa..cf76940 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -67,14 +67,11 @@ function interface_vlan_configure($if, $tag, $vlanif = "") { global $config, $g; - /* devices with native VLAN support */ - $vlan_native_supp = $g['vlan_native_supp']; - - /* devices with long frame support */ - $vlan_long_frame = $g['vlan_long_frame']; - /* make sure the parent interface is up */ mwexec("/sbin/ifconfig " . escapeshellarg($if) . " up"); + /* Since we are going to add vlan(4) try to enable all that hardware supports. */ + mwexec("/sbin/ifconfig {$if} vlanhwtag"); + mwexec("/sbin/ifconfig {$if} vlanmtu"); if ($g['booting'] || !(empty($vlanif))) { mwexec("/sbin/ifconfig {$vlanif} destroy"); @@ -86,18 +83,6 @@ function interface_vlan_configure($if, $tag, $vlanif = "") escapeshellarg($tag) . " vlandev " . escapeshellarg($if)); - /* get driver name */ - for ($j = 0; $j < strlen($if); $j++) { - if ($if[$j] >= '0' && $if[$j] <= '9') - break; - } - $drvname = substr($if, 0, $j); - - if (in_array($drvname, $vlan_native_supp)) - mwexec("/sbin/ifconfig {$if} vlanhwtag"); - else if (in_array($drvname, $vlan_long_frame)) - mwexec("/sbin/ifconfig {$if} vlanmtu"); - mwexec("/sbin/ifconfig {$vlanif} up"); /* invalidate interface cache */ |