FreeBSD Bugzilla – Attachment 154350 Details for
Bug 197143
[wpi] [patch]: sync with iwn / OpenBSD wpi
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Encrypt frame if IEEE80211_BPF_CRYPTO flag is set
patch-wpi39.diff (text/plain), 1.83 KB, created by
Andriy Voskoboinyk
on 2015-03-15 12:35:10 UTC
(
hide
)
Description:
Encrypt frame if IEEE80211_BPF_CRYPTO flag is set
Filename:
MIME Type:
Creator:
Andriy Voskoboinyk
Created:
2015-03-15 12:35:10 UTC
Size:
1.83 KB
patch
obsolete
>Index: sys/dev/wpi/if_wpi.c >=================================================================== >--- sys/dev/wpi/if_wpi.c (revision 279775) >+++ sys/dev/wpi/if_wpi.c (working copy) >@@ -2643,16 +2643,16 @@ > struct ieee80211_node *ni, const struct ieee80211_bpf_params *params) > { > struct ieee80211vap *vap = ni->ni_vap; >+ struct ieee80211_key *k = NULL; > struct ieee80211_frame *wh; > struct wpi_buf tx_data; > struct wpi_cmd_data *tx = (struct wpi_cmd_data *)&tx_data.data; > uint32_t flags; > uint8_t type; >- int ac, rate, totlen; >+ int ac, rate, swcrypt, totlen; > > wh = mtod(m, struct ieee80211_frame *); > type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; >- totlen = m->m_pkthdr.len; > > ac = params->ibp_pri & 3; > >@@ -2669,11 +2669,28 @@ > if (flags & (WPI_TX_NEED_RTS | WPI_TX_NEED_CTS)) > flags |= WPI_TX_FULL_TXOP; > >+ /* Encrypt the frame if need be. */ >+ if (params->ibp_flags & IEEE80211_BPF_CRYPTO) { >+ /* Retrieve key for TX. */ >+ k = ieee80211_crypto_encap(ni, m); >+ if (k == NULL) { >+ m_freem(m); >+ return ENOBUFS; >+ } >+ swcrypt = k->wk_flags & IEEE80211_KEY_SWCRYPT; >+ >+ /* 802.11 header may have moved. */ >+ wh = mtod(m, struct ieee80211_frame *); >+ } >+ totlen = m->m_pkthdr.len; >+ > if (ieee80211_radiotap_active_vap(vap)) { > struct wpi_tx_radiotap_header *tap = &sc->sc_txtap; > > tap->wt_flags = 0; > tap->wt_rate = rate; >+ if (params->ibp_flags & IEEE80211_BPF_CRYPTO) >+ tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; > > ieee80211_radiotap_tx(vap, m); > } >@@ -2692,6 +2709,19 @@ > tx->timeout = htole16(2); > } > >+ if (k != NULL && !swcrypt) { >+ switch (k->wk_cipher->ic_cipher) { >+ case IEEE80211_CIPHER_AES_CCM: >+ tx->security = WPI_CIPHER_CCMP; >+ break; >+ >+ default: >+ break; >+ } >+ >+ memcpy(tx->key, k->wk_key, k->wk_keylen); >+ } >+ > tx->len = htole16(totlen); > tx->flags = htole32(flags); > tx->plcp = rate2plcp(rate);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 197143
:
152282
|
152662
|
152977
|
153911
|
153977
|
153983
|
153985
|
153999
|
154000
|
154002
|
154006
|
154007
|
154009
|
154010
|
154011
|
154013
|
154015
|
154016
|
154017
|
154019
|
154020
|
154021
|
154022
|
154024
|
154026
|
154030
|
154032
|
154033
|
154328
|
154329
|
154330
|
154332
|
154334
|
154335
|
154336
|
154337
|
154338
|
154340
|
154341
|
154343
|
154346
|
154347
|
154348
|
154349
| 154350 |
154351
|
154352
|
154353
|
154354
|
154355
|
154356
|
154357
|
154358
|
154359
|
154360
|
154361
|
154362
|
154363
|
154364
|
154365
|
154366
|
154368
|
154369
|
154370
|
154371
|
154372
|
154373
|
154374
|
154375
|
154378
|
154379
|
154380
|
154381
|
154382
|
154383
|
154384
|
155332
|
155333
|
156164
|
156165
|
156166
|
156167
|
156168
|
156169
|
156170
|
156171
|
156172
|
156173
|
156174
|
156175
|
156176
|
156177
|
156178
|
156179
|
156180
|
156181
|
156182
|
156183
|
156184
|
156185
|
156186
|
156187
|
156188
|
156189
|
156190
|
156191
|
156192
|
156193
|
156194
|
156195