Lines 170-176
ieee80211_input_mimo_all(struct ieee80211com *ic, struct mbuf *m)
Link Here
|
170 |
* XXX should handle 3 concurrent reassemblies per-spec. |
170 |
* XXX should handle 3 concurrent reassemblies per-spec. |
171 |
*/ |
171 |
*/ |
172 |
struct mbuf * |
172 |
struct mbuf * |
173 |
ieee80211_defrag(struct ieee80211_node *ni, struct mbuf *m, int hdrspace) |
173 |
ieee80211_defrag(struct ieee80211_node *ni, struct mbuf *m, int hdrspace, |
|
|
174 |
int has_decrypted) |
174 |
{ |
175 |
{ |
175 |
struct ieee80211vap *vap = ni->ni_vap; |
176 |
struct ieee80211vap *vap = ni->ni_vap; |
176 |
struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); |
177 |
struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); |
Lines 189-194
ieee80211_defrag(struct ieee80211_node *ni, struct mbuf *m, int hdrspace)
Link Here
|
189 |
if (!more_frag && fragno == 0 && ni->ni_rxfrag[0] == NULL) |
190 |
if (!more_frag && fragno == 0 && ni->ni_rxfrag[0] == NULL) |
190 |
return m; |
191 |
return m; |
191 |
|
192 |
|
|
|
193 |
/* Temporarily set flag to remember if fragment was encrypted */ |
194 |
if (has_decrypted) |
195 |
wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; |
196 |
|
192 |
/* |
197 |
/* |
193 |
* Remove frag to insure it doesn't get reaped by timer. |
198 |
* Remove frag to insure it doesn't get reaped by timer. |
194 |
*/ |
199 |
*/ |
Lines 219-228
ieee80211_defrag(struct ieee80211_node *ni, struct mbuf *m, int hdrspace)
Link Here
|
219 |
|
224 |
|
220 |
lwh = mtod(mfrag, struct ieee80211_frame *); |
225 |
lwh = mtod(mfrag, struct ieee80211_frame *); |
221 |
last_rxseq = le16toh(*(uint16_t *)lwh->i_seq); |
226 |
last_rxseq = le16toh(*(uint16_t *)lwh->i_seq); |
222 |
/* NB: check seq # and frag together */ |
227 |
/* |
|
|
228 |
* NB: check seq # and frag together. Also check that both |
229 |
* fragments are plaintext or that both are encrypted. |
230 |
* */ |
223 |
if (rxseq == last_rxseq+1 && |
231 |
if (rxseq == last_rxseq+1 && |
224 |
IEEE80211_ADDR_EQ(wh->i_addr1, lwh->i_addr1) && |
232 |
IEEE80211_ADDR_EQ(wh->i_addr1, lwh->i_addr1) && |
225 |
IEEE80211_ADDR_EQ(wh->i_addr2, lwh->i_addr2)) { |
233 |
IEEE80211_ADDR_EQ(wh->i_addr2, lwh->i_addr2) && |
|
|
234 |
!((wh->i_fc[1] ^ lwh->i_fc[1]) & IEEE80211_FC1_PROTECTED)) { |
226 |
/* XXX clear MORE_FRAG bit? */ |
235 |
/* XXX clear MORE_FRAG bit? */ |
227 |
/* track last seqnum and fragno */ |
236 |
/* track last seqnum and fragno */ |
228 |
*(uint16_t *) lwh->i_seq = *(uint16_t *) wh->i_seq; |
237 |
*(uint16_t *) lwh->i_seq = *(uint16_t *) wh->i_seq; |
Lines 253-258
ieee80211_defrag(struct ieee80211_node *ni, struct mbuf *m, int hdrspace)
Link Here
|
253 |
ni->ni_rxfrag[0] = mfrag; |
262 |
ni->ni_rxfrag[0] = mfrag; |
254 |
mfrag = NULL; |
263 |
mfrag = NULL; |
255 |
} |
264 |
} |
|
|
265 |
/* Remember to clear protected flag that was temporariy set */ |
266 |
if (mfrag != NULL) { |
267 |
wh = mtod(mfrag, struct ieee80211_frame *); |
268 |
wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; |
269 |
} |
256 |
return mfrag; |
270 |
return mfrag; |
257 |
} |
271 |
} |
258 |
|
272 |
|