From cb00b7342f39a96ddbffd3a53965c780359e2d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=C3=A7i?= Date: Thu, 23 Oct 2008 20:57:05 +0000 Subject: Improve vlan interface code to try to activate as much as possible on the parent, this allows to not maintain a supported list. --- etc/inc/interfaces.inc | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'etc') 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 */ -- cgit v1.1