Commit 32634359 authored by Martin Kaiser's avatar Martin Kaiser Committed by Greg Kroah-Hartman

staging: r8188eu: exit if beacon is not from our bss

Do not process an incoming beacon message in the OnBeacon function if the
beacon was sent by a base station other than the one to which we're
connected.

This patch does not modify the behaviour of the code. It reverts the if
condition and returns if the beacon should not be processed. This is
simpler than wrapping the entire processing into a large if clause.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20221126160129.178697-8-martin@kaiser.cxSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 02b51d08
......@@ -569,7 +569,9 @@ static void OnBeacon(struct adapter *padapter, struct recv_frame *precv_frame)
return;
}
if (!memcmp(mgmt->bssid, get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) {
if (memcmp(mgmt->bssid, get_my_bssid(&pmlmeinfo->network), ETH_ALEN))
return;
if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) {
/* we should update current network before auth, or some IE is wrong */
pbss = kmalloc(sizeof(struct wlan_bssid_ex), GFP_ATOMIC);
......@@ -631,7 +633,6 @@ static void OnBeacon(struct adapter *padapter, struct recv_frame *precv_frame)
report_add_sta_event(padapter, mgmt->sa, cam_idx);
}
}
}
}
static void OnAuth(struct adapter *padapter, struct recv_frame *precv_frame)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment