Fix a number of driver which doesn't check wep flag in *_tx_mgt.

It is incorrect because we need to encrypt some management frame in case of
shared authentification.
This commit is contained in:
degroote 2007-10-21 17:03:37 +00:00
parent a409673bc7
commit 0e9691e3e3
5 changed files with 65 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: rt2560.c,v 1.13 2007/10/19 11:59:59 ad Exp $ */
/* $NetBSD: rt2560.c,v 1.14 2007/10/21 17:03:37 degroote Exp $ */
/* $OpenBSD: rt2560.c,v 1.15 2006/04/20 20:31:12 miod Exp $ */
/* $FreeBSD: rt2560.c,v 1.3 2006/03/21 21:15:43 damien Exp $*/
@ -24,7 +24,7 @@
* http://www.ralinktech.com/
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rt2560.c,v 1.13 2007/10/19 11:59:59 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: rt2560.c,v 1.14 2007/10/21 17:03:37 degroote Exp $");
#include "bpfilter.h"
@ -1794,6 +1794,7 @@ rt2560_tx_mgt(struct rt2560_softc *sc, struct mbuf *m0,
struct rt2560_tx_desc *desc;
struct rt2560_tx_data *data;
struct ieee80211_frame *wh;
struct ieee80211_key *k;
uint16_t dur;
uint32_t flags = 0;
int rate, error;
@ -1803,6 +1804,16 @@ rt2560_tx_mgt(struct rt2560_softc *sc, struct mbuf *m0,
rate = IEEE80211_IS_CHAN_5GHZ(ni->ni_chan) ? 12 : 2;
wh = mtod(m0, struct ieee80211_frame *);
if (wh->i_fc[1] & IEEE80211_FC1_WEP) {
k = ieee80211_crypto_encap(ic, ni, m0);
if (k == NULL) {
m_freem(m0);
return ENOBUFS;
}
}
error = bus_dmamap_load_mbuf(sc->sc_dmat, data->map, m0,
BUS_DMA_NOWAIT);
if (error != 0) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: rt2661.c,v 1.19 2007/10/19 11:59:59 ad Exp $ */
/* $NetBSD: rt2661.c,v 1.20 2007/10/21 17:03:37 degroote Exp $ */
/* $OpenBSD: rt2661.c,v 1.17 2006/05/01 08:41:11 damien Exp $ */
/* $FreeBSD: rt2560.c,v 1.5 2006/06/02 19:59:31 csjp Exp $ */
@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rt2661.c,v 1.19 2007/10/19 11:59:59 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: rt2661.c,v 1.20 2007/10/21 17:03:37 degroote Exp $");
#include "bpfilter.h"
@ -1574,6 +1574,7 @@ rt2661_tx_mgt(struct rt2661_softc *sc, struct mbuf *m0,
struct rt2661_tx_desc *desc;
struct rt2661_tx_data *data;
struct ieee80211_frame *wh;
struct ieee80211_key *k;
uint16_t dur;
uint32_t flags = 0;
int rate, error;
@ -1584,6 +1585,16 @@ rt2661_tx_mgt(struct rt2661_softc *sc, struct mbuf *m0,
/* send mgt frames at the lowest available rate */
rate = IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan) ? 12 : 2;
wh = mtod(m0, struct ieee80211_frame *);
if (wh->i_fc[1] & IEEE80211_FC1_WEP) {
k = ieee80211_crypto_encap(ic, ni, m0);
if (k == NULL) {
m_freem(m0);
return ENOBUFS;
}
}
error = bus_dmamap_load_mbuf(sc->sc_dmat, data->map, m0,
BUS_DMA_NOWAIT);
if (error != 0) {

View File

@ -1,5 +1,5 @@
/* $OpenBSD: if_rum.c,v 1.40 2006/09/18 16:20:20 damien Exp $ */
/* $NetBSD: if_rum.c,v 1.16 2007/10/19 12:01:21 ad Exp $ */
/* $NetBSD: if_rum.c,v 1.17 2007/10/21 17:03:37 degroote Exp $ */
/*-
* Copyright (c) 2005, 2006 Damien Bergamini <damien.bergamini@free.fr>
@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.16 2007/10/19 12:01:21 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.17 2007/10/21 17:03:37 degroote Exp $");
#include "bpfilter.h"
@ -1083,6 +1083,7 @@ rum_tx_mgt(struct rum_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
struct rum_tx_desc *desc;
struct rum_tx_data *data;
struct ieee80211_frame *wh;
struct ieee80211_key *k;
uint32_t flags = 0;
uint16_t dur;
usbd_status error;
@ -1098,6 +1099,16 @@ rum_tx_mgt(struct rum_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
wh = mtod(m0, struct ieee80211_frame *);
if (wh->i_fc[1] & IEEE80211_FC1_WEP) {
k = ieee80211_crypto_encap(ic, ni, m0);
if (k == NULL) {
m_freem(m0);
return ENOBUFS;
}
}
wh = mtod(m0, struct ieee80211_frame *);
if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) {
flags |= RT2573_TX_ACK;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ural.c,v 1.25 2007/10/19 12:01:21 ad Exp $ */
/* $NetBSD: if_ural.c,v 1.26 2007/10/21 17:03:37 degroote Exp $ */
/* $FreeBSD: /repoman/r/ncvs/src/sys/dev/usb/if_ural.c,v 1.40 2006/06/02 23:14:40 sam Exp $ */
/*-
@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ural.c,v 1.25 2007/10/19 12:01:21 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_ural.c,v 1.26 2007/10/21 17:03:37 degroote Exp $");
#include "bpfilter.h"
@ -1205,6 +1205,7 @@ ural_tx_mgt(struct ural_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
struct ural_tx_desc *desc;
struct ural_tx_data *data;
struct ieee80211_frame *wh;
struct ieee80211_key *k;
uint32_t flags = 0;
uint16_t dur;
usbd_status error;
@ -1215,6 +1216,16 @@ ural_tx_mgt(struct ural_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
rate = IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan) ? 12 : 2;
wh = mtod(m0, struct ieee80211_frame *);
if (wh->i_fc[1] & IEEE80211_FC1_WEP) {
k = ieee80211_crypto_encap(ic, ni, m0);
if (k == NULL) {
m_freem(m0);
return ENOBUFS;
}
}
data->m = m0;
data->ni = ni;

View File

@ -1,5 +1,5 @@
/* $OpenBSD: if_zyd.c,v 1.52 2007/02/11 00:08:04 jsg Exp $ */
/* $NetBSD: if_zyd.c,v 1.11 2007/10/19 12:01:21 ad Exp $ */
/* $NetBSD: if_zyd.c,v 1.12 2007/10/21 17:03:37 degroote Exp $ */
/*-
* Copyright (c) 2006 by Damien Bergamini <damien.bergamini@free.fr>
@ -22,7 +22,7 @@
* ZyDAS ZD1211/ZD1211B USB WLAN driver.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_zyd.c,v 1.11 2007/10/19 12:01:21 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_zyd.c,v 1.12 2007/10/21 17:03:37 degroote Exp $");
#include "bpfilter.h"
@ -2049,6 +2049,7 @@ zyd_tx_mgt(struct zyd_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
struct zyd_tx_desc *desc;
struct zyd_tx_data *data;
struct ieee80211_frame *wh;
struct ieee80211_key *k;
int xferlen, totlen, rate;
uint16_t pktlen;
usbd_status error;
@ -2058,6 +2059,16 @@ zyd_tx_mgt(struct zyd_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
rate = IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan) ? 12 : 2;
wh = mtod(m0, struct ieee80211_frame *);
if (wh->i_fc[1] & IEEE80211_FC1_WEP) {
k = ieee80211_crypto_encap(ic, ni, m0);
if (k == NULL) {
m_freem(m0);
return ENOBUFS;
}
}
data->ni = ni;
wh = mtod(m0, struct ieee80211_frame *);