From 7eba0ddc5e892162607cb675f48270fd22adf38b Mon Sep 17 00:00:00 2001 From: Georg Lukas Date: Fri, 13 Jun 2008 16:27:53 +0200 Subject: [PATCH] adhoc WDS: sending multicast to original ether_dhost instead of own mac address --- net80211/ieee80211_output.c | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/net80211/ieee80211_output.c b/net80211/ieee80211_output.c index 45bf177..67781d5 100644 --- a/net80211/ieee80211_output.c +++ b/net80211/ieee80211_output.c @@ -830,6 +830,20 @@ ieee80211_encap(struct ieee80211_node *ni, struct sk_buff *skb, int *framecnt) case IEEE80211_M_IBSS: case IEEE80211_M_AHDEMO: ismulticast = IEEE80211_IS_MULTICAST(eh.ether_dhost); + if ((vap->iv_flags_ext & IEEE80211_FEXT_WDS) && + !IEEE80211_ADDR_EQ(eh.ether_shost, vap->iv_myaddr)) { + use4addr = 1; + /* Add a WDS entry to the station VAP */ + if (ismulticast) { + struct ieee80211_node_table *nt = &ic->ic_sta; + struct ieee80211_node *ni_wds + = ieee80211_find_wds_node(nt, eh.ether_shost); + if (ni_wds) + ieee80211_unref_node(&ni_wds); + else + ieee80211_add_wds_addr(nt, ni, eh.ether_shost, 0); + } + } break; case IEEE80211_M_WDS: use4addr = 1; @@ -981,7 +995,10 @@ ieee80211_encap(struct ieee80211_node *ni, struct sk_buff *skb, int *framecnt) wh->i_dur = 0; if (use4addr) { wh->i_fc[1] = IEEE80211_FC1_DIR_DSTODS; - IEEE80211_ADDR_COPY(wh->i_addr1, ni->ni_macaddr); + if (ismulticast && (vap->iv_opmode == IEEE80211_M_IBSS || vap->iv_opmode == IEEE80211_M_AHDEMO)) + IEEE80211_ADDR_COPY(wh->i_addr1, eh.ether_dhost); + else + IEEE80211_ADDR_COPY(wh->i_addr1, ni->ni_macaddr); IEEE80211_ADDR_COPY(wh->i_addr2, vap->iv_myaddr); IEEE80211_ADDR_COPY(wh->i_addr3, eh.ether_dhost); IEEE80211_ADDR_COPY(WH4(wh)->i_addr4, eh.ether_shost); -- 1.5.5.4