From 27340ca1f3dd17b9038c113cb622d62ca5fdbecf Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 27 Jul 2003 02:56:56 +0000 Subject: Fixed Ethernet src_addr in TX descriptor when sending out WDS frames using standard compliant 4-addr frames. --- driver/modules/hostap_hw.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/driver/modules/hostap_hw.c b/driver/modules/hostap_hw.c index 900992e..1a72f6c 100644 --- a/driver/modules/hostap_hw.c +++ b/driver/modules/hostap_hw.c @@ -1720,6 +1720,8 @@ static int prism2_tx(struct sk_buff *skb, struct net_device *dev) } fc = (WLAN_FC_TYPE_DATA << 2) | (WLAN_FC_STYPE_DATA << 4); + memcpy(&txdesc.dst_addr, skb->data, 2 * ETH_ALEN); + if (use_wds != WDS_NO) { /* Note! Prism2 station firmware has problems with sending real * 802.11 frames with four addresses; until these problems can @@ -1745,6 +1747,8 @@ static int prism2_tx(struct sk_buff *skb, struct net_device *dev) /* SA from skb->data + ETH_ALEN will be added after * frame payload */ data_len += ETH_ALEN; + + memcpy(&txdesc.src_addr, dev->dev_addr, ETH_ALEN); } /* send broadcast and multicast frames to broadcast RA, if @@ -1758,9 +1762,6 @@ static int prism2_tx(struct sk_buff *skb, struct net_device *dev) memcpy(&txdesc.addr1, local->bssid, ETH_ALEN); memcpy(&txdesc.addr2, dev->dev_addr, ETH_ALEN); memcpy(&txdesc.addr3, skb->data, ETH_ALEN); - - memcpy(&txdesc.dst_addr, &txdesc.addr3, ETH_ALEN); - memcpy(&txdesc.src_addr, &txdesc.addr2, ETH_ALEN); } else if (local->iw_mode == IW_MODE_MASTER && !to_assoc_ap) { fc |= WLAN_FC_FROMDS; /* From DS: Addr1 = DA, Addr2 = BSSID, Addr3 = SA */ @@ -1785,8 +1786,6 @@ static int prism2_tx(struct sk_buff *skb, struct net_device *dev) txdesc.frame_control = __cpu_to_le16(fc); txdesc.data_len = __cpu_to_le16(data_len); txdesc.len = __cpu_to_be16(data_len); - if (use_wds == WDS_NO) - memcpy(&txdesc.dst_addr, skb->data, 2 * ETH_ALEN); skb->dev = dev; -- cgit v0.12