-+ (!(vap->iv_flags_ext & IEEE80211_FEXT_WDS) &&
-+ (dir == IEEE80211_FC1_DIR_DSTODS))) {
- IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY,
- wh, "data", "invalid dir 0x%x", dir);
- vap->iv_stats.is_rx_wrongdir++;
- goto out;
+- IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY,
+- wh, "data", "invalid dir 0x%x", dir);
+- vap->iv_stats.is_rx_wrongdir++;
+- goto out;
++ {
++ int accept;
++
++ if (vap->iv_flags_ext & IEEE80211_FEXT_WDS)
++ accept = IEEE80211_FC1_DIR_DSTODS;
++ else
++ accept = IEEE80211_FC1_DIR_FROMDS;
++ if (dir != accept) {
++ IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY,
++ wh, "data", "invalid dir 0x%x", dir);
++ vap->iv_stats.is_rx_wrongdir++;
++ goto out;
++ }