diff options
author | Erik Fonnesbeck <efonnes@gmail.com> | 2010-12-02 16:00:54 -0700 |
---|---|---|
committer | Erik Fonnesbeck <efonnes@gmail.com> | 2010-12-02 16:16:15 -0700 |
commit | 864bf77420afb47d55bf8b84b789020182095d44 (patch) | |
tree | b7285f59ea29c258423a28efef83c58425c56ee2 /etc | |
parent | acb0bce0454bbaeeaa419145f17bf042decab930 (diff) | |
download | pfsense-864bf77420afb47d55bf8b84b789020182095d44.zip pfsense-864bf77420afb47d55bf8b84b789020182095d44.tar.gz |
Restore spoofed MAC after running hostapd to keep behavior consistent with other interfaces. Ticket #841
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/interfaces.inc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 04ab574..f6bbaaa 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -2257,7 +2257,7 @@ EOD; fwrite($fd_set, "{$wpa_supplicant} -B -i {$if} -c {$g['varetc_path']}/wpa_supplicant_{$if}.conf\n"); } if ($wlcfg['mode'] == "hostap") { - /* restore old mac to make hostapd happy */ + /* 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)) @@ -2266,6 +2266,17 @@ EOD; } fwrite($fd_set, "{$hostapd} -B {$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)) + fwrite($fd_set, "{$ifconfig} " . escapeshellarg($if) . + " link " . escapeshellarg($if_curmac) . "\n"); + } } } |