From 5bee720fd7fa5ed4eade96058acd3a684da30932 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 14 Aug 2005 19:08:39 -0700 Subject: [PATCH] hostap: Fix skb->cb use for TX meta data Old AP mode code for power saving was using skb->cb for couple of flags before the more generic 802.11 TX code started using the same buffer for struct hostap_skb_tx_data. This resulted in the power save code corrupting the magic value in beginning of the buffer and TX code dropping the power saved packets because of this for the case where STAs send PS-Poll frames with PwrMgmt flag set. This patch modifies the power save code to use the same struct hostap_skb_tx_data as rest of the TX path in order to avoid corrupting the data in skb->cb. In addition, this patch reorders fields in the structure and makes them use smaller types in order to make the structure fit in skb->cb on 64-bit hosts. Signed-off-by: Jouni Malinen Signed-off-by: Jeff Garzik --- drivers/net/wireless/hostap/hostap_80211_tx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/net/wireless/hostap/hostap_80211_tx.c') diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c index 8f39871d690..cfb3ecc783f 100644 --- a/drivers/net/wireless/hostap/hostap_80211_tx.c +++ b/drivers/net/wireless/hostap/hostap_80211_tx.c @@ -226,7 +226,8 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev) meta = (struct hostap_skb_tx_data *) skb->cb; memset(meta, 0, sizeof(*meta)); meta->magic = HOSTAP_SKB_TX_DATA_MAGIC; - meta->wds = use_wds; + if (use_wds) + meta->flags |= HOSTAP_TX_FLAGS_WDS; meta->ethertype = ethertype; meta->iface = iface; @@ -410,7 +411,8 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) case AP_TX_CONTINUE_NOT_AUTHORIZED: if (local->ieee_802_1x && HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA && - meta->ethertype != ETH_P_PAE && !meta->wds) { + meta->ethertype != ETH_P_PAE && + !(meta->flags & HOSTAP_TX_FLAGS_WDS)) { printk(KERN_DEBUG "%s: dropped frame to unauthorized " "port (IEEE 802.1X): ethertype=0x%04x\n", dev->name, meta->ethertype); -- cgit v1.2.3-70-g09d2