diff options
author | kevlo <kevlo@FreeBSD.org> | 2007-11-06 07:30:12 +0000 |
---|---|---|
committer | kevlo <kevlo@FreeBSD.org> | 2007-11-06 07:30:12 +0000 |
commit | 45cc59ef4fed7a576c50eedd3a9202e5a65a68f0 (patch) | |
tree | e3045ff26a3b52e03dfd3bf67b99dd9a6772dcff /sys/dev | |
parent | 72f16026630d78ae3329934269d62a961ba1f823 (diff) | |
download | FreeBSD-src-45cc59ef4fed7a576c50eedd3a9202e5a65a68f0.zip FreeBSD-src-45cc59ef4fed7a576c50eedd3a9202e5a65a68f0.tar.gz |
Check wep flag in *_tx_mgt since we need to encrypt some management frame
in case of shared authentification.
Obtained from: NetBSD
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ral/rt2560.c | 11 | ||||
-rw-r--r-- | sys/dev/ral/rt2661.c | 11 | ||||
-rw-r--r-- | sys/dev/usb/if_rum.c | 11 | ||||
-rw-r--r-- | sys/dev/usb/if_ural.c | 11 | ||||
-rw-r--r-- | sys/dev/usb/if_zyd.c | 11 |
5 files changed, 55 insertions, 0 deletions
diff --git a/sys/dev/ral/rt2560.c b/sys/dev/ral/rt2560.c index b72ca40..58f4590 100644 --- a/sys/dev/ral/rt2560.c +++ b/sys/dev/ral/rt2560.c @@ -1612,6 +1612,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; bus_dma_segment_t segs[RT2560_MAX_SCATTER]; uint16_t dur; uint32_t flags = 0; @@ -1622,6 +1623,16 @@ rt2560_tx_mgt(struct rt2560_softc *sc, struct mbuf *m0, 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_sg(sc->prioq.data_dmat, data->map, m0, segs, &nsegs, 0); if (error != 0) { diff --git a/sys/dev/ral/rt2661.c b/sys/dev/ral/rt2661.c index 60171ee..8d6e859 100644 --- a/sys/dev/ral/rt2661.c +++ b/sys/dev/ral/rt2661.c @@ -1430,6 +1430,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; bus_dma_segment_t segs[RT2661_MAX_SCATTER]; uint16_t dur; uint32_t flags = 0; /* XXX HWSEQ */ @@ -1441,6 +1442,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_sg(sc->mgtq.data_dmat, data->map, m0, segs, &nsegs, 0); if (error != 0) { diff --git a/sys/dev/usb/if_rum.c b/sys/dev/usb/if_rum.c index aa060f4..5543315 100644 --- a/sys/dev/usb/if_rum.c +++ b/sys/dev/usb/if_rum.c @@ -1132,6 +1132,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; @@ -1147,6 +1148,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_NEED_ACK; diff --git a/sys/dev/usb/if_ural.c b/sys/dev/usb/if_ural.c index 819a730..c2b063f 100644 --- a/sys/dev/usb/if_ural.c +++ b/sys/dev/usb/if_ural.c @@ -1192,6 +1192,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; @@ -1202,6 +1203,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; diff --git a/sys/dev/usb/if_zyd.c b/sys/dev/usb/if_zyd.c index 1cece8b..45be4d1 100644 --- a/sys/dev/usb/if_zyd.c +++ b/sys/dev/usb/if_zyd.c @@ -2014,6 +2014,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; @@ -2023,6 +2024,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; data->m = m0; |