projects
/
openwrt
/
staging
/
mkresin.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hostapd: return with 80211 codes in handle event function
[openwrt/staging/mkresin.git]
/
package
/
network
/
services
/
hostapd
/
patches
/
600-ubus_support.patch
diff --git
a/package/network/services/hostapd/patches/600-ubus_support.patch
b/package/network/services/hostapd/patches/600-ubus_support.patch
index 23673d057fafd228219fcd2d981877df5162a05e..acdc668a7b1cf5bc296aad46125e9b7e6d240831 100644
(file)
--- a/
package/network/services/hostapd/patches/600-ubus_support.patch
+++ b/
package/network/services/hostapd/patches/600-ubus_support.patch
@@
-101,7
+101,7
@@
__func__, driver, drv_priv);
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
__func__, driver, drv_priv);
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
-@@ -1587,
7 +1587,8
@@ ieee802_11_set_radius_info(struct hostap
+@@ -1587,
12 +1587,13
@@ ieee802_11_set_radius_info(struct hostap
static void handle_auth(struct hostapd_data *hapd,
static void handle_auth(struct hostapd_data *hapd,
@@
-111,6
+111,12
@@
{
u16 auth_alg, auth_transaction, status_code;
u16 resp = WLAN_STATUS_SUCCESS;
{
u16 auth_alg, auth_transaction, status_code;
u16 resp = WLAN_STATUS_SUCCESS;
+ struct sta_info *sta = NULL;
+- int res, reply_res;
++ int res, reply_res, ubus_resp;
+ u16 fc;
+ const u8 *challenge = NULL;
+ u32 session_timeout, acct_interim_interval;
@@ -1603,6 +1604,11 @@ static void handle_auth(struct hostapd_d
char *identity = NULL;
char *radius_cui = NULL;
@@ -1603,6 +1604,11 @@ static void handle_auth(struct hostapd_d
char *identity = NULL;
char *radius_cui = NULL;
@@
-123,20
+129,21
@@
if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) {
wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)",
if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) {
wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)",
-@@ -1757,6 +1763,1
2
@@ static void handle_auth(struct hostapd_d
+@@ -1757,6 +1763,1
3
@@ static void handle_auth(struct hostapd_d
resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
goto fail;
}
resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
goto fail;
}
-+ if (hostapd_ubus_handle_event(hapd, &req)) {
++ ubus_resp = hostapd_ubus_handle_event(hapd, &req);
++ if (ubus_resp) {
+ wpa_printf(MSG_DEBUG, "Station " MACSTR " rejected by ubus handler.\n",
+ MAC2STR(mgmt->sa));
+ wpa_printf(MSG_DEBUG, "Station " MACSTR " rejected by ubus handler.\n",
+ MAC2STR(mgmt->sa));
-+ resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
++ resp =
ubus_resp > 0 ? (u16) ubus_resp :
WLAN_STATUS_UNSPECIFIED_FAILURE;
+ goto fail;
+ }
if (res == HOSTAPD_ACL_PENDING)
return;
+ goto fail;
+ }
if (res == HOSTAPD_ACL_PENDING)
return;
-@@ -2870,
7 +2882,7
@@ void fils_hlp_timeout(void *eloop_ctx, v
+@@ -2870,
12 +2883,12
@@ void fils_hlp_timeout(void *eloop_ctx, v
static void handle_assoc(struct hostapd_data *hapd,
const struct ieee80211_mgmt *mgmt, size_t len,
static void handle_assoc(struct hostapd_data *hapd,
const struct ieee80211_mgmt *mgmt, size_t len,
@@
-145,7
+152,13
@@
{
u16 capab_info, listen_interval, seq_ctrl, fc;
u16 resp = WLAN_STATUS_SUCCESS, reply_res;
{
u16 capab_info, listen_interval, seq_ctrl, fc;
u16 resp = WLAN_STATUS_SUCCESS, reply_res;
-@@ -2884,6 +2896,11 @@ static void handle_assoc(struct hostapd_
+ const u8 *pos;
+- int left, i;
++ int left, i, ubus_resp;
+ struct sta_info *sta;
+ u8 *tmp = NULL;
+ struct hostapd_sta_wpa_psk_short *psk = NULL;
+@@ -2884,6 +2897,11 @@ static void handle_assoc(struct hostapd_
#ifdef CONFIG_FILS
int delay_assoc = 0;
#endif /* CONFIG_FILS */
#ifdef CONFIG_FILS
int delay_assoc = 0;
#endif /* CONFIG_FILS */
@@
-157,21
+170,22
@@
if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) :
sizeof(mgmt->u.assoc_req))) {
if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) :
sizeof(mgmt->u.assoc_req))) {
-@@ -3051,6 +306
8,13
@@ static void handle_assoc(struct hostapd_
+@@ -3051,6 +306
9,14
@@ static void handle_assoc(struct hostapd_
}
#endif /* CONFIG_MBO */
}
#endif /* CONFIG_MBO */
-+ if (hostapd_ubus_handle_event(hapd, &req)) {
++ ubus_resp = hostapd_ubus_handle_event(hapd, &req);
++ if (ubus_resp) {
+ wpa_printf(MSG_DEBUG, "Station " MACSTR " assoc rejected by ubus handler.\n",
+ MAC2STR(mgmt->sa));
+ wpa_printf(MSG_DEBUG, "Station " MACSTR " assoc rejected by ubus handler.\n",
+ MAC2STR(mgmt->sa));
-+ resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
++ resp =
ubus_resp > 0 ? (u16) ubus_resp :
WLAN_STATUS_UNSPECIFIED_FAILURE;
+ goto fail;
+ }
+
/*
* sta->capability is used in check_assoc_ies() for RRM enabled
* capability element.
+ goto fail;
+ }
+
/*
* sta->capability is used in check_assoc_ies() for RRM enabled
* capability element.
-@@ -3258,6 +328
2
,7 @@ static void handle_disassoc(struct hosta
+@@ -3258,6 +328
4
,7 @@ static void handle_disassoc(struct hosta
wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d",
MAC2STR(mgmt->sa),
le_to_host16(mgmt->u.disassoc.reason_code));
wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d",
MAC2STR(mgmt->sa),
le_to_host16(mgmt->u.disassoc.reason_code));
@@
-179,7
+193,7
@@
sta = ap_get_sta(hapd, mgmt->sa);
if (sta == NULL) {
sta = ap_get_sta(hapd, mgmt->sa);
if (sta == NULL) {
-@@ -3323,6 +33
48
,8 @@ static void handle_deauth(struct hostapd
+@@ -3323,6 +33
50
,8 @@ static void handle_deauth(struct hostapd
" reason_code=%d",
MAC2STR(mgmt->sa), le_to_host16(mgmt->u.deauth.reason_code));
" reason_code=%d",
MAC2STR(mgmt->sa), le_to_host16(mgmt->u.deauth.reason_code));
@@
-188,7
+202,7
@@
sta = ap_get_sta(hapd, mgmt->sa);
if (sta == NULL) {
wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying "
sta = ap_get_sta(hapd, mgmt->sa);
if (sta == NULL) {
wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying "
-@@ -3637,7 +366
4
,7 @@ int ieee802_11_mgmt(struct hostapd_data
+@@ -3637,7 +366
6
,7 @@ int ieee802_11_mgmt(struct hostapd_data
if (stype == WLAN_FC_STYPE_PROBE_REQ) {
if (stype == WLAN_FC_STYPE_PROBE_REQ) {
@@
-197,7
+211,7
@@
return 1;
}
return 1;
}
-@@ -3657,17 +368
4
,17 @@ int ieee802_11_mgmt(struct hostapd_data
+@@ -3657,17 +368
6
,17 @@ int ieee802_11_mgmt(struct hostapd_data
switch (stype) {
case WLAN_FC_STYPE_AUTH:
wpa_printf(MSG_DEBUG, "mgmt::auth");
switch (stype) {
case WLAN_FC_STYPE_AUTH:
wpa_printf(MSG_DEBUG, "mgmt::auth");