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

staging: r8188eu: simplify the checks for zero address

In function ap2sta_data_frame, we can use is_zero_ether_addr to check for
all-zero ethernet addresses. Both pattrib->bssid and mybssid are 16-bit
aligned.

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/20221126154253.178275-5-martin@kaiser.cxSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 77833c30
...@@ -779,9 +779,8 @@ static int ap2sta_data_frame( ...@@ -779,9 +779,8 @@ static int ap2sta_data_frame(
} }
/* check BSSID */ /* check BSSID */
if (!memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || if (is_zero_ether_addr(pattrib->bssid) || is_zero_ether_addr(mybssid) ||
!memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) {
(memcmp(pattrib->bssid, mybssid, ETH_ALEN))) {
if (!bmcast) if (!bmcast)
issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
......
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