diff options
author | Ermal Luçi <eri@pfsense.org> | 2008-07-09 06:51:24 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2008-07-09 06:51:24 +0000 |
commit | 748225fa92963aaa99b3974fc8d722e6121b6146 (patch) | |
tree | 366658f0d304b0f82a208d8a9b997772d08ba2cf | |
parent | 1348a09b4c84b0cc2cc89766758a2cd1a5b88ec1 (diff) | |
download | pfsense-748225fa92963aaa99b3974fc8d722e6121b6146.zip pfsense-748225fa92963aaa99b3974fc8d722e6121b6146.tar.gz |
Merge VLAN fixes from RELENG_1_MULTI_ANYTHING branch.
-rw-r--r-- | etc/inc/interfaces.inc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index d3a12b9..95b8db4 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -73,27 +73,28 @@ function interface_vlan_configure($if, $tag, $vlanif = "") { /* make sure the parent interface is up */ mwexec("/sbin/ifconfig " . escapeshellarg($if) . " up"); - if ($g['booting']) - $vif = $vlanif; + if ($g['booting'] || !(empty($vlanif))) + mwexec("/sbin/ifconfig {$vlanif} create"); else - $vif = "vlan"; - $cmd = "/sbin/ifconfig {$vif} create vlan " . + $vlanif = exec("/sbin/ifconfig vlan create"); + + mwexec("/sbin/ifconfig {$vilanif} vlan " . escapeshellarg($tag) . " vlandev " . - escapeshellarg($if); + 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)) - $cmd .= " link0"; + mwexec("/sbin/ifconfig {$vlanif} link0"); else if (in_array($drvname, $vlan_long_frame)) - $cmd .= " mtu 1500"; + $cmd .= mwexec("/sbin/ifconfig {$vlanif} vlanmtu 1500"); - $vlanif = exec($cmd); + mwexec("/sbin/ifconfig {$vlanif} up"); /* invalidate interface cache */ get_interface_arr(true); @@ -1895,4 +1896,4 @@ function get_interface_mac($interface) { return $mac; } -?>
\ No newline at end of file +?> |