patch for the linux kernels 4.9.x IEEE80211_TX_CTL_REQ_TX_STATUS IEEE80211_TX_INTFL_MLME_CONN_TX

From: tibaldiamos
Date: Mon Jul 31 2017 - 06:50:23 EST


tibaldi@localhost:/usr/src/linux-source-4.9$ grep -r "send\ auth\ t" *
Binary file net/mac80211/mlme.o matches
Binary file net/mac80211/mac80211.o matches
net/mac80211/mlme.c: sdata_info(sdata, "send auth to %pM (try %d/%d)\n",
Binary file net/mac80211/mac80211.ko matches
tibaldi@localhost:/usr/src/linux-source-4.9$

Jul 23 16:43:36 localhost NetworkManager[639]: <info> [1500821016.5118] device (wlxc83a35c04107): Activation: starting connection 'WiMORE' (b1b43248-9501-4ebb-a4bc-694296920648) Jul 23 16:43:36 localhost NetworkManager[639]: <info> [1500821016.5121] audit: op="connection-activate" uuid="b1b43248-9501-4ebb-a4bc-694296920648" name="WiMORE" pid=20224 uid=1000 result="success" Jul 23 16:43:36 localhost NetworkManager[639]: <info> [1500821016.5125] device (wlxc83a35c04107): state change: disconnected -> prepare (reason 'none') [30 40 0] Jul 23 16:43:36 localhost NetworkManager[639]: <info> [1500821016.9275] device (wlxc83a35c04107): set-hw-addr: reset MAC address to C8:3A:35:C0:41:07 (preserve) Jul 23 16:43:37 localhost kernel: [ 8013.517100] IPv6: ADDRCONF(NETDEV_UP): wlxc83a35c04107: link is not ready Jul 23 16:43:37 localhost NetworkManager[639]: <info> [1500821017.2674] device (wlxc83a35c04107): state change: prepare -> config (reason 'none') [40 50 0] Jul 23 16:43:37 localhost NetworkManager[639]: <info> [1500821017.2677] device (wlxc83a35c04107): Activation: (wifi) access point 'WiMORE' has security, but secrets are required. Jul 23 16:43:37 localhost NetworkManager[639]: <info> [1500821017.2677] device (wlxc83a35c04107): state change: config -> need-auth (reason 'none') [50 60 0] Jul 23 16:43:37 localhost NetworkManager[639]: <info> [1500821017.2929] device (wlxc83a35c04107): state change: need-auth -> prepare (reason 'none') [60 40 0] Jul 23 16:43:37 localhost NetworkManager[639]: <info> [1500821017.2933] device (wlxc83a35c04107): state change: prepare -> config (reason 'none') [40 50 0] Jul 23 16:43:37 localhost NetworkManager[639]: <info> [1500821017.2936] device (wlxc83a35c04107): Activation: (wifi) connection 'WiMORE' has security, and secrets exist. No new secrets needed. Jul 23 16:43:37 localhost NetworkManager[639]: <info> [1500821017.2937] Config: added 'ssid' value 'WiMORE' Jul 23 16:43:37 localhost NetworkManager[639]: <info> [1500821017.2937] Config: added 'scan_ssid' value '1' Jul 23 16:43:37 localhost NetworkManager[639]: <info> [1500821017.2938] Config: added 'key_mgmt' value 'WPA-PSK' Jul 23 16:43:37 localhost NetworkManager[639]: <info> [1500821017.2938] Config: added 'auth_alg' value 'OPEN' Jul 23 16:43:37 localhost NetworkManager[639]: <info> [1500821017.2938] Config: added 'psk' value '<hidden>' Jul 23 16:43:37 localhost wpa_supplicant[745]: wlxc83a35c04107: SME: Trying to authenticate with 14:91:82:69:22:aa (SSID='WiMORE' freq=2412 MHz) Jul 23 16:43:37 localhost kernel: [ 8013.558674] wlxc83a35c04107: authenticate with 14:91:82:69:22:aa Jul 23 16:43:37 localhost NetworkManager[639]: <info> [1500821017.3438] device (wlxc83a35c04107): supplicant interface state: inactive -> authenticating Jul 23 16:43:37 localhost kernel: [ 8013.594741] wlxc83a35c04107: send auth to 14:91:82:69:22:aa (try 1/3) Jul 23 16:43:37 localhost kernel: [ 8013.801315] wlxc83a35c04107: send auth to 14:91:82:69:22:aa (try 2/3) Jul 23 16:43:37 localhost kernel: [ 8013.802870] wlxc83a35c04107: authenticated Jul 23 16:43:42 localhost wpa_supplicant[745]: wlxc83a35c04107: SME: Deauth request to the driver failed Jul 23 16:43:42 localhost wpa_supplicant[745]: wlxc83a35c04107: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="WiMORE" auth_failures=1 duration=10 reason=CONN_FAILED Jul 23 16:43:42 localhost NetworkManager[639]: <info> [1500821022.3522] device (wlxc83a35c04107): supplicant interface state: authenticating -> disconnected Jul 23 16:43:52 localhost NetworkManager[639]: <info> [1500821032.3553] device (wlxc83a35c04107): supplicant interface state: disconnected -> scanning Jul 23 16:43:53 localhost wpa_supplicant[745]: wlxc83a35c04107: CTRL-EVENT-SSID-REENABLED id=0 ssid="WiMORE" Jul 23 16:43:53 localhost kernel: [ 8030.117727] wlxc83a35c04107: authenticate with 14:91:82:69:22:aa Jul 23 16:43:53 localhost wpa_supplicant[745]: wlxc83a35c04107: SME: Trying to authenticate with 14:91:82:69:22:aa (SSID='WiMORE' freq=2412 MHz) Jul 23 16:43:53 localhost NetworkManager[639]: <info> [1500821033.9327] device (wlxc83a35c04107): supplicant interface state: scanning -> authenticating Jul 23 16:43:53 localhost kernel: [ 8030.183868] wlxc83a35c04107: send auth to 14:91:82:69:22:aa (try 1/3) Jul 23 16:43:53 localhost kernel: [ 8030.185392] wlxc83a35c04107: authenticated Jul 23 16:43:58 localhost wpa_supplicant[745]: wlxc83a35c04107: SME: Deauth request to the driver failed Jul 23 16:43:58 localhost wpa_supplicant[745]: wlxc83a35c04107: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="WiMORE" auth_failures=2 duration=20 reason=CONN_FAILED Jul 23 16:43:58 localhost NetworkManager[639]: <info> [1500821038.9425] device (wlxc83a35c04107): supplicant interface state: authenticating -> disconnected


the patch

static int ieee80211_auth(struct ieee80211_sub_if_data *sdata) {
struct ieee80211_local *local = sdata->local; struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; struct ieee80211_mgd_auth_data *auth_data = ifmgd->auth_data; u32 tx_flags = 0; u16 trans = 1; u16 status = 0; sdata_assert_lock(sdata); if (WARN_ON_ONCE(!auth_data)) return -EINVAL; auth_data->tries++; if (auth_data->tries > IEEE80211_AUTH_MAX_TRIES) { sdata_info(sdata, "authentication with %pM timed out\n", auth_data->bss->bssid); /* * Most likely AP is not in the range so remove the * bss struct for that AP. */ cfg80211_unlink_bss(local->hw.wiphy, auth_data->bss); return -ETIMEDOUT; } drv_mgd_prepare_tx(local, sdata); sdata_info(sdata, "send auth to %pM (try %d/%d)\n", auth_data->bss->bssid, auth_data->tries, IEEE80211_AUTH_MAX_TRIES); auth_data->expected_transaction = 2; if (auth_data->algorithm == WLAN_AUTH_SAE) { trans = auth_data->sae_trans; status = auth_data->sae_status; auth_data->expected_transaction = trans; } if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) tx_flags = IEEE80211_TX_CTL_REQ_TX_STATUS | (IEEE80211_TX_INTFL_MLME_CONN_TX && (!(IEEE80211_TX_CTL_REQ_TX_STATUS))); ieee80211_send_auth(sdata, trans, auth_data->algorithm, status, auth_data->data, auth_data->data_len, auth_data->bss->bssid, auth_data->bss->bssid, NULL, 0, 0, tx_flags); if (tx_flags == 0) { auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; auth_data->timeout_started = true; run_again(sdata, auth_data->timeout); } else { auth_data->timeout = round_jiffies_up(jiffies + IEEE80211_AUTH_TIMEOUT_LONG); auth_data->timeout_started = true; run_again(sdata, auth_data->timeout); } return 0; }

static int ieee80211_do_assoc(struct ieee80211_sub_if_data *sdata) {


the final compilation result

tibaldi@localhost:~$ cd /usr/src/linux-source-4.9/
tibaldi@localhost:/usr/src/linux-source-4.9$ make -j 2
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/package.h
CHK include/generated/utsrelease.h
CHK include/generated/timeconst.h
CHK include/generated/bounds.h
CHK include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CC [M] net/mac80211/mlme.o
LD [M] net/mac80211/mac80211.o
Building modules, stage 2.
DATAREL arch/x86/boot/compressed/vmlinux
Kernel: arch/x86/boot/bzImage is ready (#1)
MODPOST 3381 modules
LD [M] net/mac80211/mac80211.ko
tibaldi@localhost:/usr/src/linux-source-4.9$


Amos Tibaldi - tibaldi.amos@xxxxxxxxx - www.amostibaldi.it