aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/config.h
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-09-27 16:12:41 (GMT)
committerJouni Malinen <j@w1.fi>2014-09-27 17:07:19 (GMT)
commitc267753ba2cc006907c57cf11b06d658f783682f (patch)
treefb2a00d74bc0fde11629f79e664cf3822a2bb45c /wpa_supplicant/config.h
parent4d8fb637998062fbc7e1bc32e6e58646cd55ff9e (diff)
downloadhostap-c267753ba2cc006907c57cf11b06d658f783682f.zip
hostap-c267753ba2cc006907c57cf11b06d658f783682f.tar.gz
hostap-c267753ba2cc006907c57cf11b06d658f783682f.tar.bz2
Add support for using random local MAC address
This adds experimental support for wpa_supplicant to assign random local MAC addresses for both pre-association cases (scan, GAS/ANQP) and for connections. MAC address policy for each part can be controlled separately and the connection part can be set per network block. This requires support from the driver to allow local MAC address to be changed if random address policy is enabled. It should also be noted that number of drivers would not support concurrent operations (e.g., P2P and station association) with random addresses in use for one or both. This functionality can be controlled with the global configuration parameters mac_addr and preassoc_mac_addr which set the default MAC address policies for connections and pre-association operations (scan and GAS/ANQP while not connected). The global rand_addr_lifetime parameter can be used to set the lifetime of a random MAC address in seconds (default: 60 seconds). This is used to avoid unnecessarily frequent MAC address changes since those are likely to result in driver clearing most of its state. It should be noted that the random MAC address does not expire during an ESS connection, i.e., this lifetime is only for the case where the device is disconnected. The mac_addr parameter can also be set in the network blocks to define different behavior per network. For example, the global mac_addr=1 and preassoc_mac_addr=1 settings and mac_addr=0 in a home network profile would result in behavior where all scanning is performed using a random MAC address while connections to new networks (e.g., Interworking/Hotspot 2.0) would use random address and connections to the home network would use the permanent MAC address. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/config.h')
-rw-r--r--wpa_supplicant/config.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index 52add9d..75257c5 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
@@ -27,6 +27,7 @@
#define DEFAULT_ACCESS_NETWORK_TYPE 15
#define DEFAULT_SCAN_CUR_FREQ 0
#define DEFAULT_P2P_SEARCH_DELAY 500
+#define DEFAULT_RAND_ADDR_LIFETIME 60
#include "config_ssid.h"
#include "wps/wps.h"
@@ -1051,6 +1052,31 @@ struct wpa_config {
* resources.
*/
unsigned int p2p_search_delay;
+
+ /**
+ * mac_addr - MAC address policy default
+ *
+ * 0 = use permanent MAC address
+ * 1 = use random MAC address for each ESS connection
+ *
+ * By default, permanent MAC address is used unless policy is changed by
+ * the per-network mac_addr parameter. Global mac_addr=1 can be used to
+ * change this default behavior.
+ */
+ int mac_addr;
+
+ /**
+ * rand_addr_lifetime - Lifetime of random MAC address in seconds
+ */
+ unsigned int rand_addr_lifetime;
+
+ /**
+ * preassoc_mac_addr - Pre-association MAC address policy
+ *
+ * 0 = use permanent MAC address
+ * 1 = use random MAC address
+ */
+ int preassoc_mac_addr;
};