diff options
author | Renato Botelho <renato@netgate.com> | 2016-10-12 12:30:39 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-10-12 12:30:39 -0300 |
commit | 90d0e0e057fa1743e8d7356cd01b91d337a30a7a (patch) | |
tree | c725dfaa639c1956fb343c55bfa3ce11c020e9c2 | |
parent | 58c0e164a99b993b54240ba67ca9d3d7cbf0dd32 (diff) | |
parent | a6c4a66da2ee8b0d4d54480dd690700b8c16bb13 (diff) | |
download | pfsense-90d0e0e057fa1743e8d7356cd01b91d337a30a7a.zip pfsense-90d0e0e057fa1743e8d7356cd01b91d337a30a7a.tar.gz |
Merge pull request #3179 from valneacsu/fix_wifi_settings_overwrite
-rw-r--r-- | src/etc/inc/interfaces.inc | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 3d47e39..a03c681 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -2838,7 +2838,8 @@ EOD; /* add line to script to restore old mac to make hostapd happy */ if (file_exists("{$g['tmp_path']}/{$if}_oldmac")) { $if_oldmac = file_get_contents("{$g['tmp_path']}/{$if}_oldmac"); - if (is_macaddr($if_oldmac)) { + $if_curmac = get_interface_mac($if); + if ($if_curmac != $if_oldmac && is_macaddr($if_oldmac)) { fwrite($fd_set, "{$ifconfig} " . escapeshellarg($if) . " link " . escapeshellarg($if_oldmac) . "\n"); } @@ -2847,15 +2848,11 @@ EOD; fwrite($fd_set, "{$hostapd} -B -P {$g['varrun_path']}/hostapd_{$if}.pid {$g['varetc_path']}/hostapd_{$if}.conf\n"); /* add line to script to restore spoofed mac after running hostapd */ - if (file_exists("{$g['tmp_path']}/{$if}_oldmac")) { - if ($wl['spoofmac']) { - $if_curmac = $wl['spoofmac']; - } else { - $if_curmac = get_interface_mac($if); - } - if (is_macaddr($if_curmac)) { + if ($wl['spoofmac']) { + $if_curmac = get_interface_mac($if); + if ($wl['spoofmac'] != $if_curmac && is_macaddr($wl['spoofmac'])) { fwrite($fd_set, "{$ifconfig} " . escapeshellarg($if) . - " link " . escapeshellarg($if_curmac) . "\n"); + " link " . escapeshellarg($wl['spoofmac']) . "\n"); } } } |