--- src/sys/netproto/802_11/wlan/ieee80211_input.c 2007/03/26 11:08:30 1.19 +++ src/sys/netproto/802_11/wlan/ieee80211_input.c 2007/05/07 14:12:16 1.20 @@ -135,6 +135,14 @@ int ieee80211_input(struct ieee80211com *ic, struct mbuf *m, struct ieee80211_node *ni, int rssi, uint32_t rstamp) { + return ieee80211_input_withiv(ic, m, ni, rssi, rstamp, NULL); +} + +int +ieee80211_input_withiv(struct ieee80211com *ic, struct mbuf *m, + struct ieee80211_node *ni, int rssi, uint32_t rstamp, + const struct ieee80211_crypto_iv *iv) +{ #define SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0) #define HAS_SEQ(type) ((type & 0x4) == 0) struct ifnet *ifp = ic->ic_ifp; @@ -388,7 +396,12 @@ ieee80211_input(struct ieee80211com *ic, IEEE80211_NODE_STAT(ni, rx_noprivacy); goto out; } - key = ieee80211_crypto_decap(ic, ni, m, hdrspace); + if (iv == NULL) { + key = ieee80211_crypto_decap(ic, ni, m, + hdrspace); + } else { + key = ieee80211_crypto_update(ic, ni, iv, wh); + } if (key == NULL) { /* NB: stats+msgs handled in crypto_decap */ IEEE80211_NODE_STAT(ni, rx_wepfail); @@ -527,8 +540,13 @@ ieee80211_input(struct ieee80211com *ic, ic->ic_stats.is_rx_noprivacy++; goto out; } - hdrspace = ieee80211_hdrspace(ic, wh); - key = ieee80211_crypto_decap(ic, ni, m, hdrspace); + if (iv == NULL) { + hdrspace = ieee80211_hdrspace(ic, wh); + key = ieee80211_crypto_decap(ic, ni, m, + hdrspace); + } else { + key = ieee80211_crypto_update(ic, ni, iv, wh); + } if (key == NULL) { /* NB: stats+msgs handled in crypto_decap */ goto out;