if (skb->len < hdrspace) {
IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY,
wh, "data", "too short: len %u, expecting %u",
if (skb->len < hdrspace) {
IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY,
wh, "data", "too short: len %u, expecting %u",
}
switch (vap->iv_opmode) {
case IEEE80211_M_STA:
- if ((dir != IEEE80211_FC1_DIR_FROMDS) &&
- (!((vap->iv_flags_ext & IEEE80211_FEXT_WDS) &&
- (dir == IEEE80211_FC1_DIR_DSTODS)))) {
}
switch (vap->iv_opmode) {
case IEEE80211_M_STA:
- if ((dir != IEEE80211_FC1_DIR_FROMDS) &&
- (!((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;
-+ {
-+ int accept;
-+
++ switch(dir) {
++ case IEEE80211_FC1_DIR_FROMDS:
++ break;
++ case IEEE80211_FC1_DIR_DSTODS:
+ if (vap->iv_flags_ext & IEEE80211_FEXT_WDS)
+ 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;
-+ }
++ break;
++ default:
+ IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY,
+ wh, "data", "invalid dir 0x%x", dir);
+ vap->iv_stats.is_rx_wrongdir++;
+ goto out;
}
- if (IEEE80211_IS_MULTICAST(wh->i_addr1)) {
}
- if (IEEE80211_IS_MULTICAST(wh->i_addr1)) {
/* Discard multicast if IFF_MULTICAST not set */
if ((0 != memcmp(wh->i_addr3, dev->broadcast, ETH_ALEN)) &&
(0 == (dev->flags & IFF_MULTICAST))) {
/* Discard multicast if IFF_MULTICAST not set */
if ((0 != memcmp(wh->i_addr3, dev->broadcast, ETH_ALEN)) &&
(0 == (dev->flags & IFF_MULTICAST))) {
vap->iv_stats.is_rx_mcastecho++;
goto out;
}
vap->iv_stats.is_rx_mcastecho++;
goto out;
}
}
break;
case IEEE80211_M_IBSS:
}
break;
case IEEE80211_M_IBSS:
vap->iv_stats.is_rx_notassoc++;
goto err;
}
vap->iv_stats.is_rx_notassoc++;
goto err;
}
/*
* If we're a 4 address packet, make sure we have an entry in
* the node table for the packet source address (addr4).
/*
* If we're a 4 address packet, make sure we have an entry in
* the node table for the packet source address (addr4).
*/
/* check for wds link first */
*/
/* check for wds link first */
TAILQ_FOREACH(avp, &vap->iv_wdslinks, iv_wdsnext) {
if (!memcmp(avp->wds_mac, wh->i_addr2, IEEE80211_ADDR_LEN)) {
IEEE80211_LOCK_IRQ(ni->ni_ic);
TAILQ_FOREACH(avp, &vap->iv_wdslinks, iv_wdsnext) {
if (!memcmp(avp->wds_mac, wh->i_addr2, IEEE80211_ADDR_LEN)) {
IEEE80211_LOCK_IRQ(ni->ni_ic);
}
/* XXX: Useless node mgmt API; make better */
}
/* XXX: Useless node mgmt API; make better */
struct ieee80211_node_table *nt = &ic->ic_sta;
struct ieee80211_frame_addr4 *wh4;
struct ieee80211_node_table *nt = &ic->ic_sta;
struct ieee80211_frame_addr4 *wh4;
/*
* Handle privacy requirements. Note that we
* must not be preempted from here until after
/*
* Handle privacy requirements. Note that we
* must not be preempted from here until after
if (! accept_data_frame(vap, ni, key, skb, eh))
goto out;
if (! accept_data_frame(vap, ni, key, skb, eh))
goto out;
IEEE80211_NODE_STAT(ni, rx_data);
IEEE80211_NODE_STAT_ADD(ni, rx_bytes, skb->len);
ic->ic_lastdata = jiffies;
IEEE80211_NODE_STAT(ni, rx_data);
IEEE80211_NODE_STAT_ADD(ni, rx_bytes, skb->len);
ic->ic_lastdata = jiffies;
dev = vap->iv_xrvap->iv_dev;
#endif
dev = vap->iv_xrvap->iv_dev;
#endif
/* perform as a bridge within the vap */
/* XXX intra-vap bridging only */
if (vap->iv_opmode == IEEE80211_M_HOSTAP &&
/* perform as a bridge within the vap */
/* XXX intra-vap bridging only */
if (vap->iv_opmode == IEEE80211_M_HOSTAP &&
if (ni1 != NULL) {
if (ni1->ni_vap == vap &&
ieee80211_node_is_authorized(ni1) &&
if (ni1 != NULL) {
if (ni1->ni_vap == vap &&
ieee80211_node_is_authorized(ni1) &&
--- a/net80211/ieee80211_input.c
+++ b/net80211/ieee80211_input.c
--- a/net80211/ieee80211_input.c
+++ b/net80211/ieee80211_input.c
}
if (skb1 != NULL) {
struct ieee80211_node *ni_tmp;
}
if (skb1 != NULL) {
struct ieee80211_node *ni_tmp;
skb1->dev = dev;
skb_reset_mac_header(skb1);
skb_set_network_header(skb1, sizeof(struct ether_header));
skb1->dev = dev;
skb_reset_mac_header(skb1);
skb_set_network_header(skb1, sizeof(struct ether_header));
skb1->protocol = __constant_htons(ETH_P_802_2);
/* XXX insert vlan tag before queue it? */
ni_tmp = SKB_CB(skb1)->ni; /* remember node so we can free it */
skb1->protocol = __constant_htons(ETH_P_802_2);
/* XXX insert vlan tag before queue it? */
ni_tmp = SKB_CB(skb1)->ni; /* remember node so we can free it */