1 From f764cd68d9036498f08fe8834deb6a367b5c2542 Mon Sep 17 00:00:00 2001
2 From: Larry Finger <Larry.Finger@lwfinger.net>
3 Date: Wed, 16 Apr 2014 14:49:33 -0500
4 Subject: staging: r8712u: Fix case where ethtype was never obtained and always be checked against 0
6 From: Larry Finger <Larry.Finger@lwfinger.net>
8 commit f764cd68d9036498f08fe8834deb6a367b5c2542 upstream.
10 Zero-initializing ether_type masked that the ether type would never be
11 obtained for 8021x packets and the comparison against eapol_type
14 Reported-by: Jes Sorensen <Jes.Sorensen@redhat.com>
15 Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19 drivers/staging/rtl8712/rtl871x_recv.c | 13 ++++++-------
20 1 file changed, 6 insertions(+), 7 deletions(-)
22 --- a/drivers/staging/rtl8712/rtl871x_recv.c
23 +++ b/drivers/staging/rtl8712/rtl871x_recv.c
24 @@ -254,7 +254,7 @@ union recv_frame *r8712_portctrl(struct
25 struct sta_info *psta;
26 struct sta_priv *pstapriv;
27 union recv_frame *prtnframe;
31 pstapriv = &adapter->stapriv;
32 ptr = get_recvframe_data(precv_frame);
33 @@ -263,15 +263,14 @@ union recv_frame *r8712_portctrl(struct
34 psta = r8712_get_stainfo(pstapriv, psta_addr);
35 auth_alg = adapter->securitypriv.AuthAlgrthm;
37 + /* get ether_type */
38 + ptr = ptr + pfhdr->attrib.hdrlen + LLC_HEADER_SIZE;
39 + memcpy(ðer_type, ptr, 2);
40 + ether_type = ntohs((unsigned short)ether_type);
42 if ((psta != NULL) && (psta->ieee8021x_blocked)) {
44 * only accept EAPOL frame */
45 - prtnframe = precv_frame;
47 - ptr = ptr + pfhdr->attrib.hdrlen +
48 - pfhdr->attrib.iv_len + LLC_HEADER_SIZE;
49 - memcpy(ðer_type, ptr, 2);
50 - ether_type = ntohs((unsigned short)ether_type);
51 if (ether_type == 0x888e)
52 prtnframe = precv_frame;