--- prism2.c.orig	Sat Apr  6 22:58:03 2002
+++ prism2.c	Sat Apr  6 22:58:15 2002
@@ -1450,14 +1450,29 @@ static int prism2_tx(struct sk_buff *skb
 	if (!res)
 		res = hfa384x_to_bap(dev, BAP0, &snap_header,
 				     sizeof(snap_header));
+#ifdef PRISM2_STA_HAS_NO_HOSTAP_WDS_BUG
 	if (!res)
 		res = hfa384x_to_bap(dev, BAP0, skb->data + 2 * ETH_ALEN,
 				     skb->len - 2 * ETH_ALEN);
-#ifndef PRISM2_STA_HAS_NO_HOSTAP_WDS_BUG
-	if (!res && wds) {
-		/* add addr4 (SA) to bogus frame format */
-		res = hfa384x_to_bap(dev, BAP0, skb->data + ETH_ALEN,
-				     ETH_ALEN);
+#else /* PRISM2_STA_HAS_NO_HOSTAP_WDS_BUG */
+	if (!res) {
+		int wlen = skb->len - 2 * ETH_ALEN;
+		int is_odd = wlen & 1;
+		if (wds && is_odd)
+			wlen--; /* need to avoid using odd offset */
+		res = hfa384x_to_bap(dev, BAP0, skb->data + 2 * ETH_ALEN,
+				     wlen);
+
+		/* add addr4 (SA) to bogus frame format if WDS is used */
+		if (!res && wds && is_odd) {
+			char tmpbuf[ETH_ALEN + 1];
+			tmpbuf[0] = *(skb->data + skb->len - 1);
+			memcpy(tmpbuf + 1, skb->data + ETH_ALEN, ETH_ALEN);
+			res = hfa384x_to_bap(dev, BAP0, tmpbuf, ETH_ALEN + 1);
+		} else if (!res && wds) {
+			res = hfa384x_to_bap(dev, BAP0, skb->data + ETH_ALEN,
+					     ETH_ALEN);
+		}
 	}
 #endif /* PRISM2_STA_HAS_NO_HOSTAP_WDS_BUG */
 	spin_unlock_bh(&local->baplock);

