diff options
author | David Bauer <mail@david-bauer.net> | 2021-10-17 23:29:57 +0200 |
---|---|---|
committer | David Bauer <mail@david-bauer.net> | 2021-10-19 17:27:05 +0200 |
commit | 43c64ffa74c8e843c695c04f3b20db8e868a0608 (patch) | |
tree | 1e58108e776808b5705e6293c7e3d7401f9055aa | |
parent | c4e994011f56d30e031705c16c6b5c498c530852 (diff) | |
download | upstream-43c64ffa74c8e843c695c04f3b20db8e868a0608.tar.gz upstream-43c64ffa74c8e843c695c04f3b20db8e868a0608.tar.bz2 upstream-43c64ffa74c8e843c695c04f3b20db8e868a0608.zip |
hostapd: fix goto loop for ubus assoc handler
When a ubus event handler denies a association with a non-zero return
value, the code jumps to preceeding code, creating an endless loop until
the event handler accepts the assc request.
Move the ubus handler further up the code to avoid creating such a loop.
Signed-off-by: David Bauer <mail@david-bauer.net>
-rw-r--r-- | package/network/services/hostapd/patches/600-ubus_support.patch | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index d77d245243..7bb998dbb8 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -147,9 +147,9 @@ /* followed by SSID and Supported rates; and HT capabilities if 802.11n * is used */ -@@ -5831,6 +5848,14 @@ static void handle_assoc(struct hostapd_ - pos, left, rssi, omit_rsnxe); - os_free(tmp); +@@ -5765,6 +5782,13 @@ static void handle_assoc(struct hostapd_ + } + #endif /* CONFIG_FILS */ + ubus_resp = hostapd_ubus_handle_event(hapd, &req); + if (ubus_resp) { @@ -158,11 +158,10 @@ + resp = ubus_resp > 0 ? (u16) ubus_resp : WLAN_STATUS_UNSPECIFIED_FAILURE; + goto fail; + } -+ + fail: + /* - * Remove the station in case transmission of a success response fails - * (the STA was added associated to the driver) or if the station was -@@ -5858,6 +5883,7 @@ static void handle_disassoc(struct hosta +@@ -5858,6 +5882,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)); @@ -170,7 +169,7 @@ sta = ap_get_sta(hapd, mgmt->sa); if (sta == NULL) { -@@ -5927,6 +5953,8 @@ static void handle_deauth(struct hostapd +@@ -5927,6 +5952,8 @@ static void handle_deauth(struct hostapd /* Clear the PTKSA cache entries for PASN */ ptksa_cache_flush(hapd->ptksa, mgmt->sa, WPA_CIPHER_NONE); |