summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: aef85ba)
raw | patch | inline | side by side (parent: aef85ba)
author | Jouni Malinen <j@w1.fi> | |
Sat, 3 Dec 2011 11:20:40 +0000 (13:20 +0200) | ||
committer | Jouni Malinen <j@w1.fi> | |
Sat, 3 Dec 2011 11:20:40 +0000 (13:20 +0200) |
This allows the MAC address of the interface to be changed when the
interface is set down even if the interface does not get completed
removed and re-added.
Signed-hostap: Jouni Malinen <j@w1.fi>
interface is set down even if the interface does not get completed
removed and re-added.
Signed-hostap: Jouni Malinen <j@w1.fi>
wpa_supplicant/events.c | patch | blob | history | |
wpa_supplicant/wpa_supplicant.c | patch | blob | history | |
wpa_supplicant/wpa_supplicant_i.h | patch | blob | history |
index f062d0a89b610674c38af6ceefbf1f1f881e669a..dd17a4280cc928d00fe1ea7196324843df63413e 100644 (file)
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
case EVENT_INTERFACE_ENABLED:
wpa_dbg(wpa_s, MSG_DEBUG, "Interface was enabled");
if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) {
+ wpa_supplicant_update_mac_addr(wpa_s);
#ifdef CONFIG_AP
if (!wpa_s->ap_iface) {
wpa_supplicant_set_state(wpa_s,
index 0abcd80577078482d16d8effdfd549bffb6e1a62..9fa39b26081351a026f66c1be7bf8ba5f051496e 100644 (file)
}
-/**
- * wpa_supplicant_driver_init - Initialize driver interface parameters
- * @wpa_s: Pointer to wpa_supplicant data
- * Returns: 0 on success, -1 on failure
- *
- * This function is called to initialize driver interface parameters.
- * wpa_drv_init() must have been called before this function to initialize the
- * driver interface.
- */
-int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s)
+int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s)
{
- static int interface_count = 0;
-
if (wpa_s->driver->send_eapol) {
const u8 *addr = wpa_drv_get_mac_addr(wpa_s);
if (addr)
os_memcpy(wpa_s->own_addr, addr, ETH_ALEN);
} else if (!(wpa_s->drv_flags &
WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE)) {
+ l2_packet_deinit(wpa_s->l2);
wpa_s->l2 = l2_packet_init(wpa_s->ifname,
wpa_drv_get_mac_addr(wpa_s),
ETH_P_EAPOL,
MAC2STR(wpa_s->own_addr));
wpa_sm_set_own_addr(wpa_s->wpa, wpa_s->own_addr);
+ return 0;
+}
+
+
+/**
+ * wpa_supplicant_driver_init - Initialize driver interface parameters
+ * @wpa_s: Pointer to wpa_supplicant data
+ * Returns: 0 on success, -1 on failure
+ *
+ * This function is called to initialize driver interface parameters.
+ * wpa_drv_init() must have been called before this function to initialize the
+ * driver interface.
+ */
+int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s)
+{
+ static int interface_count = 0;
+
+ if (wpa_supplicant_update_mac_addr(wpa_s) < 0)
+ return -1;
+
if (wpa_s->bridge_ifname[0]) {
wpa_dbg(wpa_s, MSG_DEBUG, "Receiving packets from bridge "
"interface '%s'", wpa_s->bridge_ifname);
index 9afdceef0fb91e850b287fd92892f1ae48457ab9..37237f0bd0351e49d05e8e544100d479d2977388 100644 (file)
int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s);
const char * wpa_supplicant_state_txt(enum wpa_states state);
+int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s);
int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s);
int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
struct wpa_bss *bss, struct wpa_ssid *ssid,