aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2014-04-16 15:49:33 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-16 16:07:19 -0400
commitf764cd68d9036498f08fe8834deb6a367b5c2542 (patch)
treebb1d77b9119cce9425c564dc2e0c4fb281373c4d
parent9452bf560273e4de2395ffdd79024debfb0c1290 (diff)
staging: r8712u: 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/rtl8712/rtl871x_recv.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c
index 23ec684b60e1..274c359279ef 100644
--- a/drivers/staging/rtl8712/rtl871x_recv.c
+++ b/drivers/staging/rtl8712/rtl871x_recv.c
@@ -254,7 +254,7 @@ union recv_frame *r8712_portctrl(struct _adapter *adapter,
254 struct sta_info *psta; 254 struct sta_info *psta;
255 struct sta_priv *pstapriv; 255 struct sta_priv *pstapriv;
256 union recv_frame *prtnframe; 256 union recv_frame *prtnframe;
257 u16 ether_type = 0; 257 u16 ether_type;
258 258
259 pstapriv = &adapter->stapriv; 259 pstapriv = &adapter->stapriv;
260 ptr = get_recvframe_data(precv_frame); 260 ptr = get_recvframe_data(precv_frame);
@@ -263,15 +263,14 @@ union recv_frame *r8712_portctrl(struct _adapter *adapter,
263 psta = r8712_get_stainfo(pstapriv, psta_addr); 263 psta = r8712_get_stainfo(pstapriv, psta_addr);
264 auth_alg = adapter->securitypriv.AuthAlgrthm; 264 auth_alg = adapter->securitypriv.AuthAlgrthm;
265 if (auth_alg == 2) { 265 if (auth_alg == 2) {
266 /* get ether_type */
267 ptr = ptr + pfhdr->attrib.hdrlen + LLC_HEADER_SIZE;
268 memcpy(&ether_type, ptr, 2);
269 ether_type = ntohs((unsigned short)ether_type);
270
266 if ((psta != NULL) && (psta->ieee8021x_blocked)) { 271 if ((psta != NULL) && (psta->ieee8021x_blocked)) {
267 /* blocked 272 /* blocked
268 * only accept EAPOL frame */ 273 * only accept EAPOL frame */
269 prtnframe = precv_frame;
270 /*get ether_type */
271 ptr = ptr + pfhdr->attrib.hdrlen +
272 pfhdr->attrib.iv_len + LLC_HEADER_SIZE;
273 memcpy(&ether_type, ptr, 2);
274 ether_type = ntohs((unsigned short)ether_type);
275 if (ether_type == 0x888e) 274 if (ether_type == 0x888e)
276 prtnframe = precv_frame; 275 prtnframe = precv_frame;
277 else { 276 else {