aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-03-06 18:44:31 (GMT)
committerJouni Malinen <j@w1.fi>2010-03-06 18:44:31 (GMT)
commit4c32757d2277687b17fdbb40199123a4d8c6be67 (patch)
treecb722e35f8e51b87ec15c74a11e36dedb8ed858b /src
parent23e2550c0e16cfbd87a389e1b846673d5ba87929 (diff)
downloadhostap-4c32757d2277687b17fdbb40199123a4d8c6be67.zip
hostap-4c32757d2277687b17fdbb40199123a4d8c6be67.tar.gz
hostap-4c32757d2277687b17fdbb40199123a4d8c6be67.tar.bz2
hostapd: add ifname to the sta_set_flags callback
This fixes multi-BSS STA operations (e.g., setting AUTHORIZED flag) with nl80211-based drivers.
Diffstat (limited to 'src')
-rw-r--r--src/ap/ap_drv_ops.c2
-rw-r--r--src/drivers/driver.h3
-rw-r--r--src/drivers/driver_atheros.c4
-rw-r--r--src/drivers/driver_bsd.c4
-rw-r--r--src/drivers/driver_hostap.c5
-rw-r--r--src/drivers/driver_madwifi.c4
-rw-r--r--src/drivers/driver_nl80211.c8
7 files changed, 16 insertions, 14 deletions
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index 80beac7..956b546 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -490,7 +490,7 @@ int hostapd_sta_set_flags(struct hostapd_data *hapd, u8 *addr,
{
if (hapd->driver == NULL || hapd->driver->sta_set_flags == NULL)
return 0;
- return hapd->driver->sta_set_flags(hapd->drv_priv, addr, total_flags,
+ return hapd->driver->sta_set_flags(hapd->conf->iface, hapd->drv_priv, addr, total_flags,
flags_or, flags_and);
}
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 7f8473d..3c8ccd1 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -1419,6 +1419,7 @@ struct wpa_driver_ops {
/**
* sta_set_flags - Set station flags (AP only)
+ * @ifname: Interface name (for multi-SSID/VLAN support)
* @priv: Private driver interface data
* @addr: Station address
* @total_flags: Bitmap of all WPA_STA_* flags currently set
@@ -1426,7 +1427,7 @@ struct wpa_driver_ops {
* @flags_and: Bitmap of WPA_STA_* flags to us as a mask
* Returns: 0 on success, -1 on failure
*/
- int (*sta_set_flags)(void *priv, const u8 *addr,
+ int (*sta_set_flags)(const char *ifname, void *priv, const u8 *addr,
int total_flags, int flags_or, int flags_and);
/**
diff --git a/src/drivers/driver_atheros.c b/src/drivers/driver_atheros.c
index f24a40f..94e139a 100644
--- a/src/drivers/driver_atheros.c
+++ b/src/drivers/driver_atheros.c
@@ -339,8 +339,8 @@ madwifi_set_sta_authorized(void *priv, const u8 *addr, int authorized)
}
static int
-madwifi_sta_set_flags(void *priv, const u8 *addr, int total_flags,
- int flags_or, int flags_and)
+madwifi_sta_set_flags(const char *ifname, void *priv, const u8 *addr,
+ int total_flags, int flags_or, int flags_and)
{
/* For now, only support setting Authorized flag */
if (flags_or & WPA_STA_AUTHORIZED)
diff --git a/src/drivers/driver_bsd.c b/src/drivers/driver_bsd.c
index 2ba7c8b..7e060d4 100644
--- a/src/drivers/driver_bsd.c
+++ b/src/drivers/driver_bsd.c
@@ -468,8 +468,8 @@ bsd_set_ieee8021x(void *priv, struct wpa_bss_params *params)
}
static int
-bsd_set_sta_authorized(void *priv, const u8 *addr, int total_flags,
- int flags_or, int flags_and)
+bsd_set_sta_authorized(const char *ifname, void *priv, const u8 *addr,
+ int total_flags, int flags_or, int flags_and)
{
int authorized = -1;
diff --git a/src/drivers/driver_hostap.c b/src/drivers/driver_hostap.c
index 64b345f..b461e96 100644
--- a/src/drivers/driver_hostap.c
+++ b/src/drivers/driver_hostap.c
@@ -333,7 +333,7 @@ static int hostap_send_eapol(void *priv, const u8 *addr, const u8 *data,
}
-static int hostap_sta_set_flags(void *priv, const u8 *addr,
+static int hostap_sta_set_flags(const char *ifname, void *priv, const u8 *addr,
int total_flags, int flags_or, int flags_and)
{
struct hostap_driver_data *drv = priv;
@@ -664,7 +664,8 @@ static int hostap_sta_remove(void *priv, const u8 *addr)
struct hostap_driver_data *drv = priv;
struct prism2_hostapd_param param;
- hostap_sta_set_flags(drv, addr, 0, 0, ~WPA_STA_AUTHORIZED);
+ hostap_sta_set_flags(drv->iface, drv, addr, 0, 0,
+ ~WPA_STA_AUTHORIZED);
memset(&param, 0, sizeof(param));
param.cmd = PRISM2_HOSTAPD_REMOVE_STA;
diff --git a/src/drivers/driver_madwifi.c b/src/drivers/driver_madwifi.c
index 475334e..90036cf 100644
--- a/src/drivers/driver_madwifi.c
+++ b/src/drivers/driver_madwifi.c
@@ -384,8 +384,8 @@ madwifi_set_sta_authorized(void *priv, const u8 *addr, int authorized)
}
static int
-madwifi_sta_set_flags(void *priv, const u8 *addr, int total_flags,
- int flags_or, int flags_and)
+madwifi_sta_set_flags(const char *ifname, void *priv, const u8 *addr,
+ int total_flags, int flags_or, int flags_and)
{
/* For now, only support setting Authorized flag */
if (flags_or & WPA_STA_AUTHORIZED)
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index a5622d5..95cec95 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -3409,9 +3409,9 @@ static u32 sta_flags_nl80211(int flags)
}
-static int wpa_driver_nl80211_sta_set_flags(void *priv, const u8 *addr,
- int total_flags, int flags_or,
- int flags_and)
+static int wpa_driver_nl80211_sta_set_flags(const char *ifname, void *priv,
+ const u8 *addr, int total_flags,
+ int flags_or, int flags_and)
{
struct wpa_driver_nl80211_data *drv = priv;
struct nl_msg *msg, *flags = NULL;
@@ -3431,7 +3431,7 @@ static int wpa_driver_nl80211_sta_set_flags(void *priv, const u8 *addr,
0, NL80211_CMD_SET_STATION, 0);
NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX,
- if_nametoindex(drv->ifname));
+ if_nametoindex(ifname));
NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, addr);
/*