summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2010-12-02 16:00:54 -0700
committerErik Fonnesbeck <efonnes@gmail.com>2010-12-02 16:16:15 -0700
commit864bf77420afb47d55bf8b84b789020182095d44 (patch)
treeb7285f59ea29c258423a28efef83c58425c56ee2
parentacb0bce0454bbaeeaa419145f17bf042decab930 (diff)
downloadpfsense-864bf77420afb47d55bf8b84b789020182095d44.zip
pfsense-864bf77420afb47d55bf8b84b789020182095d44.tar.gz
Restore spoofed MAC after running hostapd to keep behavior consistent with other interfaces. Ticket #841
-rw-r--r--etc/inc/interfaces.inc13
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");
+ }
}
}
OpenPOWER on IntegriCloud