aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2014-04-16 15:49:34 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-16 16:07:19 -0400
commit33c84bc14c25074ac14644cf7db75a57e9abaf1a (patch)
tree55b754e16339785663f1e9955a9410ed4994bd2f
parentf764cd68d9036498f08fe8834deb6a367b5c2542 (diff)
staging: r8188eu: Fix case where ethtype was never obtained and always be checked against 0
Zero-initializing ether_type masked that the ether type would never be obtained for 8021x packets and the comparison against eapol_type would always fail. Reported-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/rtl8188eu/core/rtw_recv.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 01fcabcc8e56..e305d43ebd06 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -551,10 +551,9 @@ static struct recv_frame *portctrl(struct adapter *adapter,
551 struct sta_info *psta; 551 struct sta_info *psta;
552 struct sta_priv *pstapriv; 552 struct sta_priv *pstapriv;
553 struct recv_frame *prtnframe; 553 struct recv_frame *prtnframe;
554 u16 ether_type = 0; 554 u16 ether_type;
555 u16 eapol_type = 0x888e;/* for Funia BD's WPA issue */ 555 u16 eapol_type = 0x888e;/* for Funia BD's WPA issue */
556 struct rx_pkt_attrib *pattrib; 556 struct rx_pkt_attrib *pattrib;
557 __be16 be_tmp;
558 557
559 558
560 pstapriv = &adapter->stapriv; 559 pstapriv = &adapter->stapriv;
@@ -572,18 +571,16 @@ static struct recv_frame *portctrl(struct adapter *adapter,
572 RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("########portctrl:adapter->securitypriv.dot11AuthAlgrthm=%d\n", adapter->securitypriv.dot11AuthAlgrthm)); 571 RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("########portctrl:adapter->securitypriv.dot11AuthAlgrthm=%d\n", adapter->securitypriv.dot11AuthAlgrthm));
573 572
574 if (auth_alg == 2) { 573 if (auth_alg == 2) {
574 /* get ether_type */
575 ptr = ptr + pfhdr->attrib.hdrlen + LLC_HEADER_SIZE;
576 memcpy(&ether_type, ptr, 2);
577 ether_type = ntohs((unsigned short)ether_type);
578
575 if ((psta != NULL) && (psta->ieee8021x_blocked)) { 579 if ((psta != NULL) && (psta->ieee8021x_blocked)) {
576 /* blocked */ 580 /* blocked */
577 /* only accept EAPOL frame */ 581 /* only accept EAPOL frame */
578 RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("########portctrl:psta->ieee8021x_blocked==1\n")); 582 RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("########portctrl:psta->ieee8021x_blocked==1\n"));
579 583
580 prtnframe = precv_frame;
581
582 /* get ether_type */
583 ptr = ptr+pfhdr->attrib.hdrlen+pfhdr->attrib.iv_len+LLC_HEADER_SIZE;
584 memcpy(&be_tmp, ptr, 2);
585 ether_type = ntohs(be_tmp);
586
587 if (ether_type == eapol_type) { 584 if (ether_type == eapol_type) {
588 prtnframe = precv_frame; 585 prtnframe = precv_frame;
589 } else { 586 } else {