aboutsummaryrefslogtreecommitdiffstats
path: root/package/hostapd/patches/006-use-nl80211-for-sta.patch
diff options
context:
space:
mode:
Diffstat (limited to 'package/hostapd/patches/006-use-nl80211-for-sta.patch')
-rw-r--r--package/hostapd/patches/006-use-nl80211-for-sta.patch38
1 files changed, 20 insertions, 18 deletions
diff --git a/package/hostapd/patches/006-use-nl80211-for-sta.patch b/package/hostapd/patches/006-use-nl80211-for-sta.patch
index f94ba42886..133a750194 100644
--- a/package/hostapd/patches/006-use-nl80211-for-sta.patch
+++ b/package/hostapd/patches/006-use-nl80211-for-sta.patch
@@ -1,9 +1,9 @@
---
- hostapd/driver_devicescape.c | 330 ++++++++++++++++++++++++++++++++-----------
- 1 file changed, 249 insertions(+), 81 deletions(-)
+ hostapd/driver_devicescape.c | 332 ++++++++++++++++++++++++++++++++-----------
+ 1 file changed, 251 insertions(+), 81 deletions(-)
---- hostap.orig/hostapd/driver_devicescape.c 2007-11-09 13:41:15.000000000 +0100
-+++ hostap/hostapd/driver_devicescape.c 2007-11-09 13:41:16.000000000 +0100
+--- hostap.orig/hostapd/driver_devicescape.c 2007-11-14 17:31:15.000000000 +0100
++++ hostap/hostapd/driver_devicescape.c 2007-11-14 17:31:16.000000000 +0100
@@ -75,8 +75,14 @@ struct i802_driver_data {
#define HAPD_DECL struct hostapd_data *hapd = iface->bss[0]
@@ -128,12 +128,15 @@
+ int ret = -1;
+ int err = 0;
+ int finished = 0;
-
-- memset(data, 0, sizeof(*data));
++
+ msg = nlmsg_alloc();
+ if (!msg)
+ goto out;
+- memset(data, 0, sizeof(*data));
++ genlmsg_put(msg, 0, 0, genl_family_get_id(drv->nl80211), 0,
++ 0, NL80211_CMD_GET_STATION, 0);
+
- memset(&param, 0, sizeof(param));
- param.cmd = PRISM2_HOSTAPD_GET_INFO_STA;
- memcpy(param.sta_addr, addr, ETH_ALEN);
@@ -141,9 +144,6 @@
- printf(" Could not get station info from kernel driver.\n");
- return -1;
- }
-+ genlmsg_put(msg, 0, 0, genl_family_get_id(drv->nl80211), 0,
-+ 0, NL80211_CMD_GET_STATION, 0);
-+
+ NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, addr);
+ NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, if_nametoindex(drv->iface));
+
@@ -189,7 +189,7 @@
}
-@@ -744,35 +825,68 @@ static int i802_sta_add(const char *ifna
+@@ -744,35 +825,70 @@ static int i802_sta_add(const char *ifna
size_t supp_rates_len, int flags)
{
struct i802_driver_data *drv = priv;
@@ -223,12 +223,14 @@
+ supp_rates);
+ NLA_PUT_U16(msg, NL80211_ATTR_STA_LISTEN_INTERVAL, 0);
+
-+ ret = 0;
++ ret = nl_send_auto_complete(drv->nl_handle, msg);
++ if (ret < 0)
++ goto nla_put_failure;
+
-+ if (nl_send_auto_complete(drv->nl_handle, msg) < 0 ||
-+ nl_wait_for_ack(drv->nl_handle) < 0) {
-+ ret = -1;
-+ }
++ ret = nl_wait_for_ack(drv->nl_handle);
++ /* ignore EEXIST, this happens if a STA associates while associated */
++ if (ret == -EEXIST || ret >= 0)
++ ret = 0;
+
+ nla_put_failure:
+ nlmsg_free(msg);
@@ -278,7 +280,7 @@
}
-@@ -780,14 +894,51 @@ static int i802_sta_set_flags(void *priv
+@@ -780,14 +896,51 @@ static int i802_sta_set_flags(void *priv
int total_flags, int flags_or, int flags_and)
{
struct i802_driver_data *drv = priv;
@@ -337,7 +339,7 @@
}
-@@ -1257,18 +1408,38 @@ static struct hostapd_hw_modes * i802_ge
+@@ -1257,18 +1410,38 @@ static struct hostapd_hw_modes * i802_ge
}
@@ -385,7 +387,7 @@
}
-@@ -1750,17 +1921,14 @@ static int i802_init_sockets(struct i802
+@@ -1752,17 +1925,14 @@ static int i802_init_sockets(struct i802
static int i802_get_inact_sec(void *priv, const u8 *addr)
{