Correct pointer arithmetic in the SKB CB.
authormentor <mentor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Tue, 5 Feb 2008 06:22:32 +0000 (06:22 +0000)
committermentor <mentor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Tue, 5 Feb 2008 06:22:32 +0000 (06:22 +0000)
With thanks (but not copyright ;) to Alessandro Erta

git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3337 0192ed92-7a03-0410-a25b-9323aeb14dbd

THANKS
ath/if_ath.c
net80211/ieee80211_monitor.c

diff --git a/THANKS b/THANKS
index a79b360790db72d77f4660a2ea36dfc17e3b9944..56448eaab595ce3091e936eee9efbf989f8099ab 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -129,6 +129,7 @@ Derek J Smithies
 jhansen
 Benoit Papillault
 Russell Harmon
+Alessandro Erta
 
 Apologies to anyone whose name was unintentionally left off.
 Please let us know if you think your name should be mentioned here!
index 2df32d6598c4cc17f66119bdec9cc02910b1e9c1..a7ddd91f06dfec81563977ba909204ad86249ed7 100644 (file)
@@ -2859,7 +2859,7 @@ ath_tx_startraw(struct net_device *dev, struct ath_buf *bf, struct sk_buff *skb)
        struct ath_softc *sc = dev->priv;
        struct ath_hal *ah = sc->sc_ah;
        struct ieee80211_phy_params *ph = (struct ieee80211_phy_params *)
-               (SKB_CB(skb) + sizeof(struct ieee80211_cb));
+               (SKB_CB(skb) + 1); /* NB: SKB_CB casts to CB struct*. */
        const HAL_RATE_TABLE *rt;
        unsigned int pktlen, hdrlen, try0, power;
        HAL_PKT_TYPE atype;
index ff52576d0162339d1466e12047b47387db57407f..ee42d4e8b8b7cb718e7552b68cc11767a81622da 100644 (file)
@@ -128,8 +128,8 @@ struct ar5212_openbsd_desc {
 void
 ieee80211_monitor_encap(struct ieee80211vap *vap, struct sk_buff *skb)
 {
-       struct ieee80211_phy_params *ph =
-               (struct ieee80211_phy_params *) (SKB_CB(skb) + sizeof(struct ieee80211_cb));
+       struct ieee80211_phy_params *ph = (struct ieee80211_phy_params *)
+               (SKB_CB(skb) + 1); /* NB: SKB_CB casts to CB struct*. */
        SKB_CB(skb)->flags = M_RAW;
        SKB_CB(skb)->ni = NULL;
        SKB_CB(skb)->next = NULL;