diff options
author | Ermal <eri@pfsense.org> | 2010-06-01 23:19:34 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-06-01 23:19:34 +0000 |
commit | ac8ff0a4f3effcdd535bd9187bb92c1a781970e0 (patch) | |
tree | 81738b82490f9f80c687a9a81eeff741509e4d95 /etc/inc | |
parent | 634e5206525c3e9cb9067cdfe22a2b0d6e3bc580 (diff) | |
download | pfsense-ac8ff0a4f3effcdd535bd9187bb92c1a781970e0.zip pfsense-ac8ff0a4f3effcdd535bd9187bb92c1a781970e0.tar.gz |
When an interface spoofs its mac address change the mac address of all vlans having it as parent. Remove such code from the vlan configuration phase since this is way the mac change will always get propagated and its faster.
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/interfaces.inc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 9ff2c40..cdfcf5d 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -151,16 +151,6 @@ function interface_vlan_configure(&$vlan) { /* invalidate interface cache */ get_interface_arr(true); - /* all vlans need to spoof their parent mac address, too. see - * ticket #1514: http://cvstrac.pfsense.com/tktview?tn=1514,33 - */ - foreach($config['interfaces'] as $interfaces) { - if($interfaces['if'] == $if && $interfaces['spoofmac']) { - mwexec("/sbin/ifconfig " . escapeshellarg($vlanif) . - " link " . escapeshellarg($interfaces['spoofmac'])); - } - } - /* XXX: ermal -- for now leave it here at the moment it does not hurt. */ interfaces_bring_up($if); @@ -1896,6 +1886,18 @@ function interface_configure($interface = "wan", $reloadall = false) { if ($wancfg['spoofmac']) { mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " link " . escapeshellarg($wancfg['spoofmac'])); + + /* + * All vlans need to spoof their parent mac address, too. see + * ticket #1514: http://cvstrac.pfsense.com/tktview?tn=1514,33 + */ + if (is_array($config['vlans']['vlan'])) { + foreach ($config['vlans']['vlan'] as $vlan) { + if ($vlan['if'] == $realif) + mwexec("/sbin/ifconfig " . escapeshellarg($vlan['vlanif']) . + " link " . escapeshellarg($wancfg['spoofmac'])); + } + } } else { $mac = get_interface_mac(get_real_interface($wancfg['if'])); if($mac == "ff:ff:ff:ff:ff:ff") { |