From 5c8a4212a704139521c9ab8cc9cd7e52fc645ed6 Mon Sep 17 00:00:00 2001 From: nbd Date: Tue, 12 Jan 2010 03:10:03 +0000 Subject: mac80211: upgrade to a new unofficial snapshot based on wireless-testing+wireless-2.6 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19110 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../patches/540-wds_assoc_dummyframe.patch | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 package/mac80211/patches/540-wds_assoc_dummyframe.patch (limited to 'package/mac80211/patches/540-wds_assoc_dummyframe.patch') diff --git a/package/mac80211/patches/540-wds_assoc_dummyframe.patch b/package/mac80211/patches/540-wds_assoc_dummyframe.patch new file mode 100644 index 000000000..9efb3ac6d --- /dev/null +++ b/package/mac80211/patches/540-wds_assoc_dummyframe.patch @@ -0,0 +1,76 @@ +--- a/net/mac80211/mlme.c ++++ b/net/mac80211/mlme.c +@@ -312,6 +312,38 @@ void ieee80211_send_nullfunc(struct ieee + ieee80211_tx_skb(sdata, skb); + } + ++static void ieee80211_send_4addr_nullfunc(struct ieee80211_local *local, ++ struct ieee80211_sub_if_data *sdata) ++{ ++ struct sk_buff *skb; ++ struct ieee80211_hdr *nullfunc; ++ __le16 fc; ++ ++ if (WARN_ON(sdata->vif.type != NL80211_IFTYPE_STATION)) ++ return; ++ ++ skb = dev_alloc_skb(local->hw.extra_tx_headroom + 30); ++ if (!skb) { ++ printk(KERN_DEBUG "%s: failed to allocate buffer for 4addr " ++ "nullfunc frame\n", sdata->name); ++ return; ++ } ++ skb_reserve(skb, local->hw.extra_tx_headroom); ++ ++ nullfunc = (struct ieee80211_hdr *) skb_put(skb, 30); ++ memset(nullfunc, 0, 30); ++ fc = cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC | ++ IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS); ++ nullfunc->frame_control = fc; ++ memcpy(nullfunc->addr1, sdata->u.mgd.bssid, ETH_ALEN); ++ memcpy(nullfunc->addr2, sdata->vif.addr, ETH_ALEN); ++ memcpy(nullfunc->addr3, sdata->u.mgd.bssid, ETH_ALEN); ++ memcpy(nullfunc->addr4, sdata->vif.addr, ETH_ALEN); ++ ++ IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; ++ ieee80211_tx_skb(sdata, skb); ++} ++ + /* spectrum management related things */ + static void ieee80211_chswitch_work(struct work_struct *work) + { +@@ -1120,6 +1152,13 @@ static bool ieee80211_assoc_success(stru + ieee80211_set_associated(sdata, cbss, changed); + + /* ++ * If we're using 4-addr mode, let the AP know that we're ++ * doing so, so that it can create the STA VLAN on its side ++ */ ++ if (ifmgd->use_4addr) ++ ieee80211_send_4addr_nullfunc(local, sdata); ++ ++ /* + * Start timer to probe the connection to the AP now. + * Also start the timer that will detect beacon loss. + */ +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -1111,6 +1111,18 @@ ieee80211_rx_h_sta_process(struct ieee80 + if (ieee80211_is_nullfunc(hdr->frame_control) || + ieee80211_is_qos_nullfunc(hdr->frame_control)) { + I802_DEBUG_INC(rx->local->rx_handlers_drop_nullfunc); ++ ++ /* ++ * If we receive a 4-addr nullfunc frame from a STA ++ * that was not moved to a 4-addr STA vlan yet, drop ++ * the frame to the monitor interface, to make sure ++ * that hostapd sees it ++ */ ++ if (ieee80211_has_a4(hdr->frame_control) && ++ (rx->sdata->vif.type == NL80211_IFTYPE_AP || ++ (rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN && ++ !rx->sdata->u.vlan.sta))) ++ return RX_DROP_MONITOR; + /* + * Update counter and free packet here to avoid + * counting this as a dropped packed. -- cgit v1.2.3