aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8188eu/core/rtw_recv.c
diff options
context:
space:
mode:
authorIvan Safonov <insafonov@gmail.com>2017-05-02 09:01:42 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-15 07:41:59 +0200
commit79650ffde38ec4dd8f5c39ff0a305fb0bc1bb142 (patch)
treee6cbdd9a65c239fa224af90bbb6f895e618049d8 /drivers/staging/rtl8188eu/core/rtw_recv.c
parentstaging:r8188eu: inline unprotect_frame() in mon_recv_decrypted_recv() (diff)
downloadlinux-dev-79650ffde38ec4dd8f5c39ff0a305fb0bc1bb142.tar.xz
linux-dev-79650ffde38ec4dd8f5c39ff0a305fb0bc1bb142.zip
staging:r8188eu: trim IV/ICV fields in validate_recv_data_frame()
Length of IV/ICV fields calculated here, so trim these field here too. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8188eu/core/rtw_recv.c')
-rw-r--r--drivers/staging/rtl8188eu/core/rtw_recv.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index e8f0ff93f05a..2c37bb548c0f 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -1138,6 +1138,8 @@ static int validate_recv_data_frame(struct adapter *adapter,
}
if (pattrib->privacy) {
+ struct sk_buff *skb = precv_frame->pkt;
+
RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("validate_recv_data_frame:pattrib->privacy=%x\n", pattrib->privacy));
RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n ^^^^^^^^^^^IS_MCAST(pattrib->ra(0x%02x))=%d^^^^^^^^^^^^^^^6\n", pattrib->ra[0], IS_MCAST(pattrib->ra)));
@@ -1146,6 +1148,13 @@ static int validate_recv_data_frame(struct adapter *adapter,
RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n pattrib->encrypt=%d\n", pattrib->encrypt));
SET_ICE_IV_LEN(pattrib->iv_len, pattrib->icv_len, pattrib->encrypt);
+
+ if (pattrib->bdecrypted == 1 && pattrib->encrypt > 0) {
+ memmove(skb->data + pattrib->iv_len,
+ skb->data, pattrib->hdrlen);
+ skb_pull(skb, pattrib->iv_len);
+ skb_trim(skb, skb->len - pattrib->icv_len);
+ }
} else {
pattrib->encrypt = 0;
pattrib->iv_len = 0;
@@ -1265,14 +1274,8 @@ static int validate_recv_frame(struct adapter *adapter,
* Hence forward the frame to the monitor anyway to preserve the order
* in which frames were received.
*/
- rtl88eu_mon_recv_hook(adapter->pmondev, precv_frame);
- if (precv_frame->attrib.bdecrypted == 1 && precv_frame->attrib.encrypt > 0 &&
- (adapter->securitypriv.busetkipkey == 1 || precv_frame->attrib.encrypt != _TKIP_)) {
- memmove(precv_frame->pkt->data + precv_frame->attrib.iv_len, precv_frame->pkt->data, precv_frame->attrib.hdrlen);
- skb_pull(precv_frame->pkt, precv_frame->attrib.iv_len);
- skb_trim(precv_frame->pkt, precv_frame->pkt->len - precv_frame->attrib.icv_len);
- }
+ rtl88eu_mon_recv_hook(adapter->pmondev, precv_frame);
exit: