mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 04:21:03 -04:00
staging: r8188eu: check destination address in OnAction
All subfunctions of OnAction check if the destination address matches the local interface's address. It's simpler to move this check to OnAction. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20221030173326.1588647-14-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9001c5029d
commit
ae85931f8f
@@ -1492,9 +1492,6 @@ static void OnAction_back(struct adapter *padapter, struct recv_frame *precv_fra
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
u8 *pframe = precv_frame->rx_data;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
/* check RA matches or not */
|
||||
if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN))/* for if1, sta/ap mode */
|
||||
return;
|
||||
|
||||
if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
|
||||
if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS))
|
||||
@@ -3795,10 +3792,6 @@ static void on_action_public(struct adapter *padapter, struct recv_frame *precv_
|
||||
{
|
||||
struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data;
|
||||
|
||||
/* check RA matches or not */
|
||||
if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN))
|
||||
return;
|
||||
|
||||
/* All members of the action enum start with action_code. */
|
||||
if (mgmt->u.action.u.s1g.action_code == WLAN_PUB_ACTION_VENDOR_SPECIFIC)
|
||||
on_action_public_vendor(precv_frame);
|
||||
@@ -3808,17 +3801,12 @@ static void on_action_public(struct adapter *padapter, struct recv_frame *precv_
|
||||
|
||||
static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame)
|
||||
{
|
||||
struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data;
|
||||
u8 *frame_body;
|
||||
u8 OUI_Subtype;
|
||||
u8 *pframe = precv_frame->rx_data;
|
||||
uint len = precv_frame->len;
|
||||
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
|
||||
|
||||
/* check RA matches or not */
|
||||
if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN))/* for if1, sta/ap mode */
|
||||
return;
|
||||
|
||||
frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr));
|
||||
|
||||
if (be32_to_cpu(*((__be32 *)(frame_body + 1))) != P2POUI)
|
||||
@@ -3835,6 +3823,9 @@ static void OnAction(struct adapter *padapter, struct recv_frame *precv_frame)
|
||||
{
|
||||
struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data;
|
||||
|
||||
if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN))
|
||||
return;
|
||||
|
||||
switch (mgmt->u.action.category) {
|
||||
case WLAN_CATEGORY_BACK:
|
||||
OnAction_back(padapter, precv_frame);
|
||||
|
||||
Reference in New Issue
Block a user