Changeset View
Changeset View
Standalone View
Standalone View
sys/net80211/ieee80211_wds.c
Show First 20 Lines • Show All 232 Lines • ▼ Show 20 Lines | |||||
ieee80211_dwds_mcast(struct ieee80211vap *vap0, struct mbuf *m) | ieee80211_dwds_mcast(struct ieee80211vap *vap0, struct mbuf *m) | ||||
{ | { | ||||
struct ieee80211com *ic = vap0->iv_ic; | struct ieee80211com *ic = vap0->iv_ic; | ||||
const struct ether_header *eh = mtod(m, const struct ether_header *); | const struct ether_header *eh = mtod(m, const struct ether_header *); | ||||
struct ieee80211_node *ni; | struct ieee80211_node *ni; | ||||
struct ieee80211vap *vap; | struct ieee80211vap *vap; | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
struct mbuf *mcopy; | struct mbuf *mcopy; | ||||
int err; | int err, len; | ||||
KASSERT(ETHER_IS_MULTICAST(eh->ether_dhost), | KASSERT(ETHER_IS_MULTICAST(eh->ether_dhost), | ||||
("%s not mcast", ether_sprintf(eh->ether_dhost))); | ("%s not mcast", ether_sprintf(eh->ether_dhost))); | ||||
len = m->m_pkthdr.len; | |||||
/* XXX locking */ | /* XXX locking */ | ||||
TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { | TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { | ||||
/* only DWDS vaps are interesting */ | /* only DWDS vaps are interesting */ | ||||
if (vap->iv_opmode != IEEE80211_M_WDS || | if (vap->iv_opmode != IEEE80211_M_WDS || | ||||
(vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY)) | (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY)) | ||||
continue; | continue; | ||||
/* if it came in this interface, don't send it back out */ | /* if it came in this interface, don't send it back out */ | ||||
ifp = vap->iv_ifp; | ifp = vap->iv_ifp; | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { | ||||
mcopy->m_flags |= M_MCAST; | mcopy->m_flags |= M_MCAST; | ||||
mcopy->m_pkthdr.rcvif = (void *) ni; | mcopy->m_pkthdr.rcvif = (void *) ni; | ||||
err = ieee80211_parent_xmitpkt(ic, mcopy); | err = ieee80211_parent_xmitpkt(ic, mcopy); | ||||
if (err) { | if (err) { | ||||
/* NB: IFQ_HANDOFF reclaims mbuf */ | /* NB: IFQ_HANDOFF reclaims mbuf */ | ||||
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); | if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); | ||||
ieee80211_free_node(ni); | ieee80211_free_node(ni); | ||||
} else | } else { | ||||
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); | if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); | ||||
if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); | |||||
if_inc_counter(ifp, IFCOUNTER_OBYTES, len); | |||||
} | |||||
} | } | ||||
} | } | ||||
/* | /* | ||||
* Handle DWDS discovery on receipt of a 4-address frame in | * Handle DWDS discovery on receipt of a 4-address frame in | ||||
* ap mode. Queue the frame and post an event for someone | * ap mode. Queue the frame and post an event for someone | ||||
* to plumb the necessary WDS vap for this station. Frames | * to plumb the necessary WDS vap for this station. Frames | ||||
* received prior to the vap set running will then be reprocessed | * received prior to the vap set running will then be reprocessed | ||||
▲ Show 20 Lines • Show All 486 Lines • Show Last 20 Lines |